Skip to content

Commit 3b32004

Browse files
anadavbonzini
authored andcommitted
KVM: x86: movnti minimum op size of 32-bit is not kept
If the operand-size prefix (0x66) is used in 64-bit mode, the emulator would assume the destination operand is 64-bit, when it should be 32-bit. Reminder: movnti does not support 16-bit operands and its default operand size is 32-bit. Signed-off-by: Nadav Amit <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 37c564f commit 3b32004

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/emulate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4836,8 +4836,8 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
48364836
break;
48374837
case 0xc3: /* movnti */
48384838
ctxt->dst.bytes = ctxt->op_bytes;
4839-
ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val :
4840-
(u64) ctxt->src.val;
4839+
ctxt->dst.val = (ctxt->op_bytes == 8) ? (u64) ctxt->src.val :
4840+
(u32) ctxt->src.val;
48414841
break;
48424842
default:
48434843
goto cannot_emulate;

0 commit comments

Comments
 (0)