1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H
3 #define _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H
5 #define MMU_NO_CONTEXT ~0UL
8 #include <asm/book3s/64/tlbflush-hash.h>
9 #include <asm/book3s/64/tlbflush-radix.h>
11 #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE
12 static inline void flush_pmd_tlb_range(struct vm_area_struct *vma,
13 unsigned long start, unsigned long end)
16 return radix__flush_pmd_tlb_range(vma, start, end);
17 return hash__flush_tlb_range(vma, start, end);
20 #define __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE
21 static inline void flush_hugetlb_tlb_range(struct vm_area_struct *vma,
26 return radix__flush_hugetlb_tlb_range(vma, start, end);
27 return hash__flush_tlb_range(vma, start, end);
30 static inline void flush_tlb_range(struct vm_area_struct *vma,
31 unsigned long start, unsigned long end)
34 return radix__flush_tlb_range(vma, start, end);
35 return hash__flush_tlb_range(vma, start, end);
38 static inline void flush_tlb_kernel_range(unsigned long start,
42 return radix__flush_tlb_kernel_range(start, end);
43 return hash__flush_tlb_kernel_range(start, end);
46 static inline void local_flush_tlb_mm(struct mm_struct *mm)
49 return radix__local_flush_tlb_mm(mm);
50 return hash__local_flush_tlb_mm(mm);
53 static inline void local_flush_tlb_page(struct vm_area_struct *vma,
57 return radix__local_flush_tlb_page(vma, vmaddr);
58 return hash__local_flush_tlb_page(vma, vmaddr);
61 static inline void tlb_flush(struct mmu_gather *tlb)
64 return radix__tlb_flush(tlb);
65 return hash__tlb_flush(tlb);
69 static inline void flush_tlb_mm(struct mm_struct *mm)
72 return radix__flush_tlb_mm(mm);
73 return hash__flush_tlb_mm(mm);
76 static inline void flush_tlb_page(struct vm_area_struct *vma,
80 return radix__flush_tlb_page(vma, vmaddr);
81 return hash__flush_tlb_page(vma, vmaddr);
84 #define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
85 #define flush_tlb_page(vma, addr) local_flush_tlb_page(vma, addr)
86 #endif /* CONFIG_SMP */
88 * flush the page walk cache for the address
90 static inline void flush_tlb_pgtable(struct mmu_gather *tlb, unsigned long address)
93 * Flush the page table walk cache on freeing a page table. We already
94 * have marked the upper/higher level page table entry none by now.
95 * So it is safe to flush PWC here.
100 radix__flush_tlb_pwc(tlb, address);
102 #endif /* _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H */