aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2014-10-08 04:54:52 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2014-10-08 05:15:37 -0400
commitbe3ebfe8215392b714349554c5138b8b6592fe20 (patch)
tree7030d8385c98edb8fa926ab9686b5ece3506958f /arch
parent73d16a6e0e51990cbe13f8d8f43bd5329bbab30a (diff)
powerpc/cell: Make spu_flush_all_slbs() generic
This moves spu_flush_all_slbs() into a generic call copro_flush_all_slbs(). This will be useful when we add cxl which also needs a similar SLB flush call. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/copro.h6
-rw-r--r--arch/powerpc/mm/copro_fault.c9
-rw-r--r--arch/powerpc/mm/hash_utils_64.c10
-rw-r--r--arch/powerpc/mm/slice.c10
4 files changed, 21 insertions, 14 deletions
diff --git a/arch/powerpc/include/asm/copro.h b/arch/powerpc/include/asm/copro.h
index b0e6a183181f..ce216df31381 100644
--- a/arch/powerpc/include/asm/copro.h
+++ b/arch/powerpc/include/asm/copro.h
@@ -20,4 +20,10 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
20 20
21int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb); 21int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb);
22 22
23
24#ifdef CONFIG_PPC_COPRO_BASE
25void copro_flush_all_slbs(struct mm_struct *mm);
26#else
27static inline void copro_flush_all_slbs(struct mm_struct *mm) {}
28#endif
23#endif /* _ASM_POWERPC_COPRO_H */ 29#endif /* _ASM_POWERPC_COPRO_H */
diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c
index a15a23efc0e2..f2aa5a81ad9c 100644
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c
@@ -25,6 +25,7 @@
25#include <linux/export.h> 25#include <linux/export.h>
26#include <asm/reg.h> 26#include <asm/reg.h>
27#include <asm/copro.h> 27#include <asm/copro.h>
28#include <asm/spu.h>
28 29
29/* 30/*
30 * This ought to be kept in sync with the powerpc specific do_page_fault 31 * This ought to be kept in sync with the powerpc specific do_page_fault
@@ -136,3 +137,11 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
136 return 0; 137 return 0;
137} 138}
138EXPORT_SYMBOL_GPL(copro_calculate_slb); 139EXPORT_SYMBOL_GPL(copro_calculate_slb);
140
141void copro_flush_all_slbs(struct mm_struct *mm)
142{
143#ifdef CONFIG_SPU_BASE
144 spu_flush_all_slbs(mm);
145#endif
146}
147EXPORT_SYMBOL_GPL(copro_flush_all_slbs);
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index dd73b63f9479..0842b726b03f 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -51,7 +51,7 @@
51#include <asm/cacheflush.h> 51#include <asm/cacheflush.h>
52#include <asm/cputable.h> 52#include <asm/cputable.h>
53#include <asm/sections.h> 53#include <asm/sections.h>
54#include <asm/spu.h> 54#include <asm/copro.h>
55#include <asm/udbg.h> 55#include <asm/udbg.h>
56#include <asm/code-patching.h> 56#include <asm/code-patching.h>
57#include <asm/fadump.h> 57#include <asm/fadump.h>
@@ -901,9 +901,7 @@ void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
901 if (get_slice_psize(mm, addr) == MMU_PAGE_4K) 901 if (get_slice_psize(mm, addr) == MMU_PAGE_4K)
902 return; 902 return;
903 slice_set_range_psize(mm, addr, 1, MMU_PAGE_4K); 903 slice_set_range_psize(mm, addr, 1, MMU_PAGE_4K);
904#ifdef CONFIG_SPU_BASE 904 copro_flush_all_slbs(mm);
905 spu_flush_all_slbs(mm);
906#endif
907 if (get_paca_psize(addr) != MMU_PAGE_4K) { 905 if (get_paca_psize(addr) != MMU_PAGE_4K) {
908 get_paca()->context = mm->context; 906 get_paca()->context = mm->context;
909 slb_flush_and_rebolt(); 907 slb_flush_and_rebolt();
@@ -1141,9 +1139,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
1141 "to 4kB pages because of " 1139 "to 4kB pages because of "
1142 "non-cacheable mapping\n"); 1140 "non-cacheable mapping\n");
1143 psize = mmu_vmalloc_psize = MMU_PAGE_4K; 1141 psize = mmu_vmalloc_psize = MMU_PAGE_4K;
1144#ifdef CONFIG_SPU_BASE 1142 copro_flush_all_slbs(mm);
1145 spu_flush_all_slbs(mm);
1146#endif
1147 } 1143 }
1148 } 1144 }
1149 1145
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 86f6a755af0b..8d7bda94d196 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -33,7 +33,7 @@
33#include <linux/hugetlb.h> 33#include <linux/hugetlb.h>
34#include <asm/mman.h> 34#include <asm/mman.h>
35#include <asm/mmu.h> 35#include <asm/mmu.h>
36#include <asm/spu.h> 36#include <asm/copro.h>
37#include <asm/hugetlb.h> 37#include <asm/hugetlb.h>
38 38
39/* some sanity checks */ 39/* some sanity checks */
@@ -234,9 +234,7 @@ static void slice_convert(struct mm_struct *mm, struct slice_mask mask, int psiz
234 234
235 spin_unlock_irqrestore(&slice_convert_lock, flags); 235 spin_unlock_irqrestore(&slice_convert_lock, flags);
236 236
237#ifdef CONFIG_SPU_BASE 237 copro_flush_all_slbs(mm);
238 spu_flush_all_slbs(mm);
239#endif
240} 238}
241 239
242/* 240/*
@@ -673,9 +671,7 @@ void slice_set_psize(struct mm_struct *mm, unsigned long address,
673 671
674 spin_unlock_irqrestore(&slice_convert_lock, flags); 672 spin_unlock_irqrestore(&slice_convert_lock, flags);
675 673
676#ifdef CONFIG_SPU_BASE 674 copro_flush_all_slbs(mm);
677 spu_flush_all_slbs(mm);
678#endif
679} 675}
680 676
681void slice_set_range_psize(struct mm_struct *mm, unsigned long start, 677void slice_set_range_psize(struct mm_struct *mm, unsigned long start,