xen-devel
[Xen-devel] Re: [PATCH] EPT: Flush running cpus, add mask to flush when
To: |
Keir Fraser <keir.fraser@xxxxxxxxxxxxx> |
Subject: |
[Xen-devel] Re: [PATCH] EPT: Flush running cpus, add mask to flush when scheduled in |
From: |
George Dunlap <George.Dunlap@xxxxxxxxxxxxx> |
Date: |
Mon, 21 Sep 2009 19:04:47 +0100 |
Cc: |
Xiaohui Xin <Xiaohui.xin@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, Paul Durrant <Paul.Durrant@xxxxxxxxxx>, Xin Li <xin.b.li@xxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx> |
Delivery-date: |
Mon, 21 Sep 2009 11:05:21 -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; bh=EfSxrNuUGGA1JHUT7pGNWzdSmPeFCUKRVKMtmOI/5XE=; b=VtsesriaDcGRGvQn+o7zEimlERaRS+JDPjDus27KNqTwfqhglEnx4GZni3Z16Aj/i8 qq6VQi6x1fdlGZAXWNBc2gkJ08PDzKqVTJCTfecqcFGPxrKOZ/V06zYKyj5Azo8FncXr sEho7jFIyyEffAzrLwZhWZEhaxxqD8NDqC3zs= |
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; b=PQZ5tBRxPU+JJqUtNU/pOURjrFejDPLPqfC3wLfl10COoJoYod80J48b2ldlxSuXn9 lIuf/09Flj5QlBoCWjXExsmERfZzsDBDj+HQpiJZE9SJtzJK06SwfgdlXLPI7IYjOr7Z M65bw1wdK84BnPUj1IICPsTRrmKWUZiN2w/Uk= |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<de76405a0909211104p5e374e52g8f74a29c6f587a81@xxxxxxxxxxxxxx> |
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: |
<de76405a0909211104p5e374e52g8f74a29c6f587a81@xxxxxxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
Oops, patch...
-George
On Mon, Sep 21, 2009 at 7:04 PM, George Dunlap
<George.Dunlap@xxxxxxxxxxxxx> wrote:
> The attached patch modifies ept_sync_domain() to make it more
> efficient wrt flushing ept translations.
>
> Specifically:
> * It synchronously flushes only cpus on which the domain is currently
> running (d->domain_dirty_cpumask)
> * It introduces a new vmx-specific mask, "ept_needs_flush", set to the
> complement of d->domain_dirty_cpumask
> * In vmx_ctxt_switch_to(), if the cpu is set in ept_needs_flush, it
> flushes ept before running.
>
> Main change I'd like reviewed: in order to avoid a potential race
> condition described below, I had to re-order the setting of
> domain_dirty_cpumask and the calling of arch.ctxt_switch_to() in
> __context_switch().
>
> Potential race without the re-ordering:
> p1: change ept
> p2: check ept_needs_flush, finds it false, doesn't flush
> p1: sets ept_needs_flush
> p1: checks domain_dirty, finds p2 not in it
> p2: sets domain_dirty
>
> Thus the vcpu on p2 is scheduled without its ept translations being flushed.
>
> I've tested this with a 2-vcpu VM doing a parallel compile and
> ballooning, no problems.
>
> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
>
20090921-ept-careful-flushing.diff
Description: Text Data
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|