aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-01-31 20:13:09 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-19 21:03:24 -0400
commitad0693ee722b93b63a89c845e99513f242e43aa6 (patch)
tree994d7ef63c3356e3dc90372a2abe961430769a29 /arch/powerpc/kernel/head_64.S
parentb144871cb5f2c268e94258ae8f1ec810db2e1120 (diff)
powerpc: Call CPU ->restore callback earlier on secondary CPUs
We do it before we loop on the PACA start flag. This way, we get a chance to set critical SPRs on all CPUs before Linux tries to start them up, which avoids problems when changing some bits such as LPCR bits that need to be identical on all threads of a core or similar things like that. Ideally, some of that should also be done before the MMU is enabled, but that's a separate issue which would require moving some of the SMP startup code earlier, let's not get there for now, it works with that change alone. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 39a40400f3f2..95944278380c 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -236,17 +236,6 @@ generic_secondary_common_init:
236 236
237 /* From now on, r24 is expected to be logical cpuid */ 237 /* From now on, r24 is expected to be logical cpuid */
238 mr r24,r5 238 mr r24,r5
2393: HMT_LOW
240 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */
241 /* start. */
242
243#ifndef CONFIG_SMP
244 b 3b /* Never go on non-SMP */
245#else
246 cmpwi 0,r23,0
247 beq 3b /* Loop until told to go */
248
249 sync /* order paca.run and cur_cpu_spec */
250 239
251 /* See if we need to call a cpu state restore handler */ 240 /* See if we need to call a cpu state restore handler */
252 LOAD_REG_ADDR(r23, cur_cpu_spec) 241 LOAD_REG_ADDR(r23, cur_cpu_spec)
@@ -258,6 +247,17 @@ generic_secondary_common_init:
258 mtctr r23 247 mtctr r23
259 bctrl 248 bctrl
260 249
2503: HMT_LOW
251 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */
252 /* start. */
253#ifndef CONFIG_SMP
254 b 3b /* Never go on non-SMP */
255#else
256 cmpwi 0,r23,0
257 beq 3b /* Loop until told to go */
258
259 sync /* order paca.run and cur_cpu_spec */
260
2614: /* Create a temp kernel stack for use before relocation is on. */ 2614: /* Create a temp kernel stack for use before relocation is on. */
262 ld r1,PACAEMERGSP(r13) 262 ld r1,PACAEMERGSP(r13)
263 subi r1,r1,STACK_FRAME_OVERHEAD 263 subi r1,r1,STACK_FRAME_OVERHEAD