[PATCH 0/3] Correct monitor-mwait emulation as nop

Nadav Amit
2014-06-18T14:19:56Z

KVM handles monitor-mwait as nop, but does not check any of the preconditions
for the instructions. These instructions may generate all kind of exceptions
(#UD, #PF, #GP, #SS). They can also be executed in real-mode. This patch-set
moves the handling of monitor-mwait to the emulator, to allow their execution
in either real-mode or protected-mode. It tries to follow the SDM in checking
the preconditions and generating the necassary exceptions.

Thanks for reviewing the patch. Please try it with OS X to make sure it works
properly without generating unnecassary exception.

Nadav Amit (3):
KVM: x86: Emulator flag for instruction with no big real mode
KVM: x86: Emulator support for #UD on CPL>0
KVM: x86: correct mwait and monitor emulation

arch/x86/kvm/emulate.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++----
arch/x86/kvm/svm.c | 22 ++------------------
arch/x86/kvm/vmx.c | 27 ++++++++++---------------
3 files changed, 64 insertions(+), 40 deletions(-)

--
1.9.1