aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/tlb.h12
-rw-r--r--arch/powerpc/mm/tlb-radix.c8
2 files changed, 16 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/tlb.h b/arch/powerpc/include/asm/tlb.h
index f6f68f73e858..99e1397b71da 100644
--- a/arch/powerpc/include/asm/tlb.h
+++ b/arch/powerpc/include/asm/tlb.h
@@ -52,11 +52,23 @@ static inline int mm_is_core_local(struct mm_struct *mm)
52 return cpumask_subset(mm_cpumask(mm), 52 return cpumask_subset(mm_cpumask(mm),
53 topology_sibling_cpumask(smp_processor_id())); 53 topology_sibling_cpumask(smp_processor_id()));
54} 54}
55
56static inline int mm_is_thread_local(struct mm_struct *mm)
57{
58 return cpumask_equal(mm_cpumask(mm),
59 cpumask_of(smp_processor_id()));
60}
61
55#else 62#else
56static inline int mm_is_core_local(struct mm_struct *mm) 63static inline int mm_is_core_local(struct mm_struct *mm)
57{ 64{
58 return 1; 65 return 1;
59} 66}
67
68static inline int mm_is_thread_local(struct mm_struct *mm)
69{
70 return 1;
71}
60#endif 72#endif
61 73
62#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c
index 0e49ec541ab5..bda8c43be78a 100644
--- a/arch/powerpc/mm/tlb-radix.c
+++ b/arch/powerpc/mm/tlb-radix.c
@@ -175,7 +175,7 @@ void radix__flush_tlb_mm(struct mm_struct *mm)
175 if (unlikely(pid == MMU_NO_CONTEXT)) 175 if (unlikely(pid == MMU_NO_CONTEXT))
176 goto no_context; 176 goto no_context;
177 177
178 if (!mm_is_core_local(mm)) { 178 if (!mm_is_thread_local(mm)) {
179 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE); 179 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
180 180
181 if (lock_tlbie) 181 if (lock_tlbie)
@@ -201,7 +201,7 @@ void radix__flush_tlb_pwc(struct mmu_gather *tlb, unsigned long addr)
201 if (unlikely(pid == MMU_NO_CONTEXT)) 201 if (unlikely(pid == MMU_NO_CONTEXT))
202 goto no_context; 202 goto no_context;
203 203
204 if (!mm_is_core_local(mm)) { 204 if (!mm_is_thread_local(mm)) {
205 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE); 205 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
206 206
207 if (lock_tlbie) 207 if (lock_tlbie)
@@ -226,7 +226,7 @@ void radix__flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr,
226 pid = mm ? mm->context.id : 0; 226 pid = mm ? mm->context.id : 0;
227 if (unlikely(pid == MMU_NO_CONTEXT)) 227 if (unlikely(pid == MMU_NO_CONTEXT))
228 goto bail; 228 goto bail;
229 if (!mm_is_core_local(mm)) { 229 if (!mm_is_thread_local(mm)) {
230 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE); 230 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
231 231
232 if (lock_tlbie) 232 if (lock_tlbie)
@@ -321,7 +321,7 @@ void radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long start,
321{ 321{
322 unsigned long pid; 322 unsigned long pid;
323 unsigned long addr; 323 unsigned long addr;
324 int local = mm_is_core_local(mm); 324 int local = mm_is_thread_local(mm);
325 unsigned long ap = mmu_get_ap(psize); 325 unsigned long ap = mmu_get_ap(psize);
326 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE); 326 int lock_tlbie = !mmu_has_feature(MMU_FTR_LOCKLESS_TLBIE);
327 unsigned long page_size = 1UL << mmu_psize_defs[psize].shift; 327 unsigned long page_size = 1UL << mmu_psize_defs[psize].shift;