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

[Xen-changelog] [xen-unstable] Intel VPID: Do not crash if INVVPID is attempted before VMXON.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1209127102 -3600
# Node ID 6032730df2eb844a81b55421f5dbada4dc3e295d
# Parent  7689e311f3b5ee4a4d547405c73e40ab689875f0
Intel VPID: Do not crash if INVVPID is attempted before VMXON.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/vmx/vmx.h |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 7689e311f3b5 -r 6032730df2eb xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Fri Apr 25 13:27:19 2008 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Fri Apr 25 13:38:22 2008 +0100
@@ -263,7 +263,7 @@ static inline void __invept(int ext, u64
 
     asm volatile ( INVEPT_OPCODE
                    MODRM_EAX_08
-                   /* CF==1 or ZF==1 --> rc = -1 */
+                   /* CF==1 or ZF==1 --> crash (ud2) */
                    "ja 1f ; ud2 ; 1:\n"
                    :
                    : "a" (&operand), "c" (ext)
@@ -278,10 +278,14 @@ static inline void __invvpid(int ext, u1
         u64 gva;
     } __attribute__ ((packed)) operand = {vpid, 0, gva};
 
-    asm volatile ( INVVPID_OPCODE
-                   MODRM_EAX_08
-                   /* CF==1 or ZF==1 --> rc = -1 */
-                   "ja 1f ; ud2 ; 1:\n"
+    /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
+    asm volatile ( "1: " INVVPID_OPCODE MODRM_EAX_08
+                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   "ja 2f ; ud2 ; 2:\n"
+                   ".section __ex_table,\"a\"\n"
+                   "    "__FIXUP_ALIGN"\n"
+                   "    "__FIXUP_WORD" 1b,2b\n"
+                   ".previous"
                    :
                    : "a" (&operand), "c" (ext)
                    : "memory" );

_______________________________________________
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®.