[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250625063753.77511-11-ajd@linux.ibm.com>
Date: Wed, 25 Jun 2025 16:37:50 +1000
From: Andrew Donnellan <ajd@...ux.ibm.com>
To: linuxppc-dev@...ts.ozlabs.org, pasha.tatashin@...een.com,
akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-riscv@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-mm@...ck.org, sweettea-kernel@...miny.me,
christophe.leroy@...roup.eu, mingo@...nel.org
Subject: [PATCH v15 10/13] powerpc: mm: Add pud_pfn() stub
From: Rohan McLure <rmclure@...ux.ibm.com>
The page table check feature requires that pud_pfn() be defined
on each consuming architecture.
On powerpc, only book3s64 platforms allow for hugepages at this upper
level, and thus only book3s64 currently defines pud_pfn().
The page table check code that calls pud_pfn() is gated by a call to
pud_user_accessible_page(), which will always return false on any platform
other than book3s64.
Add a stub implementation of pud_pfn() for all platforms other than
book3s64. As it will never actually be used and should always be compiled
out, raise a BUILD_BUG() error.
[ajd@...ux.ibm.com: clarify commit message]
Signed-off-by: Rohan McLure <rmclure@...ux.ibm.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@...een.com>
Signed-off-by: Andrew Donnellan <ajd@...ux.ibm.com>
---
v15: clarify commit message
---
arch/powerpc/include/asm/pgtable.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 93d77ad5a92f..0f73a9ade0ed 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -214,6 +214,15 @@ static inline bool arch_supports_memmap_on_memory(unsigned long vmemmap_size)
#endif /* CONFIG_PPC64 */
+#ifndef pud_pfn
+#define pud_pfn pud_pfn
+static inline int pud_pfn(pud_t pud)
+{
+ BUILD_BUG();
+ return 0;
+}
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_PGTABLE_H */
--
2.49.0
Powered by blists - more mailing lists