kdb: Add support for external NMI handler to call KGDB/KDB
This patch adds a kgdb_nmicallin() interface that can be used by external NMI handlers to call the KGDB/KDB handler. The primary need for this is for those types of NMI interrupts where all the CPUs have already received the NMI signal. Therefore no send_IPI(NMI) is required, and in fact it will cause a 2nd unhandled NMI to occur. This generates the "Dazed and Confuzed" messages. Since all the CPUs are getting the NMI at roughly the same time, it's not guaranteed that the first CPU that hits the NMI handler will manage to enter KGDB and set the dbg_master_lock before the slaves start entering. The new argument "send_ready" was added for KGDB to signal the NMI handler to release the slave CPUs for entry into KGDB. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Jason Wessel <jason.wessel@windriver.com> Reviewed-by: Dimitri Sivanich <sivanich@sgi.com> Reviewed-by: Hedi Berriche <hedi@sgi.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Link: http://lkml.kernel.org/r/20131002151417.928886849@asylum.americas.sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -69,7 +69,10 @@ int kdb_stub(struct kgdb_state *ks)
|
||||
if (atomic_read(&kgdb_setting_breakpoint))
|
||||
reason = KDB_REASON_KEYBOARD;
|
||||
|
||||
if (in_nmi())
|
||||
if (ks->err_code == KDB_REASON_SYSTEM_NMI && ks->signo == SIGTRAP)
|
||||
reason = KDB_REASON_SYSTEM_NMI;
|
||||
|
||||
else if (in_nmi())
|
||||
reason = KDB_REASON_NMI;
|
||||
|
||||
for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; i++, bp++) {
|
||||
|
@@ -1200,6 +1200,9 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
|
||||
instruction_pointer(regs));
|
||||
kdb_dumpregs(regs);
|
||||
break;
|
||||
case KDB_REASON_SYSTEM_NMI:
|
||||
kdb_printf("due to System NonMaskable Interrupt\n");
|
||||
break;
|
||||
case KDB_REASON_NMI:
|
||||
kdb_printf("due to NonMaskable Interrupt @ "
|
||||
kdb_machreg_fmt "\n",
|
||||
|
Reference in New Issue
Block a user