diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2015-03-30 08:39:19 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-03-30 10:45:50 -0400 |
commit | b91aa14d95bf4cf8ed0426bd25c0af1548519696 (patch) | |
tree | 21b754e834deccb4e4982e7c3bfec1cf3cac6842 /arch/x86/kvm/emulate.c | |
parent | 2dccb4cdbf8fd4cb1d779a6f7ddd66d193bb5805 (diff) |
KVM: x86: CMOV emulation on legacy mode is wrong
On legacy mode CMOV emulation should still clear bits [63:32] even if the
assignment is not done. The previous fix 140bad89fd ("KVM: x86: emulation of
dword cmov on long-mode should clear [63:32]") was incomplete.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Message-Id: <1427719163-5429-2-git-send-email-namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c941abe800ef..62f7a395717d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -5126,8 +5126,7 @@ twobyte_insn: | |||
5126 | case 0x40 ... 0x4f: /* cmov */ | 5126 | case 0x40 ... 0x4f: /* cmov */ |
5127 | if (test_cc(ctxt->b, ctxt->eflags)) | 5127 | if (test_cc(ctxt->b, ctxt->eflags)) |
5128 | ctxt->dst.val = ctxt->src.val; | 5128 | ctxt->dst.val = ctxt->src.val; |
5129 | else if (ctxt->mode != X86EMUL_MODE_PROT64 || | 5129 | else if (ctxt->op_bytes != 4) |
5130 | ctxt->op_bytes != 4) | ||
5131 | ctxt->dst.type = OP_NONE; /* no writeback */ | 5130 | ctxt->dst.type = OP_NONE; /* no writeback */ |
5132 | break; | 5131 | break; |
5133 | case 0x80 ... 0x8f: /* jnz rel, etc*/ | 5132 | case 0x80 ... 0x8f: /* jnz rel, etc*/ |