diff options
author | Phileas Fogg <phileas-fogg@mail.ru> | 2013-02-22 18:32:19 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-02-23 11:49:28 -0500 |
commit | 8520e443aa56cc157b015205ea53e7b9fc831291 (patch) | |
tree | 8458559715449fbd77e09c1f52954602e944e49a | |
parent | dffff02a6b10f25f879e1e523733770c0a492e76 (diff) |
powerpc/kexec: Disable hard IRQ before kexec
Disable hard IRQ before kexec a new kernel image.
Not doing it can result in corrupted data in the memory segments
reserved for the new kernel.
Signed-off-by: Phileas Fogg <phileas-fogg@mail.ru>
CC: <stable@vger.kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_64.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 7206701b1ff1..466a2908bb63 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -162,6 +162,8 @@ static int kexec_all_irq_disabled = 0; | |||
162 | static void kexec_smp_down(void *arg) | 162 | static void kexec_smp_down(void *arg) |
163 | { | 163 | { |
164 | local_irq_disable(); | 164 | local_irq_disable(); |
165 | hard_irq_disable(); | ||
166 | |||
165 | mb(); /* make sure our irqs are disabled before we say they are */ | 167 | mb(); /* make sure our irqs are disabled before we say they are */ |
166 | get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; | 168 | get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; |
167 | while(kexec_all_irq_disabled == 0) | 169 | while(kexec_all_irq_disabled == 0) |
@@ -244,6 +246,8 @@ static void kexec_prepare_cpus(void) | |||
244 | wake_offline_cpus(); | 246 | wake_offline_cpus(); |
245 | smp_call_function(kexec_smp_down, NULL, /* wait */0); | 247 | smp_call_function(kexec_smp_down, NULL, /* wait */0); |
246 | local_irq_disable(); | 248 | local_irq_disable(); |
249 | hard_irq_disable(); | ||
250 | |||
247 | mb(); /* make sure IRQs are disabled before we say they are */ | 251 | mb(); /* make sure IRQs are disabled before we say they are */ |
248 | get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; | 252 | get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; |
249 | 253 | ||
@@ -281,6 +285,7 @@ static void kexec_prepare_cpus(void) | |||
281 | if (ppc_md.kexec_cpu_down) | 285 | if (ppc_md.kexec_cpu_down) |
282 | ppc_md.kexec_cpu_down(0, 0); | 286 | ppc_md.kexec_cpu_down(0, 0); |
283 | local_irq_disable(); | 287 | local_irq_disable(); |
288 | hard_irq_disable(); | ||
284 | } | 289 | } |
285 | 290 | ||
286 | #endif /* SMP */ | 291 | #endif /* SMP */ |