Path: blob/master/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
52467 views
/* SPDX-License-Identifier: GPL-2.0 */1#ifndef _ASM_POWERPC_BOOK3S_64_TLBFLUSH_HASH_H2#define _ASM_POWERPC_BOOK3S_64_TLBFLUSH_HASH_H34/*5* TLB flushing for 64-bit hash-MMU CPUs6*/78#include <linux/percpu.h>9#include <asm/page.h>1011#define PPC64_TLB_BATCH_NR 1921213struct ppc64_tlb_batch {14unsigned long index;15struct mm_struct *mm;16real_pte_t pte[PPC64_TLB_BATCH_NR];17unsigned long vpn[PPC64_TLB_BATCH_NR];18unsigned int psize;19int ssize;20};21DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);2223extern void __flush_tlb_pending(struct ppc64_tlb_batch *batch);2425static inline void arch_enter_lazy_mmu_mode(void)26{27if (radix_enabled())28return;29/*30* apply_to_page_range can call us this preempt enabled when31* operating on kernel page tables.32*/33preempt_disable();34}3536static inline void arch_flush_lazy_mmu_mode(void)37{38struct ppc64_tlb_batch *batch;3940if (radix_enabled())41return;42batch = this_cpu_ptr(&ppc64_tlb_batch);4344if (batch->index)45__flush_tlb_pending(batch);46}4748static inline void arch_leave_lazy_mmu_mode(void)49{50if (radix_enabled())51return;5253arch_flush_lazy_mmu_mode();54preempt_enable();55}5657extern void hash__tlbiel_all(unsigned int action);5859extern void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize,60int ssize, unsigned long flags);61extern void flush_hash_range(unsigned long number, int local);62extern void flush_hash_hugepage(unsigned long vsid, unsigned long addr,63pmd_t *pmdp, unsigned int psize, int ssize,64unsigned long flags);6566struct mmu_gather;67extern void hash__tlb_flush(struct mmu_gather *tlb);6869#ifdef CONFIG_PPC_64S_HASH_MMU70/* Private function for use by PCI IO mapping code */71extern void __flush_hash_table_range(unsigned long start, unsigned long end);72void flush_hash_table_pmd_range(struct mm_struct *mm, pmd_t *pmd, unsigned long addr);73#else74static inline void __flush_hash_table_range(unsigned long start, unsigned long end) { }75#endif76#endif /* _ASM_POWERPC_BOOK3S_64_TLBFLUSH_HASH_H */777879