diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2011-04-12 11:24:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:08 -0400 |
commit | 575e7c1417d41dd72ddf2a49965f833ce9352e92 (patch) | |
tree | 0f7d85332966e89520dd00fcee03e66b47fdb15e /arch | |
parent | be6d05cfdf1f2ddbdc367a6433d8eac49d6bfe6f (diff) |
KVM: x86 emulator: Disable writeback for CMP emulation
This stops "CMP r/m, reg" to write back the data into memory.
Pointed out by Avi.
The writeback suppression now covers CMP, CMPS, SCAS.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2ec69bc85846..1e0e3f8156f8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -3671,6 +3671,7 @@ special_insn: | |||
3671 | break; | 3671 | break; |
3672 | case 0x38 ... 0x3d: | 3672 | case 0x38 ... 0x3d: |
3673 | cmp: /* cmp */ | 3673 | cmp: /* cmp */ |
3674 | c->dst.type = OP_NONE; /* Disable writeback. */ | ||
3674 | emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags); | 3675 | emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags); |
3675 | break; | 3676 | break; |
3676 | case 0x40 ... 0x47: /* inc r16/r32 */ | 3677 | case 0x40 ... 0x47: /* inc r16/r32 */ |
@@ -3797,7 +3798,6 @@ special_insn: | |||
3797 | rc = emulate_popf(ctxt, ops, &c->dst.val, c->op_bytes); | 3798 | rc = emulate_popf(ctxt, ops, &c->dst.val, c->op_bytes); |
3798 | break; | 3799 | break; |
3799 | case 0xa6 ... 0xa7: /* cmps */ | 3800 | case 0xa6 ... 0xa7: /* cmps */ |
3800 | c->dst.type = OP_NONE; /* Disable writeback. */ | ||
3801 | goto cmp; | 3801 | goto cmp; |
3802 | case 0xa8 ... 0xa9: /* test ax, imm */ | 3802 | case 0xa8 ... 0xa9: /* test ax, imm */ |
3803 | goto test; | 3803 | goto test; |