Path: blob/master/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
26519 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 {14int active;15unsigned long index;16struct mm_struct *mm;17real_pte_t pte[PPC64_TLB_BATCH_NR];18unsigned long vpn[PPC64_TLB_BATCH_NR];19unsigned int psize;20int ssize;21};22DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);2324extern void __flush_tlb_pending(struct ppc64_tlb_batch *batch);2526#define __HAVE_ARCH_ENTER_LAZY_MMU_MODE2728static inline void arch_enter_lazy_mmu_mode(void)29{30struct ppc64_tlb_batch *batch;3132if (radix_enabled())33return;34/*35* apply_to_page_range can call us this preempt enabled when36* operating on kernel page tables.37*/38preempt_disable();39batch = this_cpu_ptr(&ppc64_tlb_batch);40batch->active = 1;41}4243static inline void arch_leave_lazy_mmu_mode(void)44{45struct ppc64_tlb_batch *batch;4647if (radix_enabled())48return;49batch = this_cpu_ptr(&ppc64_tlb_batch);5051if (batch->index)52__flush_tlb_pending(batch);53batch->active = 0;54preempt_enable();55}5657#define arch_flush_lazy_mmu_mode() do {} while (0)5859extern void hash__tlbiel_all(unsigned int action);6061extern void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize,62int ssize, unsigned long flags);63extern void flush_hash_range(unsigned long number, int local);64extern void flush_hash_hugepage(unsigned long vsid, unsigned long addr,65pmd_t *pmdp, unsigned int psize, int ssize,66unsigned long flags);6768struct mmu_gather;69extern void hash__tlb_flush(struct mmu_gather *tlb);7071#ifdef CONFIG_PPC_64S_HASH_MMU72/* Private function for use by PCI IO mapping code */73extern void __flush_hash_table_range(unsigned long start, unsigned long end);74void flush_hash_table_pmd_range(struct mm_struct *mm, pmd_t *pmd, unsigned long addr);75#else76static inline void __flush_hash_table_range(unsigned long start, unsigned long end) { }77#endif78#endif /* _ASM_POWERPC_BOOK3S_64_TLBFLUSH_HASH_H */798081