]> xenbits.xensource.com Git - xen.git/commitdiff
x86emul: check for SYSENTER/SYSEXIT availability
authorJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2016 09:09:40 +0000 (10:09 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 14 Dec 2016 09:09:40 +0000 (10:09 +0100)
We can't exclude someone wanting to hide the instructions from guests.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index e78593d5692d6b2e6c3530c81f466485e44dab57..49ae96a0a3fea6db925dbe23b873c73ff3850be5 100644 (file)
@@ -1288,6 +1288,7 @@ static bool vcpu_has(
 }
 
 #define vcpu_has_fpu()         vcpu_has(         1, EDX,  0, ctxt, ops)
+#define vcpu_has_sep()         vcpu_has(         1, EDX, 11, ctxt, ops)
 #define vcpu_has_cmov()        vcpu_has(         1, EDX, 15, ctxt, ops)
 #define vcpu_has_clflush()     vcpu_has(         1, EDX, 19, ctxt, ops)
 #define vcpu_has_mmx()         vcpu_has(         1, EDX, 23, ctxt, ops)
@@ -4900,6 +4901,7 @@ x86_emulate(
         uint64_t msr_content;
         int lm;
 
+        vcpu_must_have(sep);
         generate_exception_if(mode_ring0(), EXC_GP, 0);
         generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0);
 
@@ -4946,6 +4948,7 @@ x86_emulate(
         uint64_t msr_content;
         bool user64 = rex_prefix & REX_W;
 
+        vcpu_must_have(sep);
         generate_exception_if(!mode_ring0(), EXC_GP, 0);
         generate_exception_if(!in_protmode(ctxt, ops), EXC_GP, 0);