aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2014-06-02 11:34:08 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-18 11:46:18 -0400
commit3b32004a66e96e17d2a031c08d3304245c506dfc (patch)
tree7d49f500c0793ad3ae29917c27794d4e306943b7 /arch/x86/kvm/emulate.c
parent37c564f2854bf75969d0ac26e03f5cf2bb7d639f (diff)
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 <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 4cb0da660283..be3f7645e39d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4836,8 +4836,8 @@ twobyte_insn:
4836 break; 4836 break;
4837 case 0xc3: /* movnti */ 4837 case 0xc3: /* movnti */
4838 ctxt->dst.bytes = ctxt->op_bytes; 4838 ctxt->dst.bytes = ctxt->op_bytes;
4839 ctxt->dst.val = (ctxt->op_bytes == 4) ? (u32) ctxt->src.val : 4839 ctxt->dst.val = (ctxt->op_bytes == 8) ? (u64) ctxt->src.val :
4840 (u64) ctxt->src.val; 4840 (u32) ctxt->src.val;
4841 break; 4841 break;
4842 default: 4842 default:
4843 goto cannot_emulate; 4843 goto cannot_emulate;