diff mbox series

[v1] arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2

Message ID 20240509122844.563320-1-ryan.roberts@arm.com (mailing list archive)
State New
Headers show
Series [v1] arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2 | expand

Commit Message

Ryan Roberts May 9, 2024, 12:28 p.m. UTC
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>
---
 arch/arm64/include/asm/pgtable.h | 1 +
 1 file changed, 1 insertion(+)

--
2.43.0

Comments

Will Deacon May 9, 2024, 3:01 p.m. UTC | #1
On Thu, 09 May 2024 13:28:42 +0100, Ryan Roberts wrote:
> 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.
> 
> [...]

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2
      https://git.kernel.org/arm64/c/cb67ea121cdd

Cheers,
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 78fd3e2ef8c6..bde9fd179388 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -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 */