Skip to content

Commit dbb1f9c

Browse files
diandersgregkh
authored andcommitted
Revert "kdb: Implement disable_nmi command"
This reverts commit ad394f6. 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 <[email protected]> Link: https://lore.kernel.org/r/20250129082535.2.Ib91bfb95bdcf77591257a84063fdeb5b4dce65b1@changeid Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c08b0f2 commit dbb1f9c

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

kernel/debug/kdb/kdb_main.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/smp.h>
2626
#include <linux/utsname.h>
2727
#include <linux/vmalloc.h>
28-
#include <linux/atomic.h>
2928
#include <linux/moduleparam.h>
3029
#include <linux/mm.h>
3130
#include <linux/init.h>
@@ -2119,32 +2118,6 @@ static int kdb_dmesg(int argc, const char **argv)
21192118
return 0;
21202119
}
21212120
#endif /* CONFIG_PRINTK */
2122-
2123-
/* Make sure we balance enable/disable calls, must disable first. */
2124-
static atomic_t kdb_nmi_disabled;
2125-
2126-
static int kdb_disable_nmi(int argc, const char *argv[])
2127-
{
2128-
if (atomic_read(&kdb_nmi_disabled))
2129-
return 0;
2130-
atomic_set(&kdb_nmi_disabled, 1);
2131-
arch_kgdb_ops.enable_nmi(0);
2132-
return 0;
2133-
}
2134-
2135-
static int kdb_param_enable_nmi(const char *val, const struct kernel_param *kp)
2136-
{
2137-
if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0))
2138-
return -EINVAL;
2139-
arch_kgdb_ops.enable_nmi(1);
2140-
return 0;
2141-
}
2142-
2143-
static const struct kernel_param_ops kdb_param_ops_enable_nmi = {
2144-
.set = kdb_param_enable_nmi,
2145-
};
2146-
module_param_cb(enable_nmi, &kdb_param_ops_enable_nmi, NULL, 0600);
2147-
21482121
/*
21492122
* kdb_cpu - This function implements the 'cpu' command.
21502123
* cpu [<cpunum>]
@@ -2836,20 +2809,10 @@ static kdbtab_t maintab[] = {
28362809
},
28372810
};
28382811

2839-
static kdbtab_t nmicmd = {
2840-
.name = "disable_nmi",
2841-
.func = kdb_disable_nmi,
2842-
.usage = "",
2843-
.help = "Disable NMI entry to KDB",
2844-
.flags = KDB_ENABLE_ALWAYS_SAFE,
2845-
};
2846-
28472812
/* Initialize the kdb command table. */
28482813
static void __init kdb_inittab(void)
28492814
{
28502815
kdb_register_table(maintab, ARRAY_SIZE(maintab));
2851-
if (arch_kgdb_ops.enable_nmi)
2852-
kdb_register_table(&nmicmd, 1);
28532816
}
28542817

28552818
/* Execute any commands defined in kdb_cmds. */

0 commit comments

Comments
 (0)