x86emul: make _PRE_EFLAGS() tolerate first argument being 32-bit
authorJan Beulich <jbeulich@suse.com>
Wed, 4 Jan 2017 13:28:02 +0000 (14:28 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Jan 2017 13:28:02 +0000 (14:28 +0100)
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 <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index 29e1f46550f9fbc72eab0b4d9054d3ef3e5a27aa..e200e61c530a130106d9f128e76c5a0d2b433736 100644 (file)
@@ -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)          \