kgdb/kdb: Fix no KDB config problem
authorMike Travis <travis@sgi.com>
Tue, 14 Jan 2014 16:25:52 +0000 (10:25 -0600)
committerIngo Molnar <mingo@kernel.org>
Sat, 25 Jan 2014 07:55:09 +0000 (08:55 +0100)
Some code added to the debug_core module had KDB dependencies
that it shouldn't have.  Move the KDB dependent REASON back to
the caller to remove the dependency in the debug core code.

Update the call from the UV NMI handler to conform to the new
interface.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Hedi Berriche <hedi@sgi.com>
Cc: Russ Anderson <rja@sgi.com>
Cc: Jason Wessel <jason.wessel@windriver.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/20140114162551.318251993@asylum.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/uv/uv_nmi.c
include/linux/kgdb.h
kernel/debug/debug_core.c
kernel/debug/debug_core.h

index 8eeccba731304bb36d6a297e5d1ed1f4bf7158fd..7486c21cbf0a2133eea70680d615b7c8e2c961cb 100644 (file)
@@ -546,7 +546,7 @@ static void uv_call_kdb(int cpu, struct pt_regs *regs, int master)
        if (master) {
                /* call KGDB NMI handler as MASTER */
                ret = kgdb_nmicallin(cpu, X86_TRAP_NMI, regs,
-                                       &uv_nmi_slave_continue);
+                       KDB_REASON_SYSTEM_NMI, &uv_nmi_slave_continue);
                if (ret) {
                        pr_alert("KDB returned error, is kgdboc set?\n");
                        atomic_set(&uv_nmi_slave_continue, SLAVE_EXIT);
index dfb4f2ffdaa2e5eccddb6755f08305ff7a449891..6b06d378f3dfed9b6e2876cdd3eb563d4d7483e9 100644 (file)
@@ -310,7 +310,8 @@ extern int
 kgdb_handle_exception(int ex_vector, int signo, int err_code,
                      struct pt_regs *regs);
 extern int kgdb_nmicallback(int cpu, void *regs);
-extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy);
+extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code,
+                         atomic_t *snd_rdy);
 extern void gdbstub_exit(int status);
 
 extern int                     kgdb_single_step;
index 7d2f35e5df2f91c1ad0ec7a37741582929c22fec..334b3980ffc14d396e25ccb11644f7f038cbe6e4 100644 (file)
@@ -736,7 +736,8 @@ int kgdb_nmicallback(int cpu, void *regs)
        return 1;
 }
 
-int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready)
+int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code,
+                                                       atomic_t *send_ready)
 {
 #ifdef CONFIG_SMP
        if (!kgdb_io_ready(0) || !send_ready)
@@ -750,7 +751,7 @@ int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready)
                ks->cpu                 = cpu;
                ks->ex_vector           = trapnr;
                ks->signo               = SIGTRAP;
-               ks->err_code            = KGDB_KDB_REASON_SYSTEM_NMI;
+               ks->err_code            = err_code;
                ks->linux_regs          = regs;
                ks->send_ready          = send_ready;
                kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
index 572aa4f5677cb7c6034a72e040a6c0b9bd4fcb34..127d9bc49fb4b24ea6824b12f73befc7fe870012 100644 (file)
@@ -75,13 +75,11 @@ 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_ */