diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2020-10-22 09:29:38 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-12-09 08:46:56 +0300 |
commit | 91ec450f8d8c1e599a943c526ab1d2a4acf73c22 (patch) | |
tree | 7f200a43a3423bae043628c74da48ddfd33807d8 /arch/powerpc/include | |
parent | 1e83396f29d75aae8a1d365f597996fec87ca4d0 (diff) | |
download | linux-91ec450f8d8c1e599a943c526ab1d2a4acf73c22.tar.xz |
powerpc/32s: Split and inline flush_range()
flush_range() handle both the MMU_FTR_HPTE_TABLE case and
the other case.
The non MMU_FTR_HPTE_TABLE case is trivial as it is only a call
to _tlbie()/_tlbia() which is not worth a dedicated function.
Make flush_range() a hash specific and call it from tlbflush.h based
on mmu_has_feature(MMU_FTR_HPTE_TABLE).
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/132ab19aae52abc8e06ab524ec86d4229b5b9c3d.1603348103.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/book3s/32/tlbflush.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/book3s/32/tlbflush.h b/arch/powerpc/include/asm/book3s/32/tlbflush.h index 2f480d184526..42708c1719d6 100644 --- a/arch/powerpc/include/asm/book3s/32/tlbflush.h +++ b/arch/powerpc/include/asm/book3s/32/tlbflush.h @@ -8,7 +8,7 @@ */ void hash__flush_tlb_mm(struct mm_struct *mm); void hash__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); -void flush_range(struct mm_struct *mm, unsigned long start, unsigned long end); +void hash__flush_range(struct mm_struct *mm, unsigned long start, unsigned long end); #ifdef CONFIG_SMP void _tlbie(unsigned long address); @@ -20,6 +20,17 @@ static inline void _tlbie(unsigned long address) #endif void _tlbia(void); +static inline void flush_range(struct mm_struct *mm, unsigned long start, unsigned long end) +{ + start &= PAGE_MASK; + if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) + hash__flush_range(mm, start, end); + else if (end - start <= PAGE_SIZE) + _tlbie(start); + else + _tlbia(); +} + static inline void flush_tlb_mm(struct mm_struct *mm) { if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) |