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

From: Nadav Amit
Date: Wed Jun 18 2014 - 10:23:39 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/