]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "kdb: Implement disable_nmi command"
authorDouglas Anderson <dianders@chromium.org>
Wed, 29 Jan 2025 16:25:51 +0000 (08:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2025 09:05:43 +0000 (10:05 +0100)
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>
kernel/debug/kdb/kdb_main.c

index 5f4be507d79fc3772a8f728688402dc70f07d4ef..3a5408b545706b44739cb2107e9be1647a0329d3 100644 (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.  */