X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=arch%2Fx86%2Finclude%2Fasm%2Fpgtable.h;h=5ad38ad07890fc4ca8698aae41c6e60e48a451f4;hb=a9c8e4beeeb64c22b84c803747487857fe424b68;hp=bbc8b12fa443d47ee9a8faa59b36767e7aec866c;hpb=09fd19da0074b86030a00303522b2ba63a4399b7;p=~andy%2Flinux diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index bbc8b12fa44..5ad38ad0789 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -445,10 +445,20 @@ static inline int pte_same(pte_t a, pte_t b) return a.pte == b.pte; } +static inline int pteval_present(pteval_t pteval) +{ + /* + * Yes Linus, _PAGE_PROTNONE == _PAGE_NUMA. Expressing it this + * way clearly states that the intent is that protnone and numa + * hinting ptes are considered present for the purposes of + * pagetable operations like zapping, protection changes, gup etc. + */ + return pteval & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_NUMA); +} + static inline int pte_present(pte_t a) { - return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE | - _PAGE_NUMA); + return pteval_present(pte_flags(a)); } #define pte_accessible pte_accessible