提交 855b6232 编写于 作者: N Nicholas Piggin 提交者: Michael Ellerman

powerpc/64: hard disable irqs on the panic()ing CPU

Similar to previous patches, hard disable interrupts when a CPU is
in panic. This reduces the chance the watchdog has to interfere with
the panic, and avoids any other type of masked interrupt being
executed when crashing which minimises the length of the crash path.
Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 de6e5d38
...@@ -700,11 +700,18 @@ EXPORT_SYMBOL(check_legacy_ioport); ...@@ -700,11 +700,18 @@ EXPORT_SYMBOL(check_legacy_ioport);
static int ppc_panic_event(struct notifier_block *this, static int ppc_panic_event(struct notifier_block *this,
unsigned long event, void *ptr) unsigned long event, void *ptr)
{ {
/*
* panic does a local_irq_disable, but we really
* want interrupts to be hard disabled.
*/
hard_irq_disable();
/* /*
* If firmware-assisted dump has been registered then trigger * If firmware-assisted dump has been registered then trigger
* firmware-assisted dump and let firmware handle everything else. * firmware-assisted dump and let firmware handle everything else.
*/ */
crash_fadump(NULL, ptr); crash_fadump(NULL, ptr);
if (ppc_md.panic)
ppc_md.panic(ptr); /* May not return */ ppc_md.panic(ptr); /* May not return */
return NOTIFY_DONE; return NOTIFY_DONE;
} }
...@@ -716,7 +723,8 @@ static struct notifier_block ppc_panic_block = { ...@@ -716,7 +723,8 @@ static struct notifier_block ppc_panic_block = {
void __init setup_panic(void) void __init setup_panic(void)
{ {
if (!ppc_md.panic) /* PPC64 always does a hard irq disable in its panic handler */
if (!IS_ENABLED(CONFIG_PPC64) && !ppc_md.panic)
return; return;
atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册