Skip to content

Commit 086498a

Browse files
Qi Zhengakpm00
authored andcommitted
mm: convert __HAVE_ARCH_TLB_REMOVE_TABLE to CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE config
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>
1 parent 6578ab0 commit 086498a

6 files changed

Lines changed: 6 additions & 3 deletions

File tree

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ config PPC
305305
select LOCK_MM_AND_FIND_VMA
306306
select MMU_GATHER_PAGE_SIZE
307307
select MMU_GATHER_RCU_TABLE_FREE
308+
select HAVE_ARCH_TLB_REMOVE_TABLE
308309
select MMU_GATHER_MERGE_VMAS
309310
select MMU_LAZY_TLB_SHOOTDOWN if PPC_BOOK3S_64
310311
select MODULES_USE_ELF_RELA

arch/powerpc/include/asm/tlb.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ extern void tlb_flush(struct mmu_gather *tlb);
3737
*/
3838
#define tlb_needs_table_invalidate() radix_enabled()
3939

40-
#define __HAVE_ARCH_TLB_REMOVE_TABLE
4140
/* Get the generic bits... */
4241
#include <asm-generic/tlb.h>
4342

arch/sparc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ config SPARC64
7474
select HAVE_KRETPROBES
7575
select HAVE_KPROBES
7676
select MMU_GATHER_RCU_TABLE_FREE if SMP
77+
select HAVE_ARCH_TLB_REMOVE_TABLE if SMP
7778
select MMU_GATHER_MERGE_VMAS
7879
select MMU_GATHER_NO_FLUSH_CACHE
7980
select HAVE_ARCH_TRANSPARENT_HUGEPAGE

arch/sparc/include/asm/tlb_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ void flush_tlb_pending(void);
3333
#define tlb_needs_table_invalidate() (false)
3434
#endif
3535

36-
#define __HAVE_ARCH_TLB_REMOVE_TABLE
3736
#include <asm-generic/tlb.h>
3837

3938
#endif /* _SPARC64_TLB_H */

include/asm-generic/tlb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct mmu_table_batch {
213213
#define MAX_TABLE_BATCH \
214214
((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *))
215215

216-
#ifndef __HAVE_ARCH_TLB_REMOVE_TABLE
216+
#ifndef CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE
217217
static inline void __tlb_remove_table(void *table)
218218
{
219219
struct ptdesc *ptdesc = (struct ptdesc *)table;

mm/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,9 @@ config ARCH_HAS_USER_SHADOW_STACK
14481448
The architecture has hardware support for userspace shadow call
14491449
stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss).
14501450

1451+
config HAVE_ARCH_TLB_REMOVE_TABLE
1452+
def_bool n
1453+
14511454
config ARCH_SUPPORTS_PT_RECLAIM
14521455
def_bool n
14531456

0 commit comments

Comments
 (0)