@@ -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;
@@ -3423,22 +3416,17 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
insn_len);
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);
+ if ( rc < 0 )
+ goto exit_and_crash;
}
-
- 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();
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> --- Cc: Jun Nakajima <jun.nakajima@intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> --- xen/arch/x86/hvm/vmx/vmx.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-)