mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
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 f78e917688)
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1345126c76
commit
90a08dc75c
@@ -345,7 +345,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);
|
||||
|
||||
void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
|
||||
{
|
||||
kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0ful) | (msw & 0x0f));
|
||||
kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0eul) | (msw & 0x0f));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_lmsw);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user