xen-devel
[Xen-devel] Re: [PATCH] EPT: Flush running cpus, add mask to flush when
To: |
"George Dunlap" <George.Dunlap@xxxxxxxxxxxxx> |
Subject: |
[Xen-devel] Re: [PATCH] EPT: Flush running cpus, add mask to flush when scheduled in |
From: |
"Jan Beulich" <JBeulich@xxxxxxxxxx> |
Date: |
Tue, 22 Sep 2009 08:07:34 +0100 |
Cc: |
Xiaohui Xin <Xiaohui.xin@xxxxxxxxx>, Xin Li <xin.b.li@xxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, Paul Durrant <Paul.Durrant@xxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx> |
Delivery-date: |
Tue, 22 Sep 2009 00:08:04 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<de76405a0909211104l3253f2a6r6d8c414cde9fe288@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> <de76405a0909211104l3253f2a6r6d8c414cde9fe288@xxxxxxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
>--- a/xen/arch/x86/hvm/vmx/vmx.c Tue Sep 15 10:08:12 2009 +0100
>+++ b/xen/arch/x86/hvm/vmx/vmx.c Mon Sep 21 18:52:26 2009 +0100
>...
>@@ -1219,7 +1226,11 @@
> if ( d->arch.hvm_domain.hap_enabled && d->vcpu && d->vcpu[0] )
> {
> ASSERT(local_irq_is_enabled());
>- on_each_cpu(__ept_sync_domain, d, 1);
>+ /* Mark cpus that may need flushing on next schedule */
>+ cpus_complement(d->arch.hvm_domain.vmx.ept_needs_flush,
>+ d->domain_dirty_cpumask);
>+ /* And flush on actively-running processors */
>+ on_selected_cpus(&d->domain_dirty_cpumask, __ept_sync_domain, d, 1);
> }
> }
>
Passing a pointer to the global cpu mask looks racy here: What if a CPU
disappears from domain_dirty_cpumask under your feet?
Also, merely using cpus_complement() here seem inefficient: It should be
possible to accumulate the flush activity, and avoid re-flushing on a CPU
which e.g. got flushed on the second from the last run through this code
(and not dirtied afterwards). I.e. I'd think there should be cpus_andnot()
here, and setting of the bits as CPUs get dirtied.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|