Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "kdb: Implement disable_nmi command"

This reverts commit ad394f66fa57ae66014cb74f337e2820bac4c417.

No architectures ever implemented `enable_nmi` since the later patches
in the series adding it never landed. It's been a long time. Drop it.

NOTE: this is not a clean revert due to changes in the file in the
meantime.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250129082535.2.Ib91bfb95bdcf77591257a84063fdeb5b4dce65b1@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Douglas Anderson and committed by
Greg Kroah-Hartman
dbb1f9c0 c08b0f2c

-37
-37
kernel/debug/kdb/kdb_main.c
··· 25 25 #include <linux/smp.h> 26 26 #include <linux/utsname.h> 27 27 #include <linux/vmalloc.h> 28 - #include <linux/atomic.h> 29 28 #include <linux/moduleparam.h> 30 29 #include <linux/mm.h> 31 30 #include <linux/init.h> ··· 2118 2119 return 0; 2119 2120 } 2120 2121 #endif /* CONFIG_PRINTK */ 2121 - 2122 - /* Make sure we balance enable/disable calls, must disable first. */ 2123 - static atomic_t kdb_nmi_disabled; 2124 - 2125 - static int kdb_disable_nmi(int argc, const char *argv[]) 2126 - { 2127 - if (atomic_read(&kdb_nmi_disabled)) 2128 - return 0; 2129 - atomic_set(&kdb_nmi_disabled, 1); 2130 - arch_kgdb_ops.enable_nmi(0); 2131 - return 0; 2132 - } 2133 - 2134 - static int kdb_param_enable_nmi(const char *val, const struct kernel_param *kp) 2135 - { 2136 - if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0)) 2137 - return -EINVAL; 2138 - arch_kgdb_ops.enable_nmi(1); 2139 - return 0; 2140 - } 2141 - 2142 - static const struct kernel_param_ops kdb_param_ops_enable_nmi = { 2143 - .set = kdb_param_enable_nmi, 2144 - }; 2145 - module_param_cb(enable_nmi, &kdb_param_ops_enable_nmi, NULL, 0600); 2146 - 2147 2122 /* 2148 2123 * kdb_cpu - This function implements the 'cpu' command. 2149 2124 * cpu [<cpunum>] ··· 2809 2836 }, 2810 2837 }; 2811 2838 2812 - static kdbtab_t nmicmd = { 2813 - .name = "disable_nmi", 2814 - .func = kdb_disable_nmi, 2815 - .usage = "", 2816 - .help = "Disable NMI entry to KDB", 2817 - .flags = KDB_ENABLE_ALWAYS_SAFE, 2818 - }; 2819 - 2820 2839 /* Initialize the kdb command table. */ 2821 2840 static void __init kdb_inittab(void) 2822 2841 { 2823 2842 kdb_register_table(maintab, ARRAY_SIZE(maintab)); 2824 - if (arch_kgdb_ops.enable_nmi) 2825 - kdb_register_table(&nmicmd, 1); 2826 2843 } 2827 2844 2828 2845 /* Execute any commands defined in kdb_cmds. */