Skip to content

Commit 676012a

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm: Hash abstraction for tlbflush routines
Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent f5df4b4 commit 676012a

File tree

4 files changed

+73
-15
lines changed

4 files changed

+73
-15
lines changed

arch/powerpc/include/asm/book3s/64/tlbflush-hash.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,42 @@ extern void flush_hash_range(unsigned long number, int local);
5252
extern void flush_hash_hugepage(unsigned long vsid, unsigned long addr,
5353
pmd_t *pmdp, unsigned int psize, int ssize,
5454
unsigned long flags);
55-
56-
static inline void local_flush_tlb_mm(struct mm_struct *mm)
55+
static inline void hash__local_flush_tlb_mm(struct mm_struct *mm)
5756
{
5857
}
5958

60-
static inline void flush_tlb_mm(struct mm_struct *mm)
59+
static inline void hash__flush_tlb_mm(struct mm_struct *mm)
6160
{
6261
}
6362

64-
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
65-
unsigned long vmaddr)
63+
static inline void hash__local_flush_tlb_page(struct vm_area_struct *vma,
64+
unsigned long vmaddr)
6665
{
6766
}
6867

69-
static inline void flush_tlb_page(struct vm_area_struct *vma,
70-
unsigned long vmaddr)
68+
static inline void hash__flush_tlb_page(struct vm_area_struct *vma,
69+
unsigned long vmaddr)
7170
{
7271
}
7372

74-
static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
75-
unsigned long vmaddr)
73+
static inline void hash__flush_tlb_page_nohash(struct vm_area_struct *vma,
74+
unsigned long vmaddr)
7675
{
7776
}
7877

79-
static inline void flush_tlb_range(struct vm_area_struct *vma,
80-
unsigned long start, unsigned long end)
78+
static inline void hash__flush_tlb_range(struct vm_area_struct *vma,
79+
unsigned long start, unsigned long end)
8180
{
8281
}
8382

84-
static inline void flush_tlb_kernel_range(unsigned long start,
85-
unsigned long end)
83+
static inline void hash__flush_tlb_kernel_range(unsigned long start,
84+
unsigned long end)
8685
{
8786
}
8887

88+
89+
struct mmu_gather;
90+
extern void hash__tlb_flush(struct mmu_gather *tlb);
8991
/* Private function for use by PCI IO mapping code */
9092
extern void __flush_hash_table_range(struct mm_struct *mm, unsigned long start,
9193
unsigned long end);
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#ifndef _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H
2+
#define _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H
3+
4+
#include <asm/book3s/64/tlbflush-hash.h>
5+
6+
static inline void flush_tlb_range(struct vm_area_struct *vma,
7+
unsigned long start, unsigned long end)
8+
{
9+
return hash__flush_tlb_range(vma, start, end);
10+
}
11+
12+
static inline void flush_tlb_kernel_range(unsigned long start,
13+
unsigned long end)
14+
{
15+
return hash__flush_tlb_kernel_range(start, end);
16+
}
17+
18+
static inline void local_flush_tlb_mm(struct mm_struct *mm)
19+
{
20+
return hash__local_flush_tlb_mm(mm);
21+
}
22+
23+
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
24+
unsigned long vmaddr)
25+
{
26+
return hash__local_flush_tlb_page(vma, vmaddr);
27+
}
28+
29+
static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
30+
unsigned long vmaddr)
31+
{
32+
return hash__flush_tlb_page_nohash(vma, vmaddr);
33+
}
34+
35+
static inline void tlb_flush(struct mmu_gather *tlb)
36+
{
37+
return hash__tlb_flush(tlb);
38+
}
39+
40+
#ifdef CONFIG_SMP
41+
static inline void flush_tlb_mm(struct mm_struct *mm)
42+
{
43+
return hash__flush_tlb_mm(mm);
44+
}
45+
46+
static inline void flush_tlb_page(struct vm_area_struct *vma,
47+
unsigned long vmaddr)
48+
{
49+
return hash__flush_tlb_page(vma, vmaddr);
50+
}
51+
#else
52+
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
53+
#define flush_tlb_page(vma, addr) local_flush_tlb_page(vma, addr)
54+
#endif /* CONFIG_SMP */
55+
56+
#endif /* _ASM_POWERPC_BOOK3S_64_TLBFLUSH_H */

arch/powerpc/include/asm/tlbflush.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
7878
}
7979

8080
#elif defined(CONFIG_PPC_STD_MMU_64)
81-
#include <asm/book3s/64/tlbflush-hash.h>
81+
#include <asm/book3s/64/tlbflush.h>
8282
#else
8383
#error Unsupported MMU type
8484
#endif

arch/powerpc/mm/tlb_hash64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
155155
batch->index = 0;
156156
}
157157

158-
void tlb_flush(struct mmu_gather *tlb)
158+
void hash__tlb_flush(struct mmu_gather *tlb)
159159
{
160160
struct ppc64_tlb_batch *tlbbatch = &get_cpu_var(ppc64_tlb_batch);
161161

0 commit comments

Comments
 (0)