Skip to contentSkip to conversation

powerpc/mm: Check for _PAGE_PTE in *_devmap()

PATCH Superseded Oliver O'Halloran 1 participant 1 message Jul 27, 2017 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mm: Check for _PAGE_PTE in *_devmap()

The ISA radix translation tree contains two different types of entry, directories and leaves. The formats of the two entries are different with the directory entries containing no spare bits for use by software. As a result we need to ensure that the *_devmap() family of functions check fail for everything except leaf (PTE) entries.

---
 arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/book3s/64/pgtable.h +1 -1
index c0737c8..e1989dd 100644
@@ -610,7 +610,7 @@ static inline pte_t pte_mkdevmap(pte_t pte)
 
 static inline int pte_devmap(pte_t pte)
 {
-	return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP));
+	return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE));
 }
 
 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
Signature · 1 line
2.9.3