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

[Xen-devel] Re: [PATCH] EPT: Flush running cpus, add mask to flush when

>--- 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