Skip to content

Commit 3160b09

Browse files
Becky Brucekumargala
authored andcommitted
powerpc: Create next_tlbcam_idx percpu variable for FSL_BOOKE
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>
1 parent f6ad160 commit 3160b09

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎arch/powerpc/include/asm/mmu.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@
115115
#ifndef __ASSEMBLY__
116116
#include <asm/cputable.h>
117117

118+
#ifdef CONFIG_PPC_FSL_BOOK3E
119+
#include <asm/percpu.h>
120+
DECLARE_PER_CPU(int, next_tlbcam_idx);
121+
#endif
122+
118123
static inline int mmu_has_feature(unsigned long feature)
119124
{
120125
return (cur_cpu_spec->mmu_features & feature);

‎arch/powerpc/kernel/smp.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ struct thread_info *current_set[NR_CPUS];
305305
static void __devinit smp_store_cpu_info(int id)
306306
{
307307
per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR);
308+
#ifdef CONFIG_PPC_FSL_BOOK3E
309+
per_cpu(next_tlbcam_idx, id)
310+
= (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
311+
#endif
308312
}
309313

310314
void __init smp_prepare_cpus(unsigned int max_cpus)

‎arch/powerpc/mm/mem.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ void __init mem_init(void)
353353
}
354354
#endif /* CONFIG_HIGHMEM */
355355

356+
#if defined(CONFIG_PPC_FSL_BOOK3E) && !defined(CONFIG_SMP)
357+
/*
358+
* If smp is enabled, next_tlbcam_idx is initialized in the cpu up
359+
* functions.... do it here for the non-smp case.
360+
*/
361+
per_cpu(next_tlbcam_idx, smp_processor_id()) =
362+
(mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
363+
#endif
364+
356365
printk(KERN_INFO "Memory: %luk/%luk available (%luk kernel code, "
357366
"%luk reserved, %luk data, %luk bss, %luk init)\n",
358367
nr_free_pages() << (PAGE_SHIFT-10),

‎arch/powerpc/mm/tlb_nohash.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ unsigned long linear_map_top; /* Top of linear mapping */
102102

103103
#endif /* CONFIG_PPC64 */
104104

105+
#ifdef CONFIG_PPC_FSL_BOOK3E
106+
/* next_tlbcam_idx is used to round-robin tlbcam entry assignment */
107+
DEFINE_PER_CPU(int, next_tlbcam_idx);
108+
EXPORT_PER_CPU_SYMBOL(next_tlbcam_idx);
109+
#endif
110+
105111
/*
106112
* Base TLB flushing operations:
107113
*

0 commit comments

Comments
 (0)