]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/nmi: Consolidate NMI panic variables
authorSohil Mehta <sohil.mehta@intel.com>
Thu, 27 Mar 2025 23:46:22 +0000 (23:46 +0000)
committerIngo Molnar <mingo@kernel.org>
Tue, 1 Apr 2025 20:25:56 +0000 (22:25 +0200)
Commit:

  c305a4e98378 ("x86: Move sysctls into arch/x86")

recently moved the sysctl handling of panic_on_unrecovered_nmi and
panic_on_io_nmi to x86-specific code. These variables no longer need to
be declared in the generic header file.

Relocate the variable definitions and declarations closer to where they
are used. This makes all the NMI panic options consistent and easier to
track.

[ mingo: Fixed up the SHA1 of the commit reference. ]

Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Cc: Joel Granados <joel.granados@kernel.org>
Link: https://lore.kernel.org/r/20250327234629.3953536-3-sohil.mehta@intel.com
arch/x86/include/asm/nmi.h
arch/x86/kernel/dumpstack.c
arch/x86/kernel/nmi.c
include/linux/panic.h

index 9cf96cce02fca0514e82dd469e4e06bce81e02e9..f85aea7bf7f196c07ccfaa324148d41f72b69283 100644 (file)
@@ -17,6 +17,8 @@ extern void release_evntsel_nmi(unsigned int);
 #endif /* CONFIG_X86_LOCAL_APIC */
 
 extern int unknown_nmi_panic;
+extern int panic_on_unrecovered_nmi;
+extern int panic_on_io_nmi;
 
 #define NMI_FLAG_FIRST 1
 
index c6fefd4585f8fdebd328dbc08c66a7a88f2a0c84..71ee20102a8afb4400165eeaf2d6434cb00914c2 100644 (file)
@@ -23,8 +23,6 @@
 #include <asm/stacktrace.h>
 #include <asm/unwind.h>
 
-int panic_on_unrecovered_nmi;
-int panic_on_io_nmi;
 static int die_counter;
 
 static struct pt_regs exec_summary_regs;
index 9a95d00f142330010e888bcba063431670d20536..671d846ed6200365d453081b39dcc19c841e00c3 100644 (file)
@@ -91,6 +91,9 @@ static DEFINE_PER_CPU(struct nmi_stats, nmi_stats);
 static int ignore_nmis __read_mostly;
 
 int unknown_nmi_panic;
+int panic_on_unrecovered_nmi;
+int panic_on_io_nmi;
+
 /*
  * Prevent NMI reason port (0x61) being accessed simultaneously, can
  * only be used in NMI handler.
index 2494d51707ef422dfe191e484c0676e428a2de09..4adc6576693549e31f85750e698ad294ec0aaaf0 100644 (file)
@@ -20,8 +20,6 @@ extern bool panic_triggering_all_cpu_backtrace;
 extern int panic_timeout;
 extern unsigned long panic_print;
 extern int panic_on_oops;
-extern int panic_on_unrecovered_nmi;
-extern int panic_on_io_nmi;
 extern int panic_on_warn;
 
 extern unsigned long panic_on_taint;