Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a825f5cc authored by Nadav Amit's avatar Nadav Amit Committed by Paolo Bonzini
Browse files

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: default avatarNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 140bad89
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4688,7 +4688,8 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
		break;
	case 0x90 ... 0x97: /* nop / xchg reg, rax */
		if (ctxt->dst.addr.reg == reg_rmw(ctxt, VCPU_REGS_RAX))
			break;
			ctxt->dst.type = OP_NONE;
		else
			rc = em_xchg(ctxt);
		break;
	case 0x98: /* cbw/cwde/cdqe */