KVM: Don't allow lmsw to clear cr0.pe
authorAvi Kivity <avi@redhat.com>
Tue, 11 May 2010 21:28:44 +0000 (00:28 +0300)
committerAvi Kivity <avi@redhat.com>
Wed, 19 May 2010 08:41:08 +0000 (11:41 +0300)
commitf78e917688edbf1f14c318d2e50dc8e7dad20445
tree8894410296279382ec6d9860534442c4cd1a5087
parent09c9e81366b9167b88ff05cf29fa94dc3553eb3d
KVM: Don't allow lmsw to clear cr0.pe

The current lmsw implementation allows the guest to clear cr0.pe, contrary
to the manual, which breaks EMM386.EXE.

Fix by ORing the old cr0.pe with lmsw's operand.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/x86.c