[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.2-testing] vmx: avoid taking locks with irqs disabled



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224587213 -3600
# Node ID f44c7681c43819ebaf5bb0fd4430517ca6dbc3ec
# Parent  3bac39661aa21b76f95860d74a9c4464768a5095
vmx: avoid taking locks with irqs disabled

Shuffle the bits of the vmexit handler that run with EFLAGS.IF == 0 up
to the top.  Otherwise we end up calling spin_lock() with interrupts
disabled, which can deadlock against the time-synchronization
rendezvous code.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
xen-unstable changeset:   18658:824892134573b05573ca1945757bb2a99e220a02
xen-unstable date:        Mon Oct 20 15:31:54 2008 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff -r 3bac39661aa2 -r f44c7681c438 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 21 12:06:23 2008 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 21 12:06:53 2008 +0100
@@ -2746,8 +2746,12 @@ asmlinkage void vmx_vmexit_handler(struc
 
     perfc_incra(vmexits, exit_reason);
 
-    if ( exit_reason != EXIT_REASON_EXTERNAL_INTERRUPT )
-        local_irq_enable();
+    /* Handle the interrupt we missed before allowing any more in. */
+    if ( exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT )
+        vmx_do_extint(regs);
+
+    /* Now enable interrupts so it's safe to take locks. */
+    local_irq_enable();
 
     if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) )
         return vmx_failed_vmentry(exit_reason, regs);
@@ -2867,7 +2871,7 @@ asmlinkage void vmx_vmexit_handler(struc
         break;
     }
     case EXIT_REASON_EXTERNAL_INTERRUPT:
-        vmx_do_extint(regs);
+        /* Already handled above. */
         break;
     case EXIT_REASON_TRIPLE_FAULT:
         hvm_triple_fault();

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.