]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm: convert __HAVE_ARCH_TLB_REMOVE_TABLE to CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE config
authorQi Zheng <zhengqi.arch@bytedance.com>
Tue, 27 Jan 2026 12:13:00 +0000 (20:13 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 6 Feb 2026 23:47:19 +0000 (15:47 -0800)
For architectures that define __HAVE_ARCH_TLB_REMOVE_TABLE, the page
tables at the pmd/pud level are generally not of struct ptdesc type, and
do not have pt_rcu_head member, thus these architectures cannot support
PT_RECLAIM.

In preparation for enabling PT_RECLAIM on more architectures, convert
__HAVE_ARCH_TLB_REMOVE_TABLE to CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE config,
so that we can make conditional judgments in Kconfig.

Link: https://lkml.kernel.org/r/5ebfa3d4b56e63c6906bda5eccaa9f7194d3a86b.1769515122.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Tested-by: Andreas Larsson <andreas@gaisler.com> [sparc, UP&SMP]
Acked-by: Andreas Larsson <andreas@gaisler.com> [sparc]
Cc: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Lance Yang <ioworker0@gmail.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Magnus Lindholm <linmag7@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/Kconfig
arch/powerpc/include/asm/tlb.h
arch/sparc/Kconfig
arch/sparc/include/asm/tlb_64.h
include/asm-generic/tlb.h
mm/Kconfig

index 271690445a454b642041e47b0d73cc3fe7d38ae5..374ee60dcf75f5eaac413c07252aff113e206f5f 100644 (file)
@@ -305,6 +305,7 @@ config PPC
        select LOCK_MM_AND_FIND_VMA
        select MMU_GATHER_PAGE_SIZE
        select MMU_GATHER_RCU_TABLE_FREE
+       select HAVE_ARCH_TLB_REMOVE_TABLE
        select MMU_GATHER_MERGE_VMAS
        select MMU_LAZY_TLB_SHOOTDOWN           if PPC_BOOK3S_64
        select MODULES_USE_ELF_RELA
index 2058e8d3e01385db2213b02afd153e22b3ead803..1ca7d4c4b90dbf49cb7e002376fc5e73ad65a9ba 100644 (file)
@@ -37,7 +37,6 @@ extern void tlb_flush(struct mmu_gather *tlb);
  */
 #define tlb_needs_table_invalidate()   radix_enabled()
 
-#define __HAVE_ARCH_TLB_REMOVE_TABLE
 /* Get the generic bits... */
 #include <asm-generic/tlb.h>
 
index 2bad14744ca4e31f9e809d20ffba984d35ed98fb..61415a9b3e865d04f1c7634e52d71a1d77f258be 100644 (file)
@@ -74,6 +74,7 @@ config SPARC64
        select HAVE_KRETPROBES
        select HAVE_KPROBES
        select MMU_GATHER_RCU_TABLE_FREE if SMP
+       select HAVE_ARCH_TLB_REMOVE_TABLE if SMP
        select MMU_GATHER_MERGE_VMAS
        select MMU_GATHER_NO_FLUSH_CACHE
        select HAVE_ARCH_TRANSPARENT_HUGEPAGE
index 1a6e694418e392dbd4f8f0f58c95df701927c48b..3037187482db7ebe3334f99cb3e4e7af095933b7 100644 (file)
@@ -33,7 +33,6 @@ void flush_tlb_pending(void);
 #define tlb_needs_table_invalidate()   (false)
 #endif
 
-#define __HAVE_ARCH_TLB_REMOVE_TABLE
 #include <asm-generic/tlb.h>
 
 #endif /* _SPARC64_TLB_H */
index 3975f7d1155344515b1609342453074a0fe6cfdc..4aeac0c3d3f03458b759afab60102b9c150cdeeb 100644 (file)
@@ -213,7 +213,7 @@ struct mmu_table_batch {
 #define MAX_TABLE_BATCH                \
        ((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *))
 
-#ifndef __HAVE_ARCH_TLB_REMOVE_TABLE
+#ifndef CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE
 static inline void __tlb_remove_table(void *table)
 {
        struct ptdesc *ptdesc = (struct ptdesc *)table;
index d1d76ce7373ed5c632800c8f5a11680b145bbc65..ec1db8a786af8d41e92032776bbfa4a32e18ca3c 100644 (file)
@@ -1448,6 +1448,9 @@ config ARCH_HAS_USER_SHADOW_STACK
          The architecture has hardware support for userspace shadow call
           stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss).
 
+config HAVE_ARCH_TLB_REMOVE_TABLE
+       def_bool n
+
 config ARCH_SUPPORTS_PT_RECLAIM
        def_bool n