]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.35.8/powerpc-initialise-paca-kstack-before-early_setup_secondary.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.35.8 / powerpc-initialise-paca-kstack-before-early_setup_secondary.patch
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
5
6 From: Matt Evans <matt@ozlabs.org>
7
8 commit f761622e59433130bc33ad086ce219feee9eb961 upstream.
9
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?"
12
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.
17
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.
21
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>
25
26 ---
27 arch/powerpc/kernel/head_64.S | 6 +++---
28 1 file changed, 3 insertions(+), 3 deletions(-)
29
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 */
34 HMT_MEDIUM
35
36 - /* Do early setup for that CPU (stab, slb, hash table pointer) */
37 - bl .early_setup_secondary
38 -
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
44 std r1,PACAKSAVE(r13)
45
46 + /* Do early setup for that CPU (stab, slb, hash table pointer) */
47 + bl .early_setup_secondary
48 +
49 /* Clear backchain so we get nice backtraces */
50 li r7,0
51 mtlr r7