linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: Add a fallback stub for pgd_page_paddr()
@ 2025-10-14 11:06 Anshuman Khandual
  2025-11-04 14:31 ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Anshuman Khandual @ 2025-10-14 11:06 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: ryan.roberts, Anshuman Khandual, Catalin Marinas, Will Deacon,
	linux-kernel

Add a fallback stub for pgd_page_paddr() when (PGTBALE_LEVELS <= 4) which
helps in intercepting any unintended usage and which is also in line with
existing stubs for similar [pud|p4d]_page_paddr() helpers.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index aa89c2e67ebc..fb34df92d159 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -1212,6 +1212,8 @@ static inline p4d_t *p4d_offset_kimg(pgd_t *pgdp, u64 addr)
 
 static inline bool pgtable_l5_enabled(void) { return false; }
 
+#define pgd_page_paddr(pgd)	({ BUILD_BUG(); 0; })
+
 #define p4d_index(addr)		(((addr) >> P4D_SHIFT) & (PTRS_PER_P4D - 1))
 
 /* Match p4d_offset folding in <asm/generic/pgtable-nop4d.h> */
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-13 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 11:06 [PATCH] arm64/mm: Add a fallback stub for pgd_page_paddr() Anshuman Khandual
2025-11-04 14:31 ` Will Deacon
2025-11-05  2:54   ` Anshuman Khandual
2025-11-05 17:03     ` Will Deacon
2025-11-06  1:59       ` Anshuman Khandual
2025-11-13 16:19         ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).