Commit 9be3be1f authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: fix Src2CL decode

Src2CL decode (used for double width shifts) erronously decodes only bit 3
of %rcx, instead of bits 7:0.

Fix by decoding %cl in its entirety.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 41bc3186
...@@ -3603,7 +3603,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) ...@@ -3603,7 +3603,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
break; break;
case Src2CL: case Src2CL:
ctxt->src2.bytes = 1; ctxt->src2.bytes = 1;
ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0x8; ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0xff;
break; break;
case Src2ImmByte: case Src2ImmByte:
rc = decode_imm(ctxt, &ctxt->src2, 1, true); rc = decode_imm(ctxt, &ctxt->src2, 1, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment