浏览代码

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>
Nadav Amit 10 年之前
父节点
当前提交
b91aa14d95
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      arch/x86/kvm/emulate.c

+ 1 - 2
arch/x86/kvm/emulate.c

@@ -5126,8 +5126,7 @@ twobyte_insn:
 	case 0x40 ... 0x4f:	/* cmov */
 	case 0x40 ... 0x4f:	/* cmov */
 		if (test_cc(ctxt->b, ctxt->eflags))
 		if (test_cc(ctxt->b, ctxt->eflags))
 			ctxt->dst.val = ctxt->src.val;
 			ctxt->dst.val = ctxt->src.val;
-		else if (ctxt->mode != X86EMUL_MODE_PROT64 ||
-			 ctxt->op_bytes != 4)
+		else if (ctxt->op_bytes != 4)
 			ctxt->dst.type = OP_NONE; /* no writeback */
 			ctxt->dst.type = OP_NONE; /* no writeback */
 		break;
 		break;
 	case 0x80 ... 0x8f: /* jnz rel, etc*/
 	case 0x80 ... 0x8f: /* jnz rel, etc*/