From: Andrew Cooper Date: Fri, 6 Jan 2017 20:03:08 +0000 (+0000) Subject: x86/emul: Replace opencoded extraction of IOPL from eflags X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3025 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e83ff50a55fd2349886860cf0f23f597605943d7;p=xen.git x86/emul: Replace opencoded extraction of IOPL from eflags Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 98ba7c53b8..c4ba79b0cd 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1157,7 +1157,7 @@ _mode_iopl( int cpl = get_cpl(ctxt, ops); if ( cpl == -1 ) return -1; - return (cpl <= ((ctxt->regs->_eflags >> 12) & 3)); + return cpl <= MASK_EXTR(ctxt->regs->_eflags, EFLG_IOPL); } #define mode_ring0() ({ \