[PATCH 14/24] alpha: add ARCH_SUPPORTS_PAGE_TABLE_CHECK support
From: Matt Turner
Date: Tue Sep 01 2026 - 13:22:47 EST
Add the page table check helpers needed for CONFIG_PAGE_TABLE_CHECK
and select ARCH_SUPPORTS_PAGE_TABLE_CHECK in Kconfig.
Alpha does not support huge pages, so pmd_user_accessible_page() and
pud_user_accessible_page() always return false. pte_user_accessible_page()
checks for present PTEs with user read access (_PAGE_URE).
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
---
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/pgtable.h | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git ./arch/alpha/Kconfig ./arch/alpha/Kconfig
index 4c38405cd6cd..d7e2859aaedb 100644
--- ./arch/alpha/Kconfig
+++ ./arch/alpha/Kconfig
@@ -17,6 +17,7 @@ config ALPHA
select ARCH_NO_SG_CHAIN
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
+ select ARCH_SUPPORTS_PAGE_TABLE_CHECK
select ARCH_USE_CMPXCHG_LOCKREF
select FORCE_PCI
select PCI_DOMAINS if PCI
diff --git ./arch/alpha/include/asm/pgtable.h ./arch/alpha/include/asm/pgtable.h
index bdff33b505bc..310361920a1f 100644
--- ./arch/alpha/include/asm/pgtable.h
+++ ./arch/alpha/include/asm/pgtable.h
@@ -232,6 +232,22 @@ extern inline void pud_clear(pud_t * pudp) { pud_val(*pudp) = 0; }
extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); }
extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
+extern inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_URE; }
+
+static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
+{
+ return pte_present(pte) && pte_user(pte);
+}
+
+static inline bool pmd_user_accessible_page(pmd_t pmd, unsigned long addr)
+{
+ return false;
+}
+
+static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
+{
+ return false;
+}
extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; }
extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; }
--
2.54.0