diff options
author | Tony Breeds <tony@bakeyournoodle.com> | 2008-04-23 23:43:49 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-24 06:58:04 -0400 |
commit | 90035fe378c7459ba19c43c63d5f878284224ce4 (patch) | |
tree | e6daaaf5d9b0e2d077105e9263399f5f09f2c633 /arch | |
parent | 9cb82f2f4692293a27c578c3038518ce4477de72 (diff) |
[POWERPC] Raise the upper limit of NR_CPUS and move the pacas into the BSS
This adds the required functionality to fill in all pacas at runtime.
With NR_CPUS=1024
text data bss dec hex filename
137 1704032 0 1704169 1a00e9 arch/powerpc/kernel/paca.o :Before
121 1179744 524288 1704153 1a00d9 arch/powerpc/kernel/paca.o :After
Also remove unneeded #includes from arch/powerpc/kernel/paca.c
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/paca.c | 87 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 4 |
3 files changed, 30 insertions, 64 deletions
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index ac163bd46cfd..c9bf17eec31b 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -7,17 +7,11 @@ | |||
7 | * 2 of the License, or (at your option) any later version. | 7 | * 2 of the License, or (at your option) any later version. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/types.h> | ||
11 | #include <linux/threads.h> | 10 | #include <linux/threads.h> |
12 | #include <linux/module.h> | 11 | #include <linux/module.h> |
13 | 12 | ||
14 | #include <asm/processor.h> | ||
15 | #include <asm/ptrace.h> | ||
16 | #include <asm/page.h> | ||
17 | #include <asm/lppaca.h> | 13 | #include <asm/lppaca.h> |
18 | #include <asm/paca.h> | 14 | #include <asm/paca.h> |
19 | #include <asm/mmu.h> | ||
20 | |||
21 | 15 | ||
22 | /* This symbol is provided by the linker - let it fill in the paca | 16 | /* This symbol is provided by the linker - let it fill in the paca |
23 | * field correctly */ | 17 | * field correctly */ |
@@ -65,60 +59,29 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = { | |||
65 | * processors. The processor VPD array needs one entry per physical | 59 | * processors. The processor VPD array needs one entry per physical |
66 | * processor (not thread). | 60 | * processor (not thread). |
67 | */ | 61 | */ |
68 | #define PACA_INIT(number) \ | 62 | struct paca_struct paca[NR_CPUS]; |
69 | { \ | ||
70 | .lppaca_ptr = &lppaca[number], \ | ||
71 | .lock_token = 0x8000, \ | ||
72 | .paca_index = (number), /* Paca Index */ \ | ||
73 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ | ||
74 | .hw_cpu_id = 0xffff, \ | ||
75 | .slb_shadow_ptr = &slb_shadow[number], \ | ||
76 | .__current = &init_task, \ | ||
77 | } | ||
78 | |||
79 | struct paca_struct paca[] = { | ||
80 | PACA_INIT(0), | ||
81 | #if NR_CPUS > 1 | ||
82 | PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3), | ||
83 | #if NR_CPUS > 4 | ||
84 | PACA_INIT( 4), PACA_INIT( 5), PACA_INIT( 6), PACA_INIT( 7), | ||
85 | #if NR_CPUS > 8 | ||
86 | PACA_INIT( 8), PACA_INIT( 9), PACA_INIT( 10), PACA_INIT( 11), | ||
87 | PACA_INIT( 12), PACA_INIT( 13), PACA_INIT( 14), PACA_INIT( 15), | ||
88 | PACA_INIT( 16), PACA_INIT( 17), PACA_INIT( 18), PACA_INIT( 19), | ||
89 | PACA_INIT( 20), PACA_INIT( 21), PACA_INIT( 22), PACA_INIT( 23), | ||
90 | PACA_INIT( 24), PACA_INIT( 25), PACA_INIT( 26), PACA_INIT( 27), | ||
91 | PACA_INIT( 28), PACA_INIT( 29), PACA_INIT( 30), PACA_INIT( 31), | ||
92 | #if NR_CPUS > 32 | ||
93 | PACA_INIT( 32), PACA_INIT( 33), PACA_INIT( 34), PACA_INIT( 35), | ||
94 | PACA_INIT( 36), PACA_INIT( 37), PACA_INIT( 38), PACA_INIT( 39), | ||
95 | PACA_INIT( 40), PACA_INIT( 41), PACA_INIT( 42), PACA_INIT( 43), | ||
96 | PACA_INIT( 44), PACA_INIT( 45), PACA_INIT( 46), PACA_INIT( 47), | ||
97 | PACA_INIT( 48), PACA_INIT( 49), PACA_INIT( 50), PACA_INIT( 51), | ||
98 | PACA_INIT( 52), PACA_INIT( 53), PACA_INIT( 54), PACA_INIT( 55), | ||
99 | PACA_INIT( 56), PACA_INIT( 57), PACA_INIT( 58), PACA_INIT( 59), | ||
100 | PACA_INIT( 60), PACA_INIT( 61), PACA_INIT( 62), PACA_INIT( 63), | ||
101 | #if NR_CPUS > 64 | ||
102 | PACA_INIT( 64), PACA_INIT( 65), PACA_INIT( 66), PACA_INIT( 67), | ||
103 | PACA_INIT( 68), PACA_INIT( 69), PACA_INIT( 70), PACA_INIT( 71), | ||
104 | PACA_INIT( 72), PACA_INIT( 73), PACA_INIT( 74), PACA_INIT( 75), | ||
105 | PACA_INIT( 76), PACA_INIT( 77), PACA_INIT( 78), PACA_INIT( 79), | ||
106 | PACA_INIT( 80), PACA_INIT( 81), PACA_INIT( 82), PACA_INIT( 83), | ||
107 | PACA_INIT( 84), PACA_INIT( 85), PACA_INIT( 86), PACA_INIT( 87), | ||
108 | PACA_INIT( 88), PACA_INIT( 89), PACA_INIT( 90), PACA_INIT( 91), | ||
109 | PACA_INIT( 92), PACA_INIT( 93), PACA_INIT( 94), PACA_INIT( 95), | ||
110 | PACA_INIT( 96), PACA_INIT( 97), PACA_INIT( 98), PACA_INIT( 99), | ||
111 | PACA_INIT(100), PACA_INIT(101), PACA_INIT(102), PACA_INIT(103), | ||
112 | PACA_INIT(104), PACA_INIT(105), PACA_INIT(106), PACA_INIT(107), | ||
113 | PACA_INIT(108), PACA_INIT(109), PACA_INIT(110), PACA_INIT(111), | ||
114 | PACA_INIT(112), PACA_INIT(113), PACA_INIT(114), PACA_INIT(115), | ||
115 | PACA_INIT(116), PACA_INIT(117), PACA_INIT(118), PACA_INIT(119), | ||
116 | PACA_INIT(120), PACA_INIT(121), PACA_INIT(122), PACA_INIT(123), | ||
117 | PACA_INIT(124), PACA_INIT(125), PACA_INIT(126), PACA_INIT(127), | ||
118 | #endif | ||
119 | #endif | ||
120 | #endif | ||
121 | #endif | ||
122 | #endif | ||
123 | }; | ||
124 | EXPORT_SYMBOL(paca); | 63 | EXPORT_SYMBOL(paca); |
64 | |||
65 | void __init initialise_pacas(void) | ||
66 | { | ||
67 | int cpu; | ||
68 | |||
69 | /* The TOC register (GPR2) points 32kB into the TOC, so that 64kB | ||
70 | * of the TOC can be addressed using a single machine instruction. | ||
71 | */ | ||
72 | unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL; | ||
73 | |||
74 | /* Can't use for_each_*_cpu, as they aren't functional yet */ | ||
75 | for (cpu = 0; cpu < NR_CPUS; cpu++) { | ||
76 | struct paca_struct *new_paca = &paca[cpu]; | ||
77 | |||
78 | new_paca->lppaca_ptr = &lppaca[cpu]; | ||
79 | new_paca->lock_token = 0x8000; | ||
80 | new_paca->paca_index = cpu; | ||
81 | new_paca->kernel_toc = kernel_toc; | ||
82 | new_paca->hw_cpu_id = 0xffff; | ||
83 | new_paca->slb_shadow_ptr = &slb_shadow[cpu]; | ||
84 | new_paca->__current = &init_task; | ||
85 | |||
86 | } | ||
87 | } | ||
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 153a48dc8f40..dff6308d1b5e 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -170,6 +170,9 @@ void __init setup_paca(int cpu) | |||
170 | 170 | ||
171 | void __init early_setup(unsigned long dt_ptr) | 171 | void __init early_setup(unsigned long dt_ptr) |
172 | { | 172 | { |
173 | /* Fill in any unititialised pacas */ | ||
174 | initialise_pacas(); | ||
175 | |||
173 | /* Identify CPU type */ | 176 | /* Identify CPU type */ |
174 | identify_cpu(0, mfspr(SPRN_PVR)); | 177 | identify_cpu(0, mfspr(SPRN_PVR)); |
175 | 178 | ||
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 5fc7fac10e93..f7efaa925a13 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -220,8 +220,8 @@ config SMP | |||
220 | If you don't know what to do here, say N. | 220 | If you don't know what to do here, say N. |
221 | 221 | ||
222 | config NR_CPUS | 222 | config NR_CPUS |
223 | int "Maximum number of CPUs (2-128)" | 223 | int "Maximum number of CPUs (2-1024)" |
224 | range 2 128 | 224 | range 2 1024 |
225 | depends on SMP | 225 | depends on SMP |
226 | default "32" if PPC64 | 226 | default "32" if PPC64 |
227 | default "4" | 227 | default "4" |