Skip to content

Commit a029a21

Browse files
diandersgregkh
authored andcommitted
Revert "kernel/debug: Mask KGDB NMI upon entry"
This reverts commit 5a14fea. 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.3.I2254953cd852f31f354456689d68b2d910de3fbe@changeid Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dbb1f9c commit a029a21

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

include/linux/kgdb.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ extern void kgdb_arch_late(void);
257257
* hardware breakpoints.
258258
* @correct_hw_break: Allow an architecture to specify how to correct the
259259
* hardware debug registers.
260-
* @enable_nmi: Manage NMI-triggered entry to KGDB
261260
*/
262261
struct kgdb_arch {
263262
unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE];
@@ -270,8 +269,6 @@ struct kgdb_arch {
270269
void (*disable_hw_break)(struct pt_regs *regs);
271270
void (*remove_all_hw_break)(void);
272271
void (*correct_hw_break)(void);
273-
274-
void (*enable_nmi)(bool on);
275272
};
276273

277274
/**

kernel/debug/debug_core.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,6 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
837837
{
838838
struct kgdb_state kgdb_var;
839839
struct kgdb_state *ks = &kgdb_var;
840-
int ret = 0;
841-
842-
if (arch_kgdb_ops.enable_nmi)
843-
arch_kgdb_ops.enable_nmi(0);
844840
/*
845841
* Avoid entering the debugger if we were triggered due to an oops
846842
* but panic_timeout indicates the system should automatically
@@ -858,15 +854,11 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
858854
ks->linux_regs = regs;
859855

860856
if (kgdb_reenter_check(ks))
861-
goto out; /* Ouch, double exception ! */
857+
return 0; /* Ouch, double exception ! */
862858
if (kgdb_info[ks->cpu].enter_kgdb != 0)
863-
goto out;
859+
return 0;
864860

865-
ret = kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
866-
out:
867-
if (arch_kgdb_ops.enable_nmi)
868-
arch_kgdb_ops.enable_nmi(1);
869-
return ret;
861+
return kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
870862
}
871863
NOKPROBE_SYMBOL(kgdb_handle_exception);
872864

0 commit comments

Comments
 (0)