aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2014-06-15 09:13:01 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-19 06:52:10 -0400
commita825f5cc4a8455663562809748240169cb9bc2c0 (patch)
tree17ea2adbf49880c35c630268b7eaa01dfe35bfed /arch
parent140bad89fd25db1aab60f80ed7874e9a9bdbae3b (diff)
KVM: x86: NOP emulation clears (incorrectly) the high 32-bits of RAX
On long-mode the current NOP (0x90) emulation still writes back to RAX. As a result, EAX is zero-extended and the high 32-bits of RAX are cleared. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 6f09b2e555ef..84dc4ba0364d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4688,8 +4688,9 @@ special_insn:
4688 break; 4688 break;
4689 case 0x90 ... 0x97: /* nop / xchg reg, rax */ 4689 case 0x90 ... 0x97: /* nop / xchg reg, rax */
4690 if (ctxt->dst.addr.reg == reg_rmw(ctxt, VCPU_REGS_RAX)) 4690 if (ctxt->dst.addr.reg == reg_rmw(ctxt, VCPU_REGS_RAX))
4691 break; 4691 ctxt->dst.type = OP_NONE;
4692 rc = em_xchg(ctxt); 4692 else
4693 rc = em_xchg(ctxt);
4693 break; 4694 break;
4694 case 0x98: /* cbw/cwde/cdqe */ 4695 case 0x98: /* cbw/cwde/cdqe */
4695 switch (ctxt->op_bytes) { 4696 switch (ctxt->op_bytes) {