[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/9] x86/PV: properly set shadow allocation for Dom0


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Sep 2021 16:28:47 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vlLwpVbKdDGidk/pmbCgqtPtVvafgbou6IhVrWQQ+a8=; b=ZXoKzjvzSCkA4UZd6lqtYX2A3BZTGqo9b8VOfyZ1NLxACTi3P4M82bn4WUt2u/TK0GJb9uoydIaXQHAGf/NUo1Dkpyo5PPrUqT6ihOvTQ3m7M7v8q+/alWo2g0nmogEHCiowhF8zHaVJIdOFnICwTAeLgnsn0KGUELkSNPq30OnkhY7JQW4k/d6wAsIvm7uti5SqCvd7bb93D2+Y5kWsIsv4VFjEWIYwB2P5HwZ8v70Gae56hwayLueY0sjqpiU9fb0Kvz6aIG7vIENp2yMxyzp4sXNzi4yhmxb2SUNY9PsHO5dPKHArI8yE7v9rRnjLNYq90aGLYSKm/UUJ1azTKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuWgZBbYNQrZxonekWRi1lLS6coj18ejGkjfTTqvMcpc8Kq9Waszfctwu0JO2wo3ry4rWBaxu5YcYaVspB5CBzfsTvemVe09lzxzGpOJJs4kUQldN1CapevoySWPSPVE7AkY/qicSCcNYOvOmIUOAYz/RTrYJaCQegV4vd92Fers6uPFeWHJyZey0UU7BEQCBpxtBMnEBnLKmZyGLGc/gYOEBps/P/8dC8rFoISEKcOzFS1m8M9QmJwN9qGQMfRbSskDXCF74O6SWd39rs0S7Z2zdx+uU/4I+KsrDXP832n9W6MgobHRtf6+YECgE6b+SNBDgQTs2zBzgP5m2DMkNw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Tim Deegan <tim@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Sep 2021 14:29:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.09.2021 16:25, Roger Pau Monné wrote:
> On Wed, Sep 22, 2021 at 03:50:25PM +0200, Jan Beulich wrote:
>> On 22.09.2021 15:31, Andrew Cooper wrote:
>>> On 21/09/2021 08:17, Jan Beulich wrote:
>>>> @@ -933,7 +934,18 @@ int __init dom0_construct_pv(struct doma
>>>>  #ifdef CONFIG_SHADOW_PAGING
>>>>      if ( opt_dom0_shadow )
>>>>      {
>>>> +        bool preempted;
>>>> +
>>>>          printk("Switching dom0 to using shadow paging\n");
>>>> +
>>>> +        nr_pt_pages = dom0_paging_pages(d, nr_pages);
>>>> +
>>>> +        do {
>>>> +            preempted = false;
>>>> +            shadow_set_allocation(d, nr_pt_pages, &preempted);
>>>> +            process_pending_softirqs();
>>>> +        } while ( preempted );
>>>
>>> This is still broken.
>>>
>>> The loop setting the shadow allocation needs to be outside of this
>>> conditional, because it is not related to early activation of the l1tf
>>> tasklet.
>>
>> Well, I'm not sure what to say. On v1 you already said so. But then you
>> didn't care to reply to me responding:
>>
>> "Are you suggesting to set up a (perhaps large) shadow pool just in
>>  case we need to enable shadow mode on Dom0? And all of this memory
>>  to then remain unused in the majority of cases?
>>
>>  Plus even if so, I'd view this as a 2nd, independent step, largely
>>  orthogonal to the handling of "dom0=shadow". If somebody really
>>  wanted that, I think this should be driven by an explicit setting
>>  of the shadow pool size, indicating the admin is willing to waste
>>  the memory.
> 
> Maybe an acceptable compromise would be to allocate the pool if
> opt_dom0_shadow || opt_pv_l1tf_hwdom?
> 
> opt_pv_l1tf_hwdom is not enabled by default, so an admin opting to
> enable it should also be willing to reserve the memory it requires in
> case it needs activating during runtime.

I'd be fine making that change. Andrew - would that be sufficient to
address your concern?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.