From: Avi Kivity Date: Tue, 13 Sep 2011 07:45:46 +0000 (+0300) Subject: KVM: x86 emulator: qualify OpReg inhibit_byte_regs hack X-Git-Tag: upstream/snapshot3+hdmi~8879^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5217973ef899ffecdd77743aae3b633994a08cde;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git KVM: x86 emulator: qualify OpReg inhibit_byte_regs hack OpReg decoding has a hack that inhibits byte registers for movsx and movzx instructions. It should be replaced by something better, but meanwhile, qualify that the hack is only active for the destination operand. Note these instructions only use OpReg for the destination, but better to be explicit about it. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a0d6ceb4..17a8910 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3346,6 +3346,7 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op, switch (d) { case OpReg: decode_register_operand(ctxt, op, + op == &ctxt->dst && ctxt->twobyte && (ctxt->b == 0xb6 || ctxt->b == 0xb7)); break; case OpImmUByte: