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>
This commit is contained in:
Douglas Anderson 2025-01-29 08:25:51 -08:00 committed by Greg Kroah-Hartman
parent c08b0f2c31
commit dbb1f9c03b

View File

@ -25,7 +25,6 @@
#include <linux/smp.h>
#include <linux/utsname.h>
#include <linux/vmalloc.h>
#include <linux/atomic.h>
#include <linux/moduleparam.h>
#include <linux/mm.h>
#include <linux/init.h>
@ -2119,32 +2118,6 @@ static int kdb_dmesg(int argc, const char **argv)
return 0;
}
#endif /* CONFIG_PRINTK */
/* Make sure we balance enable/disable calls, must disable first. */
static atomic_t kdb_nmi_disabled;
static int kdb_disable_nmi(int argc, const char *argv[])
{
if (atomic_read(&kdb_nmi_disabled))
return 0;
atomic_set(&kdb_nmi_disabled, 1);
arch_kgdb_ops.enable_nmi(0);
return 0;
}
static int kdb_param_enable_nmi(const char *val, const struct kernel_param *kp)
{
if (!atomic_add_unless(&kdb_nmi_disabled, -1, 0))
return -EINVAL;
arch_kgdb_ops.enable_nmi(1);
return 0;
}
static const struct kernel_param_ops kdb_param_ops_enable_nmi = {
.set = kdb_param_enable_nmi,
};
module_param_cb(enable_nmi, &kdb_param_ops_enable_nmi, NULL, 0600);
/*
* kdb_cpu - This function implements the 'cpu' command.
* cpu [<cpunum>]
@ -2836,20 +2809,10 @@ static kdbtab_t maintab[] = {
},
};
static kdbtab_t nmicmd = {
.name = "disable_nmi",
.func = kdb_disable_nmi,
.usage = "",
.help = "Disable NMI entry to KDB",
.flags = KDB_ENABLE_ALWAYS_SAFE,
};
/* Initialize the kdb command table. */
static void __init kdb_inittab(void)
{
kdb_register_table(maintab, ARRAY_SIZE(maintab));
if (arch_kgdb_ops.enable_nmi)
kdb_register_table(&nmicmd, 1);
}
/* Execute any commands defined in kdb_cmds. */