KVM: VMX: Pass cr0.mp through to the guest when the fpu is active
authorAvi Kivity <avi@redhat.com>
Sun, 24 Jan 2010 14:26:40 +0000 (16:26 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:06 +0000 (12:36 -0300)
commit81231c698a71af6e1815df72c06685d295e1cc1d
tree73c7a47cf05b329a6bcf2650d3c5890a51d69c95
parentda15bf436bc9586603b47b39244157431fa38b56
KVM: VMX: Pass cr0.mp through to the guest when the fpu is active

When cr0.mp is clear, the guest doesn't expect a #NM in response to
a WAIT instruction.  Because we always keep cr0.mp set, it will get
a #NM, and potentially be confused.

Fix by keeping cr0.mp set only when the fpu is inactive, and passing
it through when inactive.

Reported-by: Lorenzo Martignoni <martignlo@gmail.com>
Analyzed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c