提交 0b45143b 编写于 作者: G Georges Aureau 提交者: Borislav Petkov

x86/platform/uv: Add more to secondary CPU kdump info

Add call to run_crash_ipi_callback() to gather more info of what the
secondary CPUs were doing to help with failure analysis.

Excerpt from Georges:

'It is only changing where crash secondaries will be stalling after
having taken care of properly laying down "crash note regs". Please
note that "crash note regs" are a key piece of data used by crash dump
debuggers to provide a reliable backtrace of running processors.'

Secondary change pursuant to

  a5f526ec ("CodingStyle: Inclusive Terminology"):

change master/slave to main/secondary.

 [ bp: Massage commit message. ]
Signed-off-by: NGeorges Aureau <georges.aureau@hpe.com>
Signed-off-by: NMike Travis <mike.travis@hpe.com>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Reviewed-by: NSteve Wahl <steve.wahl@hpe.com>
Link: https://lkml.kernel.org/r/20210311151028.82678-1-mike.travis@hpe.com
上级 26d4be3e
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/kdebug.h> #include <asm/kdebug.h>
#include <asm/local64.h> #include <asm/local64.h>
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/reboot.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/uv/uv.h> #include <asm/uv/uv.h>
#include <asm/uv/uv_hub.h> #include <asm/uv/uv_hub.h>
...@@ -834,34 +835,42 @@ static void uv_nmi_touch_watchdogs(void) ...@@ -834,34 +835,42 @@ static void uv_nmi_touch_watchdogs(void)
touch_nmi_watchdog(); touch_nmi_watchdog();
} }
static atomic_t uv_nmi_kexec_failed;
#if defined(CONFIG_KEXEC_CORE) #if defined(CONFIG_KEXEC_CORE)
static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs) static atomic_t uv_nmi_kexec_failed;
static void uv_nmi_kdump(int cpu, int main, struct pt_regs *regs)
{ {
/* Check if kdump kernel loaded for both main and secondary CPUs */
if (!kexec_crash_image) {
if (main)
pr_err("UV: NMI error: kdump kernel not loaded\n");
return;
}
/* Call crash to dump system state */ /* Call crash to dump system state */
if (master) { if (main) {
pr_emerg("UV: NMI executing crash_kexec on CPU%d\n", cpu); pr_emerg("UV: NMI executing crash_kexec on CPU%d\n", cpu);
crash_kexec(regs); crash_kexec(regs);
pr_emerg("UV: crash_kexec unexpectedly returned, "); pr_emerg("UV: crash_kexec unexpectedly returned\n");
atomic_set(&uv_nmi_kexec_failed, 1); atomic_set(&uv_nmi_kexec_failed, 1);
if (!kexec_crash_image) {
pr_cont("crash kernel not loaded\n"); } else { /* secondary */
return;
/* If kdump kernel fails, secondaries will exit this loop */
while (atomic_read(&uv_nmi_kexec_failed) == 0) {
/* Once shootdown cpus starts, they do not return */
run_crash_ipi_callback(regs);
mdelay(10);
} }
pr_cont("kexec busy, stalling cpus while waiting\n");
} }
/* If crash exec fails the slaves should return, otherwise stall */
while (atomic_read(&uv_nmi_kexec_failed) == 0)
mdelay(10);
} }
#else /* !CONFIG_KEXEC_CORE */ #else /* !CONFIG_KEXEC_CORE */
static inline void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs) static inline void uv_nmi_kdump(int cpu, int main, struct pt_regs *regs)
{ {
if (master) if (main)
pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n"); pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n");
atomic_set(&uv_nmi_kexec_failed, 1); atomic_set(&uv_nmi_kexec_failed, 1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册