kvm: x86: emulate monitor and mwait instructions as nop
authorGabriel L. Somlo <gsomlo@gmail.com>
Wed, 7 May 2014 20:52:13 +0000 (16:52 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 May 2014 13:40:49 +0000 (15:40 +0200)
commit87c00572ba05aa8c9db118da75c608f47eb10b9e
tree484e8cc1da97c7302c739364ee0af9bd68cebb0e
parentb63cf42fd1d8c18fab71222321aaf356f63089c9
kvm: x86: emulate monitor and mwait instructions as nop

Treat monitor and mwait instructions as nop, which is architecturally
correct (but inefficient) behavior. We do this to prevent misbehaving
guests (e.g. OS X <= 10.7) from crashing after they fail to check for
monitor/mwait availability via cpuid.

Since mwait-based idle loops relying on these nop-emulated instructions
would keep the host CPU pegged at 100%, do NOT advertise their presence
via cpuid, to prevent compliant guests from using them inadvertently.

Signed-off-by: Gabriel L. Somlo <somlo@cmu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c