[HVM][VMX] Propagate debug exception to guest if no external debugger is enabled.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 27 Jun 2006 08:33:35 +0000 (09:33 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 27 Jun 2006 08:33:35 +0000 (09:33 +0100)
Signed-off-by: George Dunlap <dunlapg@umich.edu>
xen/arch/x86/hvm/vmx/vmx.c

index c3019e95107d0d105819f14a6c5ef1ba6e051fc0..a8dca0dd2b72c68a947e1593c817e416cf23784e 100644 (file)
@@ -2080,10 +2080,19 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs regs)
         {
             void store_cpu_user_regs(struct cpu_user_regs *regs);
 
-            store_cpu_user_regs(&regs);
-            __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS, PENDING_DEBUG_EXC_BS);
-
-            domain_pause_for_debugger();
+            if ( test_bit(_DOMF_debugging, &v->domain->domain_flags) )
+            {
+                store_cpu_user_regs(&regs);
+                domain_pause_for_debugger();
+                __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS,
+                               PENDING_DEBUG_EXC_BS);
+            }
+            else
+            {
+                vmx_reflect_exception(v);
+                __vm_clear_bit(GUEST_PENDING_DBG_EXCEPTIONS,
+                               PENDING_DEBUG_EXC_BS);
+            }
 
             break;
         }