From 1348305a129afe22389811e9ac28c4103cc3e7e7 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 31 May 2004 18:48:14 -0700 Subject: [PATCH] [PATCH] ppc64: SLB accounting fix 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 Signed-off-by: Linus Torvalds --- arch/ppc64/kernel/asm-offsets.c | 1 - arch/ppc64/kernel/head.S | 2 -- arch/ppc64/kernel/iSeries_setup.c | 5 ----- arch/ppc64/kernel/prom.c | 7 ------- arch/ppc64/kernel/stab.c | 2 +- arch/ppc64/xmon/xmon.c | 2 +- include/asm-ppc64/naca.h | 2 +- include/asm-ppc64/processor.h | 6 ++++++ 8 files changed, 9 insertions(+), 18 deletions(-) diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c index 98e8d373b1a5d..9368fb0ff4704 100644 --- a/arch/ppc64/kernel/asm-offsets.c +++ b/arch/ppc64/kernel/asm-offsets.c @@ -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 --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 54b053c6851bf..6b22a87d9e404 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S @@ -1123,8 +1123,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 --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c index 96560cdc57a01..3f17d5e253424 100644 --- a/arch/ppc64/kernel/iSeries_setup.c +++ b/arch/ppc64/kernel/iSeries_setup.c @@ -563,11 +563,6 @@ static void __init build_iSeries_Memory_Map(void) 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 --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index 7d28ef6d88a60..a5f8f241895a3 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c @@ -458,13 +458,6 @@ static void __init prom_initialize_naca(void) 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 --git a/arch/ppc64/kernel/stab.c b/arch/ppc64/kernel/stab.c index 6261cc12dc408..2a0873928228e 100644 --- a/arch/ppc64/kernel/stab.c +++ b/arch/ppc64/kernel/stab.c @@ -356,7 +356,7 @@ static void make_slbe(unsigned long esid, unsigned long vsid, int large, * 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 --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index cbb26f6b00844..97b1509acfa96 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c @@ -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 --git a/include/asm-ppc64/naca.h b/include/asm-ppc64/naca.h index a501894024209..3c0b8d3a52627 100644 --- a/include/asm-ppc64/naca.h +++ b/include/asm-ppc64/naca.h @@ -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 --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 64b606aaedbe5..4280809191a54 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -634,4 +634,10 @@ static inline void prefetchw(const void *x) #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 */ -- 2.53.0