From: Jan Beulich Date: Mon, 30 Sep 2019 13:45:16 +0000 (+0200) Subject: x86emul: move ARPL #UD check X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7cc2fe0ddcc2dacbe0cbc86be1ee6b1cfac93cc6;p=people%2Flarsk%2Fxen.git x86emul: move ARPL #UD check The #UD for being outside of protected mode gets raised for ARPL only after having read the memory operand - correct this by moving up the respective construct. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Release-acked-by: Juergen Gross --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index f80beec502..22c29b8280 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4061,6 +4061,8 @@ x86_emulate( /* arpl */ unsigned int src_rpl = dst.val & 3; + generate_exception_if(!in_protmode(ctxt, ops), EXC_UD); + dst = ea; dst.bytes = 2; if ( dst.type == OP_REG ) @@ -4078,7 +4080,6 @@ x86_emulate( _regs.eflags &= ~X86_EFLAGS_ZF; dst.type = OP_NONE; } - generate_exception_if(!in_protmode(ctxt, ops), EXC_UD); } break;