mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 UV debug changes from Ingo Molnar: "Various SGI UV debuggability improvements, amongst them KDB support, with related core KDB enabling patches changing kernel/debug/kdb/" * 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "x86/UV: Add uvtrace support" x86/UV: Add call to KGDB/KDB from NMI handler kdb: Add support for external NMI handler to call KGDB/KDB x86/UV: Check for alloc_cpumask_var() failures properly in uv_nmi_setup() x86/UV: Add uvtrace support x86/UV: Add kdump to UV NMI handler x86/UV: Add summary of cpu activity to UV NMI handler x86/UV: Update UV support for external NMI signals x86/UV: Move NMI support
This commit is contained in:
@@ -575,8 +575,12 @@ return_normal:
|
||||
raw_spin_lock(&dbg_slave_lock);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* If send_ready set, slaves are already waiting */
|
||||
if (ks->send_ready)
|
||||
atomic_set(ks->send_ready, 1);
|
||||
|
||||
/* Signal the other CPUs to enter kgdb_wait() */
|
||||
if ((!kgdb_single_step) && kgdb_do_roundup)
|
||||
else if ((!kgdb_single_step) && kgdb_do_roundup)
|
||||
kgdb_roundup_cpus(flags);
|
||||
#endif
|
||||
|
||||
@@ -678,11 +682,11 @@ kgdb_handle_exception(int evector, int signo, int ecode, struct pt_regs *regs)
|
||||
if (arch_kgdb_ops.enable_nmi)
|
||||
arch_kgdb_ops.enable_nmi(0);
|
||||
|
||||
memset(ks, 0, sizeof(struct kgdb_state));
|
||||
ks->cpu = raw_smp_processor_id();
|
||||
ks->ex_vector = evector;
|
||||
ks->signo = signo;
|
||||
ks->err_code = ecode;
|
||||
ks->kgdb_usethreadid = 0;
|
||||
ks->linux_regs = regs;
|
||||
|
||||
if (kgdb_reenter_check(ks))
|
||||
@@ -732,6 +736,30 @@ int kgdb_nmicallback(int cpu, void *regs)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (!kgdb_io_ready(0) || !send_ready)
|
||||
return 1;
|
||||
|
||||
if (kgdb_info[cpu].enter_kgdb == 0) {
|
||||
struct kgdb_state kgdb_var;
|
||||
struct kgdb_state *ks = &kgdb_var;
|
||||
|
||||
memset(ks, 0, sizeof(struct kgdb_state));
|
||||
ks->cpu = cpu;
|
||||
ks->ex_vector = trapnr;
|
||||
ks->signo = SIGTRAP;
|
||||
ks->err_code = KGDB_KDB_REASON_SYSTEM_NMI;
|
||||
ks->linux_regs = regs;
|
||||
ks->send_ready = send_ready;
|
||||
kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void kgdb_console_write(struct console *co, const char *s,
|
||||
unsigned count)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ struct kgdb_state {
|
||||
unsigned long threadid;
|
||||
long kgdb_usethreadid;
|
||||
struct pt_regs *linux_regs;
|
||||
atomic_t *send_ready;
|
||||
};
|
||||
|
||||
/* Exception state values */
|
||||
@@ -74,11 +75,13 @@ extern int kdb_stub(struct kgdb_state *ks);
|
||||
extern int kdb_parse(const char *cmdstr);
|
||||
extern int kdb_common_init_state(struct kgdb_state *ks);
|
||||
extern int kdb_common_deinit_state(void);
|
||||
#define KGDB_KDB_REASON_SYSTEM_NMI KDB_REASON_SYSTEM_NMI
|
||||
#else /* ! CONFIG_KGDB_KDB */
|
||||
static inline int kdb_stub(struct kgdb_state *ks)
|
||||
{
|
||||
return DBG_PASS_EVENT;
|
||||
}
|
||||
#define KGDB_KDB_REASON_SYSTEM_NMI 0
|
||||
#endif /* CONFIG_KGDB_KDB */
|
||||
|
||||
#endif /* _DEBUG_CORE_H_ */
|
||||
|
||||
@@ -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