diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2005-07-27 14:44:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:25:58 -0400 |
commit | 533f08172e21521a74e15cdef8a13c929596d506 (patch) | |
tree | 60f2117ffb85f61fcdc0e17d864d0114096a4192 /arch/ppc64/kernel | |
parent | 6fdfb382813d66757aef4d83e369f8153a40b371 (diff) |
[PATCH] ppc64: dynamically allocate segment tables
PPC64 machines before Power4 need a segment table page allocated for each
CPU. Currently these are allocated statically in a big array in head.S for
all CPUs. The segment tables need to be in the first segment (so
do_stab_bolted doesn't take a recursive fault on the stab itself), but
other than that there are no constraints which require the stabs for the
secondary CPUs to be statically allocated.
This patch allocates segment tables dynamically during boot, using
lmb_alloc() to ensure they are within the first 256M segment. This reduces
the kernel image size by 192k...
Tested on RS64 iSeries, POWER3 pSeries, and POWER5.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64/kernel')
-rw-r--r-- | arch/ppc64/kernel/head.S | 7 | ||||
-rw-r--r-- | arch/ppc64/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/smp.c | 15 |
3 files changed, 2 insertions, 22 deletions
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 93ebcac0d5a2..3f447712e3ff 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S | |||
@@ -2131,13 +2131,6 @@ empty_zero_page: | |||
2131 | swapper_pg_dir: | 2131 | swapper_pg_dir: |
2132 | .space 4096 | 2132 | .space 4096 |
2133 | 2133 | ||
2134 | #ifdef CONFIG_SMP | ||
2135 | /* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */ | ||
2136 | .globl stab_array | ||
2137 | stab_array: | ||
2138 | .space 4096 * 48 | ||
2139 | #endif | ||
2140 | |||
2141 | /* | 2134 | /* |
2142 | * This space gets a copy of optional info passed to us by the bootstrap | 2135 | * This space gets a copy of optional info passed to us by the bootstrap |
2143 | * Used to pass parameters into the kernel like root=/dev/sda1, etc. | 2136 | * Used to pass parameters into the kernel like root=/dev/sda1, etc. |
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index e80f10c89824..687e85595208 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c | |||
@@ -1068,6 +1068,8 @@ void __init setup_arch(char **cmdline_p) | |||
1068 | irqstack_early_init(); | 1068 | irqstack_early_init(); |
1069 | emergency_stack_init(); | 1069 | emergency_stack_init(); |
1070 | 1070 | ||
1071 | stabs_alloc(); | ||
1072 | |||
1071 | /* set up the bootmem stuff with available memory */ | 1073 | /* set up the bootmem stuff with available memory */ |
1072 | do_init_bootmem(); | 1074 | do_init_bootmem(); |
1073 | sparse_init(); | 1075 | sparse_init(); |
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index 2fcddfcb594d..793b562da653 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c | |||
@@ -65,8 +65,6 @@ struct smp_ops_t *smp_ops; | |||
65 | 65 | ||
66 | static volatile unsigned int cpu_callin_map[NR_CPUS]; | 66 | static volatile unsigned int cpu_callin_map[NR_CPUS]; |
67 | 67 | ||
68 | extern unsigned char stab_array[]; | ||
69 | |||
70 | void smp_call_function_interrupt(void); | 68 | void smp_call_function_interrupt(void); |
71 | 69 | ||
72 | int smt_enabled_at_boot = 1; | 70 | int smt_enabled_at_boot = 1; |
@@ -492,19 +490,6 @@ int __devinit __cpu_up(unsigned int cpu) | |||
492 | 490 | ||
493 | paca[cpu].default_decr = tb_ticks_per_jiffy; | 491 | paca[cpu].default_decr = tb_ticks_per_jiffy; |
494 | 492 | ||
495 | if (!cpu_has_feature(CPU_FTR_SLB)) { | ||
496 | void *tmp; | ||
497 | |||
498 | /* maximum of 48 CPUs on machines with a segment table */ | ||
499 | if (cpu >= 48) | ||
500 | BUG(); | ||
501 | |||
502 | tmp = &stab_array[PAGE_SIZE * cpu]; | ||
503 | memset(tmp, 0, PAGE_SIZE); | ||
504 | paca[cpu].stab_addr = (unsigned long)tmp; | ||
505 | paca[cpu].stab_real = virt_to_abs(tmp); | ||
506 | } | ||
507 | |||
508 | /* Make sure callin-map entry is 0 (can be leftover a CPU | 493 | /* Make sure callin-map entry is 0 (can be leftover a CPU |
509 | * hotplug | 494 | * hotplug |
510 | */ | 495 | */ |