Skip to contentSkip to conversation

export debug status to debugger

PATCH New Kouya Shimura 1 participant 1 message Oct 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 export debug status to debugger

VMX does not update DR6 on VM exits.
It's inconvenient for debugging a domain.

xen/arch/x86/hvm/vmx/vmx.c +7 -0
diff -r e66cecb66b1e xen/arch/x86/hvm/vmx/vmx.c
@@ -2109,6 +2109,13 @@ asmlinkage void vmx_vmexit_handler(struc
         switch ( vector )
         {
         case TRAP_debug:
+            /*
+             * Updates DR6 where debugger can peek (See 3B 23.2.1,
+             * Table 23-1, "Exit Qualification for Debug Exceptions").
+             */
+            exit_qualification = __vmread(EXIT_QUALIFICATION);
+            write_debugreg(6, exit_qualification | 0xffff0ff0);
+            /* fall through */
         case TRAP_int3:
             if ( !v->domain->debugger_attached )
                 goto exit_and_crash;

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