Skip to content

Commit 9be3be1

Browse files
committed
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: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
1 parent 41bc318 commit 9be3be1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/x86/kvm/emulate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3603,7 +3603,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
36033603
break;
36043604
case Src2CL:
36053605
ctxt->src2.bytes = 1;
3606-
ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0x8;
3606+
ctxt->src2.val = ctxt->regs[VCPU_REGS_RCX] & 0xff;
36073607
break;
36083608
case Src2ImmByte:
36093609
rc = decode_imm(ctxt, &ctxt->src2, 1, true);

0 commit comments

Comments
 (0)