1 From f761622e59433130bc33ad086ce219feee9eb961 Mon Sep 17 00:00:00 2001
2 From: Matt Evans <matt@ozlabs.org>
3 Date: Thu, 12 Aug 2010 20:58:28 +0000
4 Subject: powerpc: Initialise paca->kstack before early_setup_secondary
6 From: Matt Evans <matt@ozlabs.org>
8 commit f761622e59433130bc33ad086ce219feee9eb961 upstream.
10 As early setup calls down to slb_initialize(), we must have kstack
11 initialised before checking "should we add a bolted SLB entry for our kstack?"
13 Failing to do so means stack access requires an SLB miss exception to refill
14 an entry dynamically, if the stack isn't accessible via SLB(0) (kernel text
15 & static data). It's not always allowable to take such a miss, and
16 intermittent crashes will result.
18 Primary CPUs don't have this issue; an SLB entry is not bolted for their
19 stack anyway (as that lives within SLB(0)). This patch therefore only
20 affects the init of secondaries.
22 Signed-off-by: Matt Evans <matt@ozlabs.org>
23 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
27 arch/powerpc/kernel/head_64.S | 6 +++---
28 1 file changed, 3 insertions(+), 3 deletions(-)
30 --- a/arch/powerpc/kernel/head_64.S
31 +++ b/arch/powerpc/kernel/head_64.S
32 @@ -572,9 +572,6 @@ __secondary_start:
33 /* Set thread priority to MEDIUM */
36 - /* Do early setup for that CPU (stab, slb, hash table pointer) */
37 - bl .early_setup_secondary
39 /* Initialize the kernel stack. Just a repeat for iSeries. */
40 LOAD_REG_ADDR(r3, current_set)
41 sldi r28,r24,3 /* get current_set[cpu#] */
42 @@ -582,6 +579,9 @@ __secondary_start:
43 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
46 + /* Do early setup for that CPU (stab, slb, hash table pointer) */
47 + bl .early_setup_secondary
49 /* Clear backchain so we get nice backtraces */