Commit ba16f36f authored by Phileas Fogg's avatar Phileas Fogg Committed by Greg Kroah-Hartman

powerpc/kexec: Disable hard IRQ before kexec

commit 8520e443 upstream.

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: default avatarPhileas Fogg <phileas-fogg@mail.ru>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db0f5de3
...@@ -162,6 +162,8 @@ static int kexec_all_irq_disabled = 0; ...@@ -162,6 +162,8 @@ static int kexec_all_irq_disabled = 0;
static void kexec_smp_down(void *arg) static void kexec_smp_down(void *arg)
{ {
local_irq_disable(); local_irq_disable();
hard_irq_disable();
mb(); /* make sure our irqs are disabled before we say they are */ mb(); /* make sure our irqs are disabled before we say they are */
get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
while(kexec_all_irq_disabled == 0) while(kexec_all_irq_disabled == 0)
...@@ -244,6 +246,8 @@ static void kexec_prepare_cpus(void) ...@@ -244,6 +246,8 @@ static void kexec_prepare_cpus(void)
wake_offline_cpus(); wake_offline_cpus();
smp_call_function(kexec_smp_down, NULL, /* wait */0); smp_call_function(kexec_smp_down, NULL, /* wait */0);
local_irq_disable(); local_irq_disable();
hard_irq_disable();
mb(); /* make sure IRQs are disabled before we say they are */ mb(); /* make sure IRQs are disabled before we say they are */
get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF; get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
...@@ -281,6 +285,7 @@ static void kexec_prepare_cpus(void) ...@@ -281,6 +285,7 @@ static void kexec_prepare_cpus(void)
if (ppc_md.kexec_cpu_down) if (ppc_md.kexec_cpu_down)
ppc_md.kexec_cpu_down(0, 0); ppc_md.kexec_cpu_down(0, 0);
local_irq_disable(); local_irq_disable();
hard_irq_disable();
} }
#endif /* SMP */ #endif /* SMP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment