From: Avi Kivity Date: Thu, 11 Oct 2007 13:08:41 +0000 (+0200) Subject: KVM: MMU: Fix nx access bit for huge pages X-Git-Tag: v2.6.25-rc1~1138^2~217 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c22e3514fceb2f514093ce1d19a2f660ac7347ae;p=platform%2Fkernel%2Flinux-3.10.git KVM: MMU: Fix nx access bit for huge pages We must set the bit before the shift, otherwise the wrong bit gets set. Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index da36e48..e07cb2e 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -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 {