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

[Xen-changelog] [xen-unstable] svm: Check exitcode for NRIP validity only in debug builds.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224241970 -3600
# Node ID 3411819435b9d8f5ea51863edd0da81a4891cf66
# Parent  609d0d34450f373b930188477e9087a62481f9a4
svm: Check exitcode for NRIP validity only in debug builds.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/emulate.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff -r 609d0d34450f -r 3411819435b9 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c    Fri Oct 17 12:04:11 2008 +0100
+++ b/xen/arch/x86/hvm/svm/emulate.c    Fri Oct 17 12:12:50 2008 +0100
@@ -68,24 +68,25 @@ static unsigned long svm_nextrip_insn_le
     if ( !cpu_has_svm_nrips || (vmcb->nextrip <= vmcb->rip) )
         return 0;
 
+#ifndef NDEBUG
     switch ( vmcb->exitcode )
     {
     case VMEXIT_CR0_READ... VMEXIT_DR15_WRITE:
         /* faults due to instruction intercepts */
         /* (exitcodes 84-95) are reserved */
     case VMEXIT_IDTR_READ ... VMEXIT_TR_WRITE:
-    case VMEXIT_RDTSC ... VMEXIT_SWINT:
-    case VMEXIT_INVD ... VMEXIT_INVLPGA:
+    case VMEXIT_RDTSC ... VMEXIT_MSR:
     case VMEXIT_VMRUN ...  VMEXIT_MWAIT_CONDITIONAL:
-    case VMEXIT_IOIO:
         /* ...and the rest of the #VMEXITs */
     case VMEXIT_CR0_SEL_WRITE:
-    case VMEXIT_MSR:
     case VMEXIT_EXCEPTION_BP:
-        return vmcb->nextrip - vmcb->rip;
-    }
-  
-    return 0;
+        break;
+    default:
+        BUG();
+    }
+#endif
+
+    return vmcb->nextrip - vmcb->rip;
 }
 
 /* First byte: Length. Following bytes: Opcode bytes. */

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


 


Rackspace

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