From: Avi Kivity Date: Wed, 25 Jul 2007 06:22:12 +0000 (+0300) Subject: KVM: Fix removal of nx capability from guest cpuid X-Git-Tag: kvm-34~38 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=33c5dfed96a8cb19ccc2e08073ef97e5c731dae3;p=users%2Fdwmw2%2Flinux.git 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: Avi Kivity --- diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 6e11871f53192..8d2a158cc8159 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -2477,9 +2477,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) break; } } - if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { + if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) { entry->edx &= ~(1 << 20); - printk(KERN_INFO ": guest NX capability removed\n"); + printk(KERN_INFO "kvm: guest NX capability removed\n"); } }