Skip to content

Commit

Permalink
KVM: Fix removal of nx capability from guest cpuid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity committed Jul 25, 2007
1 parent 7cfa4b0 commit 4c981b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2432,9 +2432,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");
}
}

Expand Down

0 comments on commit 4c981b4

Please sign in to comment.