ia64/xen-unstable

changeset 17528:6032730df2eb

Intel VPID: Do not crash if INVVPID is attempted before VMXON.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Apr 25 13:38:22 2008 +0100 (2008-04-25)
parents 7689e311f3b5
children ffa511df6c23
files xen/include/asm-x86/hvm/vmx/vmx.h
line diff
     1.1 --- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Apr 25 13:27:19 2008 +0100
     1.2 +++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Apr 25 13:38:22 2008 +0100
     1.3 @@ -263,7 +263,7 @@ static inline void __invept(int ext, u64
     1.4  
     1.5      asm volatile ( INVEPT_OPCODE
     1.6                     MODRM_EAX_08
     1.7 -                   /* CF==1 or ZF==1 --> rc = -1 */
     1.8 +                   /* CF==1 or ZF==1 --> crash (ud2) */
     1.9                     "ja 1f ; ud2 ; 1:\n"
    1.10                     :
    1.11                     : "a" (&operand), "c" (ext)
    1.12 @@ -278,10 +278,14 @@ static inline void __invvpid(int ext, u1
    1.13          u64 gva;
    1.14      } __attribute__ ((packed)) operand = {vpid, 0, gva};
    1.15  
    1.16 -    asm volatile ( INVVPID_OPCODE
    1.17 -                   MODRM_EAX_08
    1.18 -                   /* CF==1 or ZF==1 --> rc = -1 */
    1.19 -                   "ja 1f ; ud2 ; 1:\n"
    1.20 +    /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
    1.21 +    asm volatile ( "1: " INVVPID_OPCODE MODRM_EAX_08
    1.22 +                   /* CF==1 or ZF==1 --> crash (ud2) */
    1.23 +                   "ja 2f ; ud2 ; 2:\n"
    1.24 +                   ".section __ex_table,\"a\"\n"
    1.25 +                   "    "__FIXUP_ALIGN"\n"
    1.26 +                   "    "__FIXUP_WORD" 1b,2b\n"
    1.27 +                   ".previous"
    1.28                     :
    1.29                     : "a" (&operand), "c" (ext)
    1.30                     : "memory" );