WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [VMX] Check INTR_TYPE is NMI before doing

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [VMX] Check INTR_TYPE is NMI before doing physical NMI processing.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 08 Nov 2006 18:00:27 +0000
Delivery-date: Wed, 08 Nov 2006 10:00:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1d4fc7396c41658e8fb85267b7f4d9748dc99298
# Parent  4e3ddf1288fb2c5a434947a0366490944c9ea399
[VMX] Check INTR_TYPE is NMI before doing physical NMI processing.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c        |   21 +++++++++++++--------
 xen/include/asm-x86/hvm/vmx/vmx.h |    1 +
 2 files changed, 14 insertions(+), 8 deletions(-)

diff -r 4e3ddf1288fb -r 1d4fc7396c41 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Nov 07 18:14:16 2006 -0700
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Wed Nov 08 15:10:21 2006 +0000
@@ -2112,17 +2112,19 @@ asmlinkage void vmx_vmexit_handler(struc
          * (1) We can get an exception (e.g. #PG) in the guest, or
          * (2) NMI
          */
-        unsigned int vector;
-
-        if ( __vmread(VM_EXIT_INTR_INFO, &vector) ||
-             !(vector & INTR_INFO_VALID_MASK) )
-            domain_crash_synchronous();
-        vector &= INTR_INFO_VECTOR_MASK;
+        unsigned int intr_info, vector;
+
+        if ( __vmread(VM_EXIT_INTR_INFO, &intr_info) ||
+             !(intr_info & INTR_INFO_VALID_MASK) )
+            __hvm_bug(regs);
+
+        vector = intr_info & INTR_INFO_VECTOR_MASK;
 
         TRACE_VMEXIT(1, vector);
         perfc_incra(cause_vector, vector);
 
-        switch ( vector ) {
+        switch ( vector )
+        {
 #ifdef XEN_DEBUGGER
         case TRAP_debug:
         {
@@ -2198,7 +2200,10 @@ asmlinkage void vmx_vmexit_handler(struc
             break;
         }
         case TRAP_nmi:
-            do_nmi(regs);
+            if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI )
+                do_nmi(regs); /* Real NMI, vector 2: normal processing. */
+            else
+                vmx_reflect_exception(v);
             break;
         default:
             vmx_reflect_exception(v);
diff -r 4e3ddf1288fb -r 1d4fc7396c41 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Tue Nov 07 18:14:16 2006 -0700
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Wed Nov 08 15:10:21 2006 +0000
@@ -93,6 +93,7 @@ extern unsigned int cpu_rev;
 #define INTR_INFO_VALID_MASK            0x80000000      /* 31 */
 
 #define INTR_TYPE_EXT_INTR              (0 << 8)    /* external interrupt */
+#define INTR_TYPE_NMI                   (2 << 8)    /* NMI                */
 #define INTR_TYPE_HW_EXCEPTION          (3 << 8)    /* hardware exception */
 #define INTR_TYPE_SW_EXCEPTION          (6 << 8)    /* software exception */
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [VMX] Check INTR_TYPE is NMI before doing physical NMI processing., Xen patchbot-unstable <=