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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:11:17 +0000 (11:11 -0700)
commit90a08dc75c91c0e50cabc11e79a761e1d63a0303
tree49314fc24efbd5ba17dbc452f335ab0a8378246c
parent1345126c761f0360dc108973bf73281d51945bc1
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
(cherry picked from commit f78e917688edbf1f14c318d2e50dc8e7dad20445)
arch/x86/kvm/x86.c