x86/vmx: clean up TRAP_int3 handling

Clean up the handling of TRAP_int3 VMEXITs to conform to the handling
of TRAP_debug.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
Tamas K Lengyel authored and Jan Beulich committed 2016-07-04 12:11:03 +02:00
1 parent 94db5dbb6c
commit b7d4cffbf2
1 file changed
+12 -24
+12 -24
View File
@@ -3402,17 +3402,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
else
domain_pause_for_debugger();
break;
case TRAP_int3:
{
case TRAP_int3:
HVMTRACE_1D(TRAP, vector);
if ( v->domain->debugger_attached )
if ( !v->domain->debugger_attached )
{
update_guest_eip(); /* Safe: INT3 */
v->arch.gdbsx_vcpu_event = TRAP_int3;
domain_pause_for_debugger();
break;
}
else {
unsigned long insn_len;
int rc;
@@ -3422,23 +3415,18 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
X86_EVENTTYPE_SW_EXCEPTION,
insn_len);
if ( rc < 0 )
goto exit_and_crash;
if ( !rc )
{
struct hvm_trap trap = {
.vector = TRAP_int3,
.type = X86_EVENTTYPE_SW_EXCEPTION,
.error_code = HVM_DELIVER_NO_ERROR_CODE,
.insn_len = insn_len
};
hvm_inject_trap(&trap);
break;
}
if ( rc > 0 )
break;
vmx_propagate_intr(intr_info);
}
goto exit_and_crash;
}
else
{
update_guest_eip(); /* Safe: INT3 */
v->arch.gdbsx_vcpu_event = TRAP_int3;
domain_pause_for_debugger();
}
break;
case TRAP_no_device:
HVMTRACE_1D(TRAP, vector);
vmx_fpu_dirty_intercept();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.