]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: vmx: VMXOFF emulation in vm86 should cause #UD
authorNadav Amit <namit@cs.technion.ac.il>
Fri, 29 Aug 2014 08:26:55 +0000 (11:26 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Aug 2014 12:02:49 +0000 (14:02 +0200)
commit0f54a321302dfbdbd707ba989b2f468e58b9a363
treedd6ae5b4184d341db6cbdaf317c1a1f3837a5c0c
parent48d89b92609a66bc41f479c560640bc413add3b4
KVM: vmx: VMXOFF emulation in vm86 should cause #UD

Unlike VMCALL, the instructions VMXOFF, VMLAUNCH and VMRESUME should cause a UD
exception in real-mode or vm86.  However, the emulator considers all these
instructions the same for the matter of mode checks, and emulation upon exit
due to #UD exception.

As a result, the hypervisor behaves incorrectly on vm86 mode. VMXOFF, VMLAUNCH
or VMRESUME cause on vm86 exit due to #UD. The hypervisor then emulates these
instruction and inject #GP to the guest instead of #UD.

This patch creates a new group for these instructions and mark only VMCALL as
an instruction which can be emulated.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c