# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1192869367 -3600
# Node ID cbf1b365273625ffa883027a652b90ce83e971ba
# Parent 16de1090aa7e8d3087ed427811d78dba07665509
x86: Fix EFLAGS adjustment for emulated instructions.
Issue flagged by David Lively <dlively@xxxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset: 16143:959b4b92b6bf
xen-unstable date: Fri Oct 19 17:44:20 2007 +0100
---
xen/arch/x86/x86_emulate.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff -r 16de1090aa7e -r cbf1b3652736 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Fri Oct 19 09:45:09 2007 +0100
+++ b/xen/arch/x86/x86_emulate.c Sat Oct 20 09:36:07 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
|