[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/vmx: clean up TRAP_int3 handling



commit b7d4cffbf2b17ec8a5c233f84395f4f85ad1a91d
Author:     Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
AuthorDate: Mon Jul 4 12:11:03 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jul 4 12:11:03 2016 +0200

    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@xxxxxxxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c | 36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 547233a..df19579 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -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();
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.