]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc: Create next_tlbcam_idx percpu variable for FSL_BOOKE
authorBecky Bruce <beckyb@kernel.crashing.org>
Tue, 28 Jun 2011 19:54:47 +0000 (14:54 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 8 Jul 2011 05:21:34 +0000 (00:21 -0500)
This is used to round-robin TLBCAM entries.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/include/asm/mmu.h
arch/powerpc/kernel/smp.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/tlb_nohash.c

index 4138b21ae80afeb216da9cf6b7ab1e5ca8247a3a..b427a55ce2ab3a1b420171dcffa7c4d8365e1d12 100644 (file)
 #ifndef __ASSEMBLY__
 #include <asm/cputable.h>
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+#include <asm/percpu.h>
+DECLARE_PER_CPU(int, next_tlbcam_idx);
+#endif
+
 static inline int mmu_has_feature(unsigned long feature)
 {
        return (cur_cpu_spec->mmu_features & feature);
index 6c8e739a12da3f2d598032b65285204a1b19cf74..567a1746ed74225f9c842bf54c907a5ceb40bf3a 100644 (file)
@@ -305,6 +305,10 @@ struct thread_info *current_set[NR_CPUS];
 static void __devinit smp_store_cpu_info(int id)
 {
        per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR);
+#ifdef CONFIG_PPC_FSL_BOOK3E
+       per_cpu(next_tlbcam_idx, id)
+               = (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
+#endif
 }
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
index a3841bb75cbb002d7d5068da1e382deadf1ea664..457dc84154ba7b0bcea693b7c883c90fbf0fd25c 100644 (file)
@@ -353,6 +353,15 @@ void __init mem_init(void)
        }
 #endif /* CONFIG_HIGHMEM */
 
+#if defined(CONFIG_PPC_FSL_BOOK3E) && !defined(CONFIG_SMP)
+       /*
+        * If smp is enabled, next_tlbcam_idx is initialized in the cpu up
+        * functions.... do it here for the non-smp case.
+        */
+       per_cpu(next_tlbcam_idx, smp_processor_id()) =
+               (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
+#endif
+
        printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
               "%luk reserved, %luk data, %luk bss, %luk init)\n",
                nr_free_pages() << (PAGE_SHIFT-10),
index 3722185d1865eac30a8f7c0ffd7edb624fa906a2..e80ed1093e2fb20ccdb22ced64c02460e08597e3 100644 (file)
@@ -102,6 +102,12 @@ unsigned long linear_map_top;      /* Top of linear mapping */
 
 #endif /* CONFIG_PPC64 */
 
+#ifdef CONFIG_PPC_FSL_BOOK3E
+/* next_tlbcam_idx is used to round-robin tlbcam entry assignment */
+DEFINE_PER_CPU(int, next_tlbcam_idx);
+EXPORT_PER_CPU_SYMBOL(next_tlbcam_idx);
+#endif
+
 /*
  * Base TLB flushing operations:
  *