]> xenbits.xensource.com Git - xen.git/commitdiff
vmx: Allow software (user defined) interrupts to be injected in to the guest
authorAravindh Puthiyaparambil <aravindh@virtuata.com>
Fri, 20 Apr 2012 08:43:46 +0000 (09:43 +0100)
committerAravindh Puthiyaparambil <aravindh@virtuata.com>
Fri, 20 Apr 2012 08:43:46 +0000 (09:43 +0100)
If xc_hvm_inject_trap() is called on a software (user defined)
interrupt, it causes the guest to crash with a vmentry failure. The
following patch fixes this issue.

Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/processor.h

index 111de983ccf02a470af1d70b1e270f19896797a5..de945ce05c8a4a2a0d1a2d9d029634fe9048579b 100644 (file)
@@ -1364,6 +1364,8 @@ void vmx_inject_hw_exception(int trap, int error_code)
         }
         if ( cpu_has_monitor_trap_flag )
             break;
+        /* fall through */
+
     case TRAP_int3:
         if ( curr->domain->debugger_attached )
         {
@@ -1374,6 +1376,15 @@ void vmx_inject_hw_exception(int trap, int error_code)
 
         type = X86_EVENTTYPE_SW_EXCEPTION;
         __vmwrite(VM_ENTRY_INSTRUCTION_LEN, 1); /* int3 */
+        break;
+
+    default:
+        if ( trap > TRAP_last_reserved )
+        {
+            type = X86_EVENTTYPE_SW_EXCEPTION;
+            __vmwrite(VM_ENTRY_INSTRUCTION_LEN, 2); /* int imm8 */
+        }
+        break;
     }
 
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
index 718d7191961c47e83bea7a7b6f794dfdbacc0435..4c6f52ed8ef49e93cdbabb2b58e498369076ac97 100644 (file)
 #define TRAP_alignment_check  17
 #define TRAP_machine_check    18
 #define TRAP_simd_error       19
+#define TRAP_last_reserved    31
 
 /* Set for entry via SYSCALL. Informs return code to use SYSRETQ not IRETQ. */
 /* NB. Same as VGCF_in_syscall. No bits in common with any other TRAP_ defn. */