aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:25 -0400
committerJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:25 -0400
commitba797b28131b1f1367b662936ea370239d603cff (patch)
tree3939c2cf1ced75fc9a14339cf369a32c85c7f7fe /arch/powerpc/kernel/traps.c
parentf503b5ae53cb557ac351a668fcac1baab1cef0db (diff)
powerpc,kgdb: Introduce low level trap catching
The only way the debugger can handle a trap in inside rcu_lock, notify_die, or atomic_notifier_call_chain without a recursive fault is to allow the kernel debugger to handle the exception first in program_check_exception(). The other change here is to make sure that kgdb_handle_exception() is called with correct parameters when catching an oops, because kdb needs to know if the entry was an oops, single step, or breakpoint exception. [benh@kernel.crashing.org: move debugger_bpt instead of #ifdef] CC: Paul Mackerras <paulus@samba.org> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 29d128eb6c43..b6859aade9c2 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -815,12 +815,15 @@ void __kprobes program_check_exception(struct pt_regs *regs)
815 return; 815 return;
816 } 816 }
817 if (reason & REASON_TRAP) { 817 if (reason & REASON_TRAP) {
818 /* Debugger is first in line to stop recursive faults in
819 * rcu_lock, notify_die, or atomic_notifier_call_chain */
820 if (debugger_bpt(regs))
821 return;
822
818 /* trap exception */ 823 /* trap exception */
819 if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP) 824 if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
820 == NOTIFY_STOP) 825 == NOTIFY_STOP)
821 return; 826 return;
822 if (debugger_bpt(regs))
823 return;
824 827
825 if (!(regs->msr & MSR_PR) && /* not user-mode */ 828 if (!(regs->msr & MSR_PR) && /* not user-mode */
826 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) { 829 report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {