mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Architectures for which we have hardware walkers of Linux page table should flush TLB on mmu gather batch allocation failures and batch flush. Some architectures like POWER supports multiple translation modes (hash and radix) and in the case of POWER only radix translation mode needs the above TLBI. This is because for hash translation mode kernel wants to avoid this extra flush since there are no hardware walkers of linux page table. With radix translation, the hardware also walks linux page table and with that, kernel needs to make sure to TLB invalidate page walk cache before page table pages are freed. More details in commitd86564a2f0
("mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE") The changes to sparc are to make sure we keep the old behavior since we are now removing HAVE_RCU_TABLE_NO_INVALIDATE. The default value for tlb_needs_table_invalidate is to always force an invalidate and sparc can avoid the table invalidate. Hence we define tlb_needs_table_invalidate to false for sparc architecture. Link: http://lkml.kernel.org/r/20200116064531.483522-3-aneesh.kumar@linux.ibm.com Fixes:a46cc7a90f
("powerpc/mm/radix: Improve TLB/PWC flushes") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Cc: <stable@vger.kernel.org> [4.14+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
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/pgalloc.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_start_vma(tlb, vma) do { } while (0)
|
|
#define tlb_end_vma(tlb, vma) do { } while (0)
|
|
#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
|
|
#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_HAVE_RCU_TABLE_FREE
|
|
#define tlb_needs_table_invalidate() (false)
|
|
#endif
|
|
|
|
#include <asm-generic/tlb.h>
|
|
|
|
#endif /* _SPARC64_TLB_H */
|