diff options
author | Matt Evans <matt@ozlabs.org> | 2010-07-07 17:55:37 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-07-31 00:56:30 -0400 |
commit | fc53b4202e61c7e9008c241933ae282aab8a6082 (patch) | |
tree | c279a5256ba18a27ca0b785ecf6819f592a23509 /arch/powerpc/kernel/paca.c | |
parent | 7e3f36c3e107bd76b6709e358b1e7c703fb6f81a (diff) |
powerpc/kexec: Switch to a static PACA on the way out
With dynamic PACAs, the kexecing CPU's PACA won't lie within the kernel
static data and there is a chance that something may stomp it when preparing
to kexec. This patch switches this final CPU to a static PACA just before
we pull the switch.
Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/paca.c')
-rw-r--r-- | arch/powerpc/kernel/paca.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index f88acf0218db..3db8d64f40e1 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -105,6 +105,16 @@ void __init initialise_paca(struct paca_struct *new_paca, int cpu) | |||
105 | #endif /* CONFIG_PPC_STD_MMU_64 */ | 105 | #endif /* CONFIG_PPC_STD_MMU_64 */ |
106 | } | 106 | } |
107 | 107 | ||
108 | /* Put the paca pointer into r13 and SPRG_PACA */ | ||
109 | void setup_paca(struct paca_struct *new_paca) | ||
110 | { | ||
111 | local_paca = new_paca; | ||
112 | mtspr(SPRN_SPRG_PACA, local_paca); | ||
113 | #ifdef CONFIG_PPC_BOOK3E | ||
114 | mtspr(SPRN_SPRG_TLB_EXFRAME, local_paca->extlb); | ||
115 | #endif | ||
116 | } | ||
117 | |||
108 | static int __initdata paca_size; | 118 | static int __initdata paca_size; |
109 | 119 | ||
110 | void __init allocate_pacas(void) | 120 | void __init allocate_pacas(void) |