aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-07-25 14:00:27 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-07-25 14:00:27 +0100
commit26c26ff17aabf675863b9882eee186fafbb5ff4e (patch)
treec6cd384fd97ddf43a0dbe06e30ff901dddc5a1a8
parentf6e4baff8280c1960636aa48787d7956fb7dcce8 (diff)
downloadxen-26c26ff17aabf675863b9882eee186fafbb5ff4e.tar.gz
xen-26c26ff17aabf675863b9882eee186fafbb5ff4e.tar.bz2
xen-26c26ff17aabf675863b9882eee186fafbb5ff4e.zip
x86_emulate: fix unintended writeback on cmp/test instructions
This patch fixes an issue when x86_emulate is called with force_writeback=1 set. It resulted in cmp and test instructions with memory operands to have the mem value written back after instruction emulation finished. This caused false alarms on writes to RO mem, and might have caused other issues if unintended writes occured to device registers in mmio space. Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
-rw-r--r--xen/arch/x86/x86_emulate/x86_emulate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 600705ff84..6fc1955783 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1606,6 +1606,7 @@ x86_emulate(
dst.val = _regs.eax;
case 0x38 ... 0x3b: cmp: /* cmp */
emulate_2op_SrcV("cmp", src, dst, _regs.eflags);
+ dst.type = OP_NONE;
break;
case 0x62: /* bound */ {
@@ -1707,6 +1708,7 @@ x86_emulate(
dst.val = _regs.eax;
case 0x84 ... 0x85: test: /* test */
emulate_2op_SrcV("test", src, dst, _regs.eflags);
+ dst.type = OP_NONE;
break;
case 0x86 ... 0x87: xchg: /* xchg */