xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmx: Allow software (user defined) interrupts to be injected in to the guest
@ 2012-04-20  5:04 Aravindh Puthiyaparambil
  2012-04-20  8:54 ` Jan Beulich
  0 siblings, 1 reply; 13+ messages in thread
From: Aravindh Puthiyaparambil @ 2012-04-20  5:04 UTC (permalink / raw)
  To: xen-devel

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>

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. */

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-05-03 18:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20  5:04 [PATCH] vmx: Allow software (user defined) interrupts to be injected in to the guest Aravindh Puthiyaparambil
2012-04-20  8:54 ` Jan Beulich
2012-04-20 10:12   ` Keir Fraser
2012-05-02  8:53   ` Dong, Eddie
2012-05-02  9:23     ` Jan Beulich
2012-05-03  0:25       ` Dong, Eddie
2012-05-03  1:55         ` Aravindh Puthiyaparambil
2012-05-03  5:02           ` Dong, Eddie
2012-05-03  9:26         ` Jan Beulich
2012-05-03 13:42           ` Dong, Eddie
2012-05-03 14:17             ` Jan Beulich
2012-05-03 14:35             ` Keir Fraser
2012-05-03 18:15             ` Aravindh Puthiyaparambil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).