]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/cell: Make spu_flush_all_slbs() generic
authorIan Munsie <imunsie@au1.ibm.com>
Wed, 8 Oct 2014 08:54:52 +0000 (19:54 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 8 Oct 2014 09:15:37 +0000 (20:15 +1100)
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>
arch/powerpc/include/asm/copro.h
arch/powerpc/mm/copro_fault.c
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/slice.c

index b0e6a183181ff90cf1f0548753b1e8f7c8acb398..ce216df313812606eeadb335728cf86cad086d12 100644 (file)
@@ -20,4 +20,10 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
 
 int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb);
 
+
+#ifdef CONFIG_PPC_COPRO_BASE
+void copro_flush_all_slbs(struct mm_struct *mm);
+#else
+static inline void copro_flush_all_slbs(struct mm_struct *mm) {}
+#endif
 #endif /* _ASM_POWERPC_COPRO_H */
index a15a23efc0e29b07668c884247ee808cc75518d1..f2aa5a81ad9c3140ab7abf4e417a5092e567ecbf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/export.h>
 #include <asm/reg.h>
 #include <asm/copro.h>
+#include <asm/spu.h>
 
 /*
  * 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)
        return 0;
 }
 EXPORT_SYMBOL_GPL(copro_calculate_slb);
+
+void copro_flush_all_slbs(struct mm_struct *mm)
+{
+#ifdef CONFIG_SPU_BASE
+       spu_flush_all_slbs(mm);
+#endif
+}
+EXPORT_SYMBOL_GPL(copro_flush_all_slbs);
index dd73b63f947910ee724e2109e2a90dc5ccfc5c11..0842b726b03f0d612e744ff5ba47d33c86d9531a 100644 (file)
@@ -51,7 +51,7 @@
 #include <asm/cacheflush.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
-#include <asm/spu.h>
+#include <asm/copro.h>
 #include <asm/udbg.h>
 #include <asm/code-patching.h>
 #include <asm/fadump.h>
@@ -901,9 +901,7 @@ void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
        if (get_slice_psize(mm, addr) == MMU_PAGE_4K)
                return;
        slice_set_range_psize(mm, addr, 1, MMU_PAGE_4K);
-#ifdef CONFIG_SPU_BASE
-       spu_flush_all_slbs(mm);
-#endif
+       copro_flush_all_slbs(mm);
        if (get_paca_psize(addr) != MMU_PAGE_4K) {
                get_paca()->context = mm->context;
                slb_flush_and_rebolt();
@@ -1141,9 +1139,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
                               "to 4kB pages because of "
                               "non-cacheable mapping\n");
                        psize = mmu_vmalloc_psize = MMU_PAGE_4K;
-#ifdef CONFIG_SPU_BASE
-                       spu_flush_all_slbs(mm);
-#endif
+                       copro_flush_all_slbs(mm);
                }
        }
 
index 86f6a755af0bbe80c7821755f75a9a54854adfc6..8d7bda94d1969b2325073315875a05545922b0fc 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/hugetlb.h>
 #include <asm/mman.h>
 #include <asm/mmu.h>
-#include <asm/spu.h>
+#include <asm/copro.h>
 #include <asm/hugetlb.h>
 
 /* some sanity checks */
@@ -234,9 +234,7 @@ static void slice_convert(struct mm_struct *mm, struct slice_mask mask, int psiz
 
        spin_unlock_irqrestore(&slice_convert_lock, flags);
 
-#ifdef CONFIG_SPU_BASE
-       spu_flush_all_slbs(mm);
-#endif
+       copro_flush_all_slbs(mm);
 }
 
 /*
@@ -673,9 +671,7 @@ void slice_set_psize(struct mm_struct *mm, unsigned long address,
 
        spin_unlock_irqrestore(&slice_convert_lock, flags);
 
-#ifdef CONFIG_SPU_BASE
-       spu_flush_all_slbs(mm);
-#endif
+       copro_flush_all_slbs(mm);
 }
 
 void slice_set_range_psize(struct mm_struct *mm, unsigned long start,