]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: MMU: Fix nx access bit for huge pages
authorAvi Kivity <avi@qumranet.com>
Thu, 11 Oct 2007 13:08:41 +0000 (15:08 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:52:51 +0000 (17:52 +0200)
We must set the bit before the shift, otherwise the wrong bit gets set.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/paging_tmpl.h

index da36e48fd026b67bc5ad6ee2dc3f2e01b311bb85..e07cb2e006c2b8cfd339e118bfff0ae194160d25 100644 (file)
@@ -382,9 +382,9 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
                        metaphysical = 1;
                        hugepage_access = walker->pte;
                        hugepage_access &= PT_USER_MASK | PT_WRITABLE_MASK;
+                       hugepage_access >>= PT_WRITABLE_SHIFT;
                        if (walker->pte & PT64_NX_MASK)
                                hugepage_access |= (1 << 2);
-                       hugepage_access >>= PT_WRITABLE_SHIFT;
                        table_gfn = (walker->pte & PT_BASE_ADDR_MASK)
                                >> PAGE_SHIFT;
                } else {