aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-07-25 02:22:12 -0400
committerAvi Kivity <avi@qumranet.com>2007-07-25 07:31:13 -0400
commit4c981b43d7ec18818754bf85b829865abd0ce340 (patch)
tree2db7c22e03393e32ea4cdb0d55e5d13c71ed2ef2 /drivers/kvm/kvm_main.c
parent7cfa4b0a43286b1da3afa4f5f99d52e65a8f30fc (diff)
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 <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index a8d8db8e3ccb..96856097d15b 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2432,9 +2432,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu)
2432 break; 2432 break;
2433 } 2433 }
2434 } 2434 }
2435 if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { 2435 if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) {
2436 entry->edx &= ~(1 << 20); 2436 entry->edx &= ~(1 << 20);
2437 printk(KERN_INFO ": guest NX capability removed\n"); 2437 printk(KERN_INFO "kvm: guest NX capability removed\n");
2438 } 2438 }
2439} 2439}
2440 2440