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>
This commit is contained in:
parent
09c9e81366
commit
f78e917688
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue