The patch titled Subject: arm64/mm: fix page table check compile error for CONFIG_PGTABLE_LEVELS=2 has been added to the -mm mm-unstable branch. Its filename is arm64-mm-fix-page-table-check-compile-error-for-config_pgtable_levels=2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/arm64-mm-fix-page-table-check-compile-error-for-config_pgtable_levels=2.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Tong Tiangen <tongtiangen@xxxxxxxxxx> Subject: arm64/mm: fix page table check compile error for CONFIG_PGTABLE_LEVELS=2 Date: Tue, 17 May 2022 07:45:48 +0000 If CONFIG_PGTABLE_LEVELS=2 and CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y, then we trigger a compile error: error: implicit declaration of function 'pte_user_accessible_page' Move the definition of page table check helper out of branch CONFIG_PGTABLE_LEVELS > 2 Link: https://lkml.kernel.org/r/20220517074548.2227779-3-tongtiangen@xxxxxxxxxx Fixes: daf214c14dbe ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Tong Tiangen <tongtiangen@xxxxxxxxxx> Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx> Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx> Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Guohanjun <guohanjun@xxxxxxxxxx> Cc: Xie XiuQi <xiexiuqi@xxxxxxxxxx> Cc: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/arm64/include/asm/pgtable.h | 33 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) --- a/arch/arm64/include/asm/pgtable.h~arm64-mm-fix-page-table-check-compile-error-for-config_pgtable_levels=2 +++ a/arch/arm64/include/asm/pgtable.h @@ -667,22 +667,6 @@ static inline unsigned long pmd_page_vad #define pud_valid(pud) pte_valid(pud_pte(pud)) #define pud_user(pud) pte_user(pud_pte(pud)) -#ifdef CONFIG_PAGE_TABLE_CHECK -static inline bool pte_user_accessible_page(pte_t pte) -{ - return pte_present(pte) && (pte_user(pte) || pte_user_exec(pte)); -} - -static inline bool pmd_user_accessible_page(pmd_t pmd) -{ - return pmd_present(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); -} - -static inline bool pud_user_accessible_page(pud_t pud) -{ - return pud_present(pud) && pud_user(pud); -} -#endif static inline void set_pud(pud_t *pudp, pud_t pud) { @@ -855,6 +839,23 @@ static inline int pgd_devmap(pgd_t pgd) } #endif +#ifdef CONFIG_PAGE_TABLE_CHECK +static inline bool pte_user_accessible_page(pte_t pte) +{ + return pte_present(pte) && (pte_user(pte) || pte_user_exec(pte)); +} + +static inline bool pmd_user_accessible_page(pmd_t pmd) +{ + return pmd_present(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); +} + +static inline bool pud_user_accessible_page(pud_t pud) +{ + return pud_present(pud) && pud_user(pud); +} +#endif + /* * Atomic pte/pmd modifications. */ _ Patches currently in -mm which might be from tongtiangen@xxxxxxxxxx are riscv-mm-fix-two-page-table-check-related-issues.patch arm64-mm-fix-page-table-check-compile-error-for-config_pgtable_levels=2.patch