ia64/xen-unstable

changeset 18168:2e4ecfc83460

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 25 14:00:27 2008 +0100 (2008-07-25)
parents 267a59f9580b
children c89f1c453ac9
files xen/arch/x86/x86_emulate/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Jul 25 13:59:07 2008 +0100
     1.2 +++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Jul 25 14:00:27 2008 +0100
     1.3 @@ -1606,6 +1606,7 @@ x86_emulate(
     1.4          dst.val = _regs.eax;
     1.5      case 0x38 ... 0x3b: cmp: /* cmp */
     1.6          emulate_2op_SrcV("cmp", src, dst, _regs.eflags);
     1.7 +        dst.type = OP_NONE;
     1.8          break;
     1.9  
    1.10      case 0x62: /* bound */ {
    1.11 @@ -1707,6 +1708,7 @@ x86_emulate(
    1.12          dst.val = _regs.eax;
    1.13      case 0x84 ... 0x85: test: /* test */
    1.14          emulate_2op_SrcV("test", src, dst, _regs.eflags);
    1.15 +        dst.type = OP_NONE;
    1.16          break;
    1.17  
    1.18      case 0x86 ... 0x87: xchg: /* xchg */