Skip to content

Commit e3a61b0

Browse files
nomisIngo Molnar
authored andcommitted
x86: add unknown_nmi_panic kernel parameter
It's not possible to enable the unknown_nmi_panic sysctl option until init is run. It's useful to be able to panic the kernel during boot too, this adds a parameter to enable this option. Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 5b664cb commit e3a61b0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/kernel-parameters.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,10 @@ and is between 256 and 4096 characters. It is defined in the file
21582158
Note that genuine overcurrent events won't be
21592159
reported either.
21602160

2161+
unknown_nmi_panic
2162+
[X86-32,X86-64]
2163+
Set unknown_nmi_panic=1 early on boot.
2164+
21612165
usbcore.autosuspend=
21622166
[USB] The autosuspend time delay (in seconds) used
21632167
for newly-detected USB devices (default 2). This

arch/x86/kernel/nmi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,13 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
448448

449449
#ifdef CONFIG_SYSCTL
450450

451+
static int __init setup_unknown_nmi_panic(char *str)
452+
{
453+
unknown_nmi_panic = 1;
454+
return 1;
455+
}
456+
__setup("unknown_nmi_panic", setup_unknown_nmi_panic);
457+
451458
static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
452459
{
453460
unsigned char reason = get_nmi_reason();

0 commit comments

Comments
 (0)