From: Anton Blanchard Even though we have a variable containing the number of entries in the SLB, we hardwire the value at boot. We also dont use the variable in the head.S fastpath handler. This patch removes it. Signed-off-by: Anton Blanchard Signed-off-by: Andrew Morton --- 25-akpm/arch/ppc64/kernel/asm-offsets.c | 1 - 25-akpm/arch/ppc64/kernel/head.S | 2 -- 25-akpm/arch/ppc64/kernel/iSeries_setup.c | 5 ----- 25-akpm/arch/ppc64/kernel/prom.c | 7 ------- 25-akpm/arch/ppc64/kernel/stab.c | 2 +- 25-akpm/arch/ppc64/xmon/xmon.c | 2 +- 25-akpm/include/asm-ppc64/naca.h | 2 +- 25-akpm/include/asm-ppc64/processor.h | 6 ++++++ 8 files changed, 9 insertions(+), 18 deletions(-) diff -puN arch/ppc64/kernel/asm-offsets.c~ppc64-slb-accounting-fix arch/ppc64/kernel/asm-offsets.c --- 25/arch/ppc64/kernel/asm-offsets.c~ppc64-slb-accounting-fix 2004-05-31 17:04:28.982866016 -0700 +++ 25-akpm/arch/ppc64/kernel/asm-offsets.c 2004-05-31 17:04:28.996863888 -0700 @@ -73,7 +73,6 @@ int main(void) DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize)); DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize)); DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage)); - DEFINE(SLBSIZE, offsetof(struct naca_struct, slb_size)); DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); /* paca */ diff -puN arch/ppc64/kernel/head.S~ppc64-slb-accounting-fix arch/ppc64/kernel/head.S --- 25/arch/ppc64/kernel/head.S~ppc64-slb-accounting-fix 2004-05-31 17:04:28.984865712 -0700 +++ 25-akpm/arch/ppc64/kernel/head.S 2004-05-31 17:04:28.998863584 -0700 @@ -1124,8 +1124,6 @@ _GLOBAL(do_slb_bolted) */ /* r20 = paca */ - /* use a cpu feature mask if we ever change our slb size */ -SLB_NUM_ENTRIES = 64 1: ld r22,PACASTABRR(r20) addi r21,r22,1 cmpdi r21,SLB_NUM_ENTRIES diff -puN arch/ppc64/kernel/iSeries_setup.c~ppc64-slb-accounting-fix arch/ppc64/kernel/iSeries_setup.c --- 25/arch/ppc64/kernel/iSeries_setup.c~ppc64-slb-accounting-fix 2004-05-31 17:04:28.986865408 -0700 +++ 25-akpm/arch/ppc64/kernel/iSeries_setup.c 2004-05-31 17:04:28.999863432 -0700 @@ -563,11 +563,6 @@ static void __init build_iSeries_Memory_ lmb_add(0, systemcfg->physicalMemorySize); lmb_analyze(); /* ?? */ lmb_reserve(0, __pa(klimit)); - - /* - * Hardcode to GP size. I am not sure where to get this info. DRENG - */ - naca->slb_size = 64; } /* diff -puN arch/ppc64/kernel/prom.c~ppc64-slb-accounting-fix arch/ppc64/kernel/prom.c --- 25/arch/ppc64/kernel/prom.c~ppc64-slb-accounting-fix 2004-05-31 17:04:28.988865104 -0700 +++ 25-akpm/arch/ppc64/kernel/prom.c 2004-05-31 17:04:29.002862976 -0700 @@ -458,13 +458,6 @@ static void __init prom_initialize_naca( PROM_BUG(); } - /* - * Hardcode to GP size. I am not sure where to get this info - * in general, as there does not appear to be a slb-size OF - * entry. At least in Condor and earlier. DRENG - */ - _naca->slb_size = 64; - /* Add an eye catcher and the systemcfg layout version number */ strcpy(_systemcfg->eye_catcher, RELOC("SYSTEMCFG:PPC64")); _systemcfg->version.major = SYSTEMCFG_MAJOR; diff -puN arch/ppc64/kernel/stab.c~ppc64-slb-accounting-fix arch/ppc64/kernel/stab.c --- 25/arch/ppc64/kernel/stab.c~ppc64-slb-accounting-fix 2004-05-31 17:04:28.989864952 -0700 +++ 25-akpm/arch/ppc64/kernel/stab.c 2004-05-31 17:04:29.003862824 -0700 @@ -356,7 +356,7 @@ static void make_slbe(unsigned long esid * We bolt in the first kernel segment and the first * vmalloc segment. */ - if (castout_entry >= naca->slb_size) + if (castout_entry >= SLB_NUM_ENTRIES) castout_entry = 2; asm volatile("slbmfee %0,%1" : "=r" (esid_data) : "r" (entry)); } while (esid_data.data.v && diff -puN arch/ppc64/xmon/xmon.c~ppc64-slb-accounting-fix arch/ppc64/xmon/xmon.c --- 25/arch/ppc64/xmon/xmon.c~ppc64-slb-accounting-fix 2004-05-31 17:04:28.991864648 -0700 +++ 25-akpm/arch/ppc64/xmon/xmon.c 2004-05-31 17:04:29.004862672 -0700 @@ -2512,7 +2512,7 @@ static void dump_slb(void) printf("SLB contents of cpu %x\n", smp_processor_id()); - for (i = 0; i < naca->slb_size; i++) { + for (i = 0; i < SLB_NUM_ENTRIES; i++) { asm volatile("slbmfee %0,%1" : "=r" (tmp) : "r" (i)); printf("%02d %016lx ", i, tmp); diff -puN include/asm-ppc64/naca.h~ppc64-slb-accounting-fix include/asm-ppc64/naca.h --- 25/include/asm-ppc64/naca.h~ppc64-slb-accounting-fix 2004-05-31 17:04:28.992864496 -0700 +++ 25-akpm/include/asm-ppc64/naca.h 2004-05-31 17:04:29.005862520 -0700 @@ -30,7 +30,7 @@ struct naca_struct { u64 log; /* Ptr to log buffer 0x30 */ u64 serialPortAddr; /* Phy addr of serial port 0x38 */ u64 interrupt_controller; /* Type of int controller 0x40 */ - u64 slb_size; /* SLB size in entries 0x48 */ + u64 unused1; /* was SLB size in entries 0x48 */ u64 pftSize; /* Log 2 of page table size 0x50 */ void *systemcfg; /* Pointer to systemcfg data 0x58 */ u32 dCacheL1LogLineSize; /* L1 d-cache line size Log2 0x60 */ diff -puN include/asm-ppc64/processor.h~ppc64-slb-accounting-fix include/asm-ppc64/processor.h --- 25/include/asm-ppc64/processor.h~ppc64-slb-accounting-fix 2004-05-31 17:04:28.993864344 -0700 +++ 25-akpm/include/asm-ppc64/processor.h 2004-05-31 17:04:29.006862368 -0700 @@ -634,4 +634,10 @@ static inline void prefetchw(const void #endif /* ASSEMBLY */ +/* + * Number of entries in the SLB. If this ever changes we should handle + * it with a use a cpu feature fixup. + */ +#define SLB_NUM_ENTRIES 64 + #endif /* __ASM_PPC64_PROCESSOR_H */ _