]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86emul: VME and PVI modes require a #GP(0) check first thing
authorJan Beulich <jbeulich@suse.com>
Mon, 5 Nov 2018 10:13:59 +0000 (11:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 5 Nov 2018 10:13:59 +0000 (11:13 +0100)
As explicitly spelled out by the SDM, EFLAGS.VIF and EFLAGS.VIP both set
at the start of an instruction trigger #GP(0) independent of actual
instruction.

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 e717e6ac14a3c15722dad46559b6532677c35ac6..e69dfdd983ee176680b36c7f345d4cb36ccf2845 100644 (file)
@@ -3247,6 +3247,11 @@ x86_emulate(
 
     ASSERT(ops->read);
 
+    generate_exception_if((mode_vif() &&
+                           (_regs.eflags & X86_EFLAGS_VIF) &&
+                           (_regs.eflags & X86_EFLAGS_VIP)),
+                          EXC_GP, 0);
+
     rc = x86_decode(&state, ctxt, ops);
     if ( rc != X86EMUL_OKAY )
         return rc;