lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 21 Jan 2021 08:33:47 -0600
From:   Mike Travis <mike.travis@....com>
To:     Borislav_Petkov_ <bp@...en8.de>,
        Thomas_Gleixner_ <tglx@...utronix.de>,
        Ingo_Molnar_ <mingo@...hat.com>,
        Steve_Wahl_ <steve.wahl@....com>, x86@...nel.org
Cc:     Mike Travis <mike.travis@....com>,
        Georges Aureau <georges.aureau@....com>,
        Dimitri_Sivanich_ <dimitri.sivanich@....com>,
        Russ_Anderson_ <russ.anderson@....com>,
        Darren_Hart_ <dvhart@...radead.org>,
        Andy_Shevchenko_ <andy@...radead.org>,
        "H._Peter_Anvin_" <hpa@...or.com>,
        platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] x86/platform/uv: Add more to slave cpu kdump info

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

Excerpt from Georges:
'It is only changing where crash slaves 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.'

Signed-off-by: Mike Travis <mike.travis@....com>
Signed-off-by: Georges Aureau <georges.aureau@....com>
Reviewed-by: Steve Wahl <steve.wahl@....com>
---
 arch/x86/platform/uv/uv_nmi.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
index eafc530c8767..811997b16b42 100644
--- a/arch/x86/platform/uv/uv_nmi.c
+++ b/arch/x86/platform/uv/uv_nmi.c
@@ -24,6 +24,7 @@
 #include <asm/kdebug.h>
 #include <asm/local64.h>
 #include <asm/nmi.h>
+#include <asm/reboot.h>
 #include <asm/traps.h>
 #include <asm/uv/uv.h>
 #include <asm/uv/uv_hub.h>
@@ -834,28 +835,35 @@ static void uv_nmi_touch_watchdogs(void)
 	touch_nmi_watchdog();
 }
 
-static atomic_t uv_nmi_kexec_failed;
-
 #if defined(CONFIG_KEXEC_CORE)
+static atomic_t uv_nmi_kexec_failed;
 static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
 {
+	/* Check if kdump kernel loaded for both master and slave CPUs */
+	if (!kexec_crash_image) {
+		if (master)
+			pr_err("UV: NMI error: kdump kernel not loaded\n");
+		return;
+	}
+
 	/* Call crash to dump system state */
 	if (master) {
 		pr_emerg("UV: NMI executing crash_kexec on CPU%d\n", cpu);
 		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);
-		if (!kexec_crash_image) {
-			pr_cont("crash kernel not loaded\n");
-			return;
+	} else {
+		/* If kdump kernel fails, slaves will exit this loop */
+		while (atomic_read(&uv_nmi_kexec_failed) == 0) {
+			/*
+			 * If crash exec sets "crash_ipi_issued",
+			 * ... slaves do not return from callback function.
+			 */
+			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 */
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ