# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192812260 -3600
# Node ID 959b4b92b6bfc127eea48ad9b94564a522803fbe
# Parent 08295dc13166f238098ab2bcee45204bfc9ee66a
x86: Fix EFLAGS adjustment for emulated instructions.
Issue flagged by David Lively <dlively@xxxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/x86_emulate.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff -r 08295dc13166 -r 959b4b92b6bf xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Fri Oct 19 14:49:08 2007 +0100
+++ b/xen/arch/x86/x86_emulate.c Fri Oct 19 17:44:20 2007 +0100
@@ -299,21 +299,21 @@ struct operand {
#define EFLAGS_MASK (EFLG_OF|EFLG_SF|EFLG_ZF|EFLG_AF|EFLG_PF|EFLG_CF)
/* Before executing instruction: restore necessary bits in EFLAGS. */
-#define _PRE_EFLAGS(_sav, _msk, _tmp) \
-/* EFLAGS = (_sav & _msk) | (EFLAGS & ~_msk); */\
-"push %"_sav"; " \
-"movl %"_msk",%"_LO32 _tmp"; " \
-"andl %"_LO32 _tmp",("_STK"); " \
-"pushf; " \
-"notl %"_LO32 _tmp"; " \
-"andl %"_LO32 _tmp",("_STK"); " \
-"pop %"_tmp"; " \
-"orl %"_LO32 _tmp",("_STK"); " \
-"popf; " \
-/* _sav &= ~msk; */ \
-"movl %"_msk",%"_LO32 _tmp"; " \
-"notl %"_LO32 _tmp"; " \
-"andl %"_LO32 _tmp",%"_sav"; "
+#define _PRE_EFLAGS(_sav, _msk, _tmp) \
+/* EFLAGS = (_sav & _msk) | (EFLAGS & ~_msk); _sav &= ~_msk; */ \
+"movl %"_sav",%"_LO32 _tmp"; " \
+"push %"_tmp"; " \
+"push %"_tmp"; " \
+"movl %"_msk",%"_LO32 _tmp"; " \
+"andl %"_LO32 _tmp",("_STK"); " \
+"pushf; " \
+"notl %"_LO32 _tmp"; " \
+"andl %"_LO32 _tmp",("_STK"); " \
+"andl %"_LO32 _tmp","STR(BITS_PER_LONG/4)"("_STK"); " \
+"pop %"_tmp"; " \
+"orl %"_LO32 _tmp",("_STK"); " \
+"popf; " \
+"pop %"_sav"; "
/* After executing instruction: write-back necessary bits in EFLAGS. */
#define _POST_EFLAGS(_sav, _msk, _tmp) \
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|