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

[Xen-devel] [PATCH] vmx: Allow software (user defined) interrupts to be injected in to the guest



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@xxxxxxxxxxxx>

diff -r 9036d6f974de -r f60377584f2d xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Thu Apr 19 21:55:51 2012 -0700
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Thu Apr 19 22:01:50 2012 -0700
@@ -1374,6 +1374,13 @@ void vmx_inject_hw_exception(int trap, i
 
         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 */
+        }
     }
 
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
diff -r 9036d6f974de -r f60377584f2d xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h   Thu Apr 19 21:55:51 2012 -0700
+++ b/xen/include/asm-x86/processor.h   Thu Apr 19 22:01:50 2012 -0700
@@ -111,6 +111,7 @@
 #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. */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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