WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH] EPT: Only sync pcpus on which a domain's vc

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] EPT: Only sync pcpus on which a domain's vcpus might be running
From: George Dunlap <dunlapg@xxxxxxxxx>
Date: Fri, 18 Sep 2009 10:09:01 +0100
Cc: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, Xiaohui Xin <Xiaohui.xin@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Xin Li <xin.b.li@xxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>
Delivery-date: Fri, 18 Sep 2009 02:09:27 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=w8vNZd+FYArV5l3J6e3xxAPBxES52GvXk+aaJOp2hcU=; b=qBaCE9riuOgkSKnpT93W++UKEIzZzm6DB042FXwZeyeQC0+NKGAIqaO377numQoqVK DuM0aO00aoAhKOm8rCiDs930boT4JJVTX+8kXGr0UapQ7kX/sZ9wLoRat9FAxDt3t8Ed LgyqrCESrBkrwVgSPvHcprNbmoxJhadrG8pLE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=D1sK9eWiZH/wYx5pv3ZFZrEeFwkqJdNBnSPCIgnZwh2bn1AJTLP4WcTGlNIyp1g+u1 SkLUGakHP+4ctH0y+8u+P7gYQHorSgiwSjapsE8l3srVtq0LP17SuberCfLPMlRjK/Em TbON4NTJr18weUYnJMTq+vZ/h6mY3N+/s8d7o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C6D8F8C2.1514A%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <de76405a0909171051i4f70c3e2l7321d27faefd9cb7@xxxxxxxxxxxxxx> <C6D8F8C2.1514A%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Just making sure I understand the failure mode... the risk is that if
we change the p2m for this domain while a vcpu is not running on that
core, and it's scheduled there again, it may have stale mappings that
get used (tagged by the EPT base pointer).

Hmm... any idea the performance implications of flushing the EPT
mappings when switching out?  The main performance problem I need to
fix is the ballooning case.  Without this patch, on my 2x4x2 Nehalem
box, a single-vcpu guest ballooning from 16GiB down to 8GiB for an
initial boot takes 12-15 minutes; with the patch, it takes around 40
seconds.

Perhaps we could start with the flush-ept-on-context-switch-out, and
do some performance testing later to see if it's worth maintaining a
"might-need-an-ept-flush" mask.

 -George

On Fri, Sep 18, 2009 at 8:43 AM, Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:
> This is definitely not safe. See ARM Vol 3B Section 24.3.3. EPTP-tagged
> cached mappings (that is, partial mappings from guest-phys to host-phys
> addresses, tagged by the EPT base pointer value) only need be flushed when a
> suitable INVEPT instruction is executed. So a HVM VCPU can leave EPTP-tagged
> droppings lying around in other TLBs as it migrates from CPU to CPU -- the
> domain_dirty_cpumask does not track this!
>
> The way to fix this is to' if ( hap_enabled ) __invept(1,
> d->arch.hvm_domain.vmx.ept_control.eptp, 0)' in vmx_ctxt_switch_from(). That
> then makes your patch correct.
>
> Care to test this and spin another patch?
>
>  -- Keir
>
> On 17/09/2009 18:51, "George Dunlap" <dunlapg@xxxxxxxxx> wrote:
>
>> ept_sync_domain() is called whenever the p2m changes.  The current
>> code calls sync on all cpus; this is extremely wasteful, especially
>> for a single-vcpu VM on a 16-way (2x4x2) box.
>>
>> This patch will only call sync on cpus where there may be dirty cpu
>> state.  I've done a basic test, but I'd appreciate someone from Intel
>> verifying that there shouldn't be any problems.
>>
>> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel