summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-05-12 00:28:44 +0300
committerAvi Kivity <avi@redhat.com>2010-05-19 11:41:08 +0300
commitf78e917688edbf1f14c318d2e50dc8e7dad20445 (patch)
tree8894410296279382ec6d9860534442c4cd1a5087 /arch/x86
parent09c9e81366b9167b88ff05cf29fa94dc3553eb3d (diff)
downloadop-kernel-dev-f78e917688edbf1f14c318d2e50dc8e7dad20445.zip
op-kernel-dev-f78e917688edbf1f14c318d2e50dc8e7dad20445.tar.gz
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 474a27f..fa1c519 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -470,7 +470,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);
void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
{
- kvm_set_cr0(vcpu, kvm_read_cr0_bits(vcpu, ~0x0ful) | (msw & 0x0f));
+ kvm_set_cr0(vcpu, kvm_read_cr0_bits(vcpu, ~0x0eul) | (msw & 0x0f));
}
EXPORT_SYMBOL_GPL(kvm_lmsw);
OpenPOWER on IntegriCloud