From: Jan Beulich Date: Wed, 4 Jan 2017 13:28:02 +0000 (+0100) Subject: x86emul: make _PRE_EFLAGS() tolerate first argument being 32-bit X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3063 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e510059a8bfc564407ed044639e607c8f5ab0d6f;p=xen.git x86emul: make _PRE_EFLAGS() tolerate first argument being 32-bit While this may appear to introduce a truncation issue, the high 32 bits get zapped already anyway (early in _PRE_EFLAGS() as well as in _POST_EFLAGS()). Once a subsequent patch switches to use proper 32-bit EFLAGS operands, we'll in fact end up with more correct code, as that zeroing of the upper halves will then go away. 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 29e1f46550..e200e61c53 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -530,7 +530,8 @@ typedef union { "pop %"_tmp"; " \ "orl %"_LO32 _tmp",("_STK"); " \ "popf; " \ -"pop %"_sav"; " +"pop %"_tmp"; " \ +"movl %"_LO32 _tmp",%"_LO32 _sav"; " /* After executing instruction: write-back necessary bits in EFLAGS. */ #define _POST_EFLAGS(_sav, _msk, _tmp) \