aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 4dade6ac082..96d4bef06e1 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1015,11 +1015,6 @@ done_prefixes:
1015 } 1015 }
1016 } 1016 }
1017 1017
1018 if (mode == X86EMUL_MODE_PROT64 && (c->d & No64)) {
1019 kvm_report_emulation_failure(ctxt->vcpu, "invalid x86/64 instruction");
1020 return -1;
1021 }
1022
1023 if (c->d & Group) { 1018 if (c->d & Group) {
1024 group = c->d & GroupMask; 1019 group = c->d & GroupMask;
1025 c->modrm = insn_fetch(u8, 1, c->eip); 1020 c->modrm = insn_fetch(u8, 1, c->eip);
@@ -1828,6 +1823,11 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
1828 memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs); 1823 memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs);
1829 saved_eip = c->eip; 1824 saved_eip = c->eip;
1830 1825
1826 if (ctxt->mode == X86EMUL_MODE_PROT64 && (c->d & No64)) {
1827 kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
1828 goto done;
1829 }
1830
1831 /* LOCK prefix is allowed only with some instructions */ 1831 /* LOCK prefix is allowed only with some instructions */
1832 if (c->lock_prefix && !(c->d & Lock)) { 1832 if (c->lock_prefix && !(c->d & Lock)) {
1833 kvm_queue_exception(ctxt->vcpu, UD_VECTOR); 1833 kvm_queue_exception(ctxt->vcpu, UD_VECTOR);