From: Jan Beulich Date: Mon, 5 Nov 2018 10:13:59 +0000 (+0100) Subject: x86emul: VME and PVI modes require a #GP(0) check first thing X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3063 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=efe9cba66c036c452cc2ed7220984aa11be8dcb5;p=xen.git x86emul: VME and PVI modes require a #GP(0) check first thing 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 Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index e717e6ac14..e69dfdd983 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -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;