Patchwork [v7,01/25] ACPI / APEI: Don't wait to serialise with oops messages when panic()ing

mail settings
Submitter James Morse
Date Dec. 3, 2018, 6:05 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/670987/
State New
Headers show


James Morse - Dec. 3, 2018, 6:05 p.m.
oops_begin() exists to group printk() messages with the oops message
printed by die(). To reach this caller we know that platform firmware
took this error first, then notified the OS via NMI with a 'panic'

Don't wait for another CPU to release the die-lock before panic()ing,
our only goal is to print this fatal error and panic().

This code is always called in_nmi(), and since commit 42a0bb3f7138
("printk/nmi: generic solution for safe printk in NMI"), it has been
safe to call printk() from this context. Messages are batched in a
per-cpu buffer and printed via irq-work, or a call back from panic().

Acked-by: Borislav Petkov <>
Signed-off-by: James Morse <>

Changes since v6:
 * Capitals in patch subject
 * Tinkered with the commit message.
 drivers/acpi/apei/ghes.c | 2 --
 1 file changed, 2 deletions(-)


diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 02c6fd9caff7..ab2dae6fc7e4 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -33,7 +33,6 @@ 
 #include <linux/interrupt.h>
 #include <linux/timer.h>
 #include <linux/cper.h>
-#include <linux/kdebug.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
 #include <linux/ratelimit.h>
@@ -947,7 +946,6 @@  static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
 		sev = ghes_severity(ghes->estatus->error_severity);
 		if (sev >= GHES_SEV_PANIC) {
-			oops_begin();