Skip to contentSkip to conversation

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

PATCH Applied Ryan Roberts 2 participants 2 messages May 9, 2024 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64/mm: Fix pud_user_accessible_page() for PGTABLE_LEVELS <= 2

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.

---
 arch/arm64/include/asm/pgtable.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/include/asm/pgtable.h +1 -0
index 78fd3e2ef8c6..bde9fd179388 100644
@@ -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 */
 

--
2.43.0

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#1 lore raw
Quoted 9 lines · Ryan Roberts

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,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel