aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/slice.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-09-14 11:30:52 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2018-09-19 08:01:46 -0400
commit8fed04d0f6aedf99b3d811ba58d38bb7f938a47a (patch)
treec0119afa2bf361697e2a2690157854e1496cef1c /arch/powerpc/mm/slice.c
parent5e46e29e6a977a71f6b5bed414b7bcdbff5a6a43 (diff)
powerpc/64s/hash: remove user SLB data from the paca
User SLB mappig data is copied into the PACA from the mm->context so it can be accessed by the SLB miss handlers. After the C conversion, SLB miss handlers now run with relocation on, and user SLB misses are able to take recursive kernel SLB misses, so the user SLB mapping data can be removed from the paca and accessed directly. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/slice.c')
-rw-r--r--arch/powerpc/mm/slice.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 205fe557ca10..606f424aac47 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -207,23 +207,6 @@ static bool slice_check_range_fits(struct mm_struct *mm,
207 return true; 207 return true;
208} 208}
209 209
210static void slice_flush_segments(void *parm)
211{
212#ifdef CONFIG_PPC64
213 struct mm_struct *mm = parm;
214 unsigned long flags;
215
216 if (mm != current->active_mm)
217 return;
218
219 copy_mm_to_paca(current->active_mm);
220
221 local_irq_save(flags);
222 slb_flush_and_rebolt();
223 local_irq_restore(flags);
224#endif
225}
226
227static void slice_convert(struct mm_struct *mm, 210static void slice_convert(struct mm_struct *mm,
228 const struct slice_mask *mask, int psize) 211 const struct slice_mask *mask, int psize)
229{ 212{
@@ -289,6 +272,9 @@ static void slice_convert(struct mm_struct *mm,
289 spin_unlock_irqrestore(&slice_convert_lock, flags); 272 spin_unlock_irqrestore(&slice_convert_lock, flags);
290 273
291 copro_flush_all_slbs(mm); 274 copro_flush_all_slbs(mm);
275#ifdef CONFIG_PPC64
276 core_flush_all_slbs(mm);
277#endif
292} 278}
293 279
294/* 280/*
@@ -502,8 +488,9 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
502 * be already initialised beyond the old address limit. 488 * be already initialised beyond the old address limit.
503 */ 489 */
504 mm->context.slb_addr_limit = high_limit; 490 mm->context.slb_addr_limit = high_limit;
505 491#ifdef CONFIG_PPC64
506 on_each_cpu(slice_flush_segments, mm, 1); 492 core_flush_all_slbs(mm);
493#endif
507 } 494 }
508 495
509 /* Sanity checks */ 496 /* Sanity checks */
@@ -665,8 +652,10 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
665 (SLICE_NUM_HIGH && 652 (SLICE_NUM_HIGH &&
666 !bitmap_empty(potential_mask.high_slices, SLICE_NUM_HIGH))) { 653 !bitmap_empty(potential_mask.high_slices, SLICE_NUM_HIGH))) {
667 slice_convert(mm, &potential_mask, psize); 654 slice_convert(mm, &potential_mask, psize);
655#ifdef CONFIG_PPC64
668 if (psize > MMU_PAGE_BASE) 656 if (psize > MMU_PAGE_BASE)
669 on_each_cpu(slice_flush_segments, mm, 1); 657 core_flush_all_slbs(mm);
658#endif
670 } 659 }
671 return newaddr; 660 return newaddr;
672 661