Skip to contentSkip to conversation

Assert that the p2m lock is held in ept_sync_domain

PATCH New George Dunlap 1 participant 1 message Sep 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Assert that the p2m lock is held in ept_sync_domain

Quoted 14 lines · Keir Fraser
Quoted 6 lines · Jan Beulich
Quoted 1 line

Please see what you think of xen-unstable:20244.

With no assertion in ept_sync_domain() on any locks held, is it guaranteed that the function cannot be entered twice at the same time for a given guest? If not, passing a pointer to the new ept_synced member isn't any better than passing the one to domain_dirty_cpumask.

I assume George is knowledgeable on that area. If calls to ept_sync_domain() are not serialised then I think synchronisation around the ept_needs_flush/ept_synced cpumask is indeed pretty suspect. If there isn't such a serialising lock, we could add one to ept_sync_domain() quite safely.

Quoted 9 lines

 -- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

xen/arch/x86/hvm/vmx/vmx.c +1 -0
diff -r 5094980f9e16 xen/arch/x86/hvm/vmx/vmx.c
@@ -1233,6 +1233,7 @@
         return;
 
     ASSERT(local_irq_is_enabled());
+    ASSERT(p2m_locked_by_me(d->arch.p2m));
 
     /*
      * Flush active cpus synchronously. Flush others the next time this domain

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel