]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: Fix removal of nx capability from guest cpuid
authorAvi Kivity <avi@qumranet.com>
Wed, 25 Jul 2007 06:22:12 +0000 (09:22 +0300)
committerAvi Kivity <avi@qumranet.com>
Wed, 25 Jul 2007 06:44:31 +0000 (09:44 +0300)
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 <avi@qumranet.com>
drivers/kvm/kvm_main.c

index 6e11871f531923e72e60e521fad9c5bfd8585790..8d2a158cc8159b5fccccbeac33d3d1ed6abbe59d 100644 (file)
@@ -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");
        }
 }