vmx: fix single stepping on debugger
PATCH 1/1 vmx: fix single stepping on debugger
The debuggee domain will die with unexpected trap
on single stepping of emulated instruction.
Signed-off-by Kouya Shimura <[email protected]>
xen/arch/x86/hvm/vmx/realmode.c +8 -0
@@ -148,6 +148,14 @@ static void realmode_emulate_one(struct hvmemul_ctxt->exn_insn_len =0 ; } +if ( curr->domain->debugger_attached && + ( hvmemul_ctxt->exn_vector == TRAP_debug || + hvmemul_ctxt->exn_vector == TRAP_int3 ) ) + { +domain_pause_for_debugger (); +return ; + } +if ( curr->arch.hvm_vcpu.guest_cr[0 ] &X86_CR0_PE ) { gdprintk(XENLOG_ERR, "Exception %02x in protected mode.\n",
xen/arch/x86/hvm/vmx/vmx.c +7 -2
@@ -1154,8 +1154,6 @@ static void vmx_inject_exception( {struct vcpu *curr = current; -vmx_inject_hw_exception (curr, trapnr, errcode); -if ( trapnr == TRAP_page_fault ) curr->arch.hvm_vcpu.guest_cr[2 ] = cr2;
@@ -1164,7 +1162,14 @@ static void vmx_inject_exception( {__restore_debug_registers (curr);write_debugreg (6 ,read_debugreg (6 ) |0x4000 ); +if ( curr->domain->debugger_attached ) + { +domain_pause_for_debugger (); +return ; + } } + +vmx_inject_hw_exception (curr, trapnr, errcode); }static int vmx_event_pending (struct vcpu *v)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel