提交 3b32004a 编写于 作者: N Nadav Amit 提交者: Paolo Bonzini

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: NNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 37c564f2
...@@ -4836,8 +4836,8 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ...@@ -4836,8 +4836,8 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
break; break;
case 0xc3: /* movnti */ case 0xc3: /* movnti */
ctxt->dst.bytes = ctxt->op_bytes; ctxt->dst.bytes = ctxt->op_bytes;
ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val : ctxt->dst.val = (ctxt->op_bytes == 8) ? (u64) ctxt->src.val :
(u64) ctxt->src.val; (u32) ctxt->src.val;
break; break;
default: default:
goto cannot_emulate; goto cannot_emulate;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册