mirror of
https://github.com/torvalds/linux.git
synced 2025-04-09 14:45:27 +00:00

Several architectures (arm, arm64, riscv and x86) define exactly the same __tlb_remove_table(), just introduce generic __tlb_remove_table() to eliminate these duplications. The s390 __tlb_remove_table() is nearly the same, so also make s390 __tlb_remove_table() version generic. Link: https://lkml.kernel.org/r/ea372633d94f4d3f9f56a7ec5994bf050bf77e39.1736317725.git.zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Acked-by: Andreas Larsson <andreas@gaisler.com> [sparc] Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> [s390] Acked-by: Arnd Bergmann <arnd@arndb.de> [asm-generic] Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Jann Horn <jannh@google.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com> Cc: Will Deacon <will@kernel.org> Cc: Yu Zhao <yuzhao@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
40 lines
997 B
C
40 lines
997 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _SPARC64_TLB_H
|
|
#define _SPARC64_TLB_H
|
|
|
|
#include <linux/swap.h>
|
|
#include <linux/pagemap.h>
|
|
#include <asm/tlbflush.h>
|
|
#include <asm/mmu_context.h>
|
|
|
|
#ifdef CONFIG_SMP
|
|
void smp_flush_tlb_pending(struct mm_struct *,
|
|
unsigned long, unsigned long *);
|
|
#endif
|
|
|
|
#ifdef CONFIG_SMP
|
|
void smp_flush_tlb_mm(struct mm_struct *mm);
|
|
#define do_flush_tlb_mm(mm) smp_flush_tlb_mm(mm)
|
|
#else
|
|
#define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT)
|
|
#endif
|
|
|
|
void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *);
|
|
void flush_tlb_pending(void);
|
|
|
|
#define tlb_flush(tlb) flush_tlb_pending()
|
|
|
|
/*
|
|
* SPARC64's hardware TLB fill does not use the Linux page-tables
|
|
* and therefore we don't need a TLBI when freeing page-table pages.
|
|
*/
|
|
|
|
#ifdef CONFIG_MMU_GATHER_RCU_TABLE_FREE
|
|
#define tlb_needs_table_invalidate() (false)
|
|
#endif
|
|
|
|
#define __HAVE_ARCH_TLB_REMOVE_TABLE
|
|
#include <asm-generic/tlb.h>
|
|
|
|
#endif /* _SPARC64_TLB_H */
|