]>
Commit | Line | Data |
---|---|---|
1b91d6c3 GKH |
1 | From 54a834043314c257210db2a9d59f8cc605571639 Mon Sep 17 00:00:00 2001 |
2 | From: Michael Neuling <mikey@neuling.org> | |
3 | Date: Wed, 25 Aug 2010 21:04:25 +0000 | |
4 | Subject: powerpc: Don't use kernel stack with translation off | |
5 | ||
6 | From: Michael Neuling <mikey@neuling.org> | |
7 | ||
8 | commit 54a834043314c257210db2a9d59f8cc605571639 upstream. | |
9 | ||
10 | In f761622e59433130bc33ad086ce219feee9eb961 we changed | |
11 | early_setup_secondary so it's called using the proper kernel stack | |
12 | rather than the emergency one. | |
13 | ||
14 | Unfortunately, this stack pointer can't be used when translation is off | |
15 | on PHYP as this stack pointer might be outside the RMO. This results in | |
16 | the following on all non zero cpus: | |
17 | cpu 0x1: Vector: 300 (Data Access) at [c00000001639fd10] | |
18 | pc: 000000000001c50c | |
19 | lr: 000000000000821c | |
20 | sp: c00000001639ff90 | |
21 | msr: 8000000000001000 | |
22 | dar: c00000001639ffa0 | |
23 | dsisr: 42000000 | |
24 | current = 0xc000000016393540 | |
25 | paca = 0xc000000006e00200 | |
26 | pid = 0, comm = swapper | |
27 | ||
28 | The original patch was only tested on bare metal system, so it never | |
29 | caught this problem. | |
30 | ||
31 | This changes __secondary_start so that we calculate the new stack | |
32 | pointer but only start using it after we've called early_setup_secondary. | |
33 | ||
34 | With this patch, the above problem goes away. | |
35 | ||
36 | Signed-off-by: Michael Neuling <mikey@neuling.org> | |
37 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> | |
38 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
39 | ||
40 | --- | |
41 | arch/powerpc/kernel/head_64.S | 12 +++++++++--- | |
42 | 1 file changed, 9 insertions(+), 3 deletions(-) | |
43 | ||
44 | --- a/arch/powerpc/kernel/head_64.S | |
45 | +++ b/arch/powerpc/kernel/head_64.S | |
46 | @@ -575,13 +575,19 @@ __secondary_start: | |
47 | /* Initialize the kernel stack. Just a repeat for iSeries. */ | |
48 | LOAD_REG_ADDR(r3, current_set) | |
49 | sldi r28,r24,3 /* get current_set[cpu#] */ | |
50 | - ldx r1,r3,r28 | |
51 | - addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD | |
52 | - std r1,PACAKSAVE(r13) | |
53 | + ldx r14,r3,r28 | |
54 | + addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD | |
55 | + std r14,PACAKSAVE(r13) | |
56 | ||
57 | /* Do early setup for that CPU (stab, slb, hash table pointer) */ | |
58 | bl .early_setup_secondary | |
59 | ||
60 | + /* | |
61 | + * setup the new stack pointer, but *don't* use this until | |
62 | + * translation is on. | |
63 | + */ | |
64 | + mr r1, r14 | |
65 | + | |
66 | /* Clear backchain so we get nice backtraces */ | |
67 | li r7,0 | |
68 | mtlr r7 |