arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2
authorRyan Roberts <ryan.roberts@arm.com>
Thu, 9 May 2024 12:28:42 +0000 (13:28 +0100)
committerWill Deacon <will@kernel.org>
Thu, 9 May 2024 14:45:02 +0000 (15:45 +0100)
The recent change to use pud_valid() as part of the implementation of
pud_user_accessible_page() fails to build when PGTABLE_LEVELS <= 2
because pud_valid() is not defined in that case.

Fix this by defining pud_valid() to false for this case. This means that
pud_user_accessible_page() will correctly always return false for this
config.

Fixes: f0f5863a0fb0 ("arm64/mm: Remove PTE_PROT_NONE bit")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405082221.43rfWxz5-lkp@intel.com/
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Link: https://lore.kernel.org/r/20240509122844.563320-1-ryan.roberts@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/pgtable.h

index 78fd3e2ef8c63a51d0a4ad8c359633663f397a24..bde9fd1793887907c4cc2991bb7ff3e89aaf44dd 100644 (file)
@@ -814,6 +814,7 @@ static inline pmd_t *pud_pgtable(pud_t pud)
 
 #else
 
+#define pud_valid(pud)         false
 #define pud_page_paddr(pud)    ({ BUILD_BUG(); 0; })
 #define pud_user_exec(pud)     pud_user(pud) /* Always 0 with folding */