x86,mm: fix pte_special versus pte_numa
[deliverable/linux.git] / arch / x86 / include / asm / pgtable.h
index 0ec0560126180a152372ac3fc908752ea6e9ce87..aa97a070f09fbb6d31876b005a1dc86444897c10 100644 (file)
@@ -131,8 +131,13 @@ static inline int pte_exec(pte_t pte)
 
 static inline int pte_special(pte_t pte)
 {
-       return (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_SPECIAL)) ==
-                                (_PAGE_PRESENT|_PAGE_SPECIAL);
+       /*
+        * See CONFIG_NUMA_BALANCING pte_numa in include/asm-generic/pgtable.h.
+        * On x86 we have _PAGE_BIT_NUMA == _PAGE_BIT_GLOBAL+1 ==
+        * __PAGE_BIT_SOFTW1 == _PAGE_BIT_SPECIAL.
+        */
+       return (pte_flags(pte) & _PAGE_SPECIAL) &&
+               (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_PROTNONE));
 }
 
 static inline unsigned long pte_pfn(pte_t pte)
This page took 0.023681 seconds and 5 git commands to generate.