Commit 4c981b43 authored by Avi Kivity's avatar Avi Kivity

KVM: Fix removal of nx capability from guest cpuid

Testing the wrong bit caused kvm not to disable nx on the guest when it is
disabled on the host (an mmu optimization relies on the nx bits being the
same in the guest and host).

This allows Windows to boot when nx is disabled on te host (e.g. when
host pae is disabled).
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 7cfa4b0a
...@@ -2432,9 +2432,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) ...@@ -2432,9 +2432,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu)
break; break;
} }
} }
if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) {
entry->edx &= ~(1 << 20); entry->edx &= ~(1 << 20);
printk(KERN_INFO ": guest NX capability removed\n"); printk(KERN_INFO "kvm: guest NX capability removed\n");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment