diff options
| -rw-r--r-- | arch/powerpc/kernel/kgdb.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/kernel/traps.c | 7 | 
2 files changed, 9 insertions, 4 deletions
| diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index c81e3de1306e..82a7b228c81a 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> | 
| 21 | #include <linux/signal.h> | 21 | #include <linux/signal.h> | 
| 22 | #include <linux/ptrace.h> | 22 | #include <linux/ptrace.h> | 
| 23 | #include <linux/kdebug.h> | ||
| 23 | #include <asm/current.h> | 24 | #include <asm/current.h> | 
| 24 | #include <asm/processor.h> | 25 | #include <asm/processor.h> | 
| 25 | #include <asm/machdep.h> | 26 | #include <asm/machdep.h> | 
| @@ -115,7 +116,8 @@ void kgdb_roundup_cpus(unsigned long flags) | |||
| 115 | /* KGDB functions to use existing PowerPC64 hooks. */ | 116 | /* KGDB functions to use existing PowerPC64 hooks. */ | 
| 116 | static int kgdb_debugger(struct pt_regs *regs) | 117 | static int kgdb_debugger(struct pt_regs *regs) | 
| 117 | { | 118 | { | 
| 118 | return kgdb_handle_exception(0, computeSignal(TRAP(regs)), 0, regs); | 119 | return !kgdb_handle_exception(1, computeSignal(TRAP(regs)), | 
| 120 | DIE_OOPS, regs); | ||
| 119 | } | 121 | } | 
| 120 | 122 | ||
| 121 | static int kgdb_handle_breakpoint(struct pt_regs *regs) | 123 | static int kgdb_handle_breakpoint(struct pt_regs *regs) | 
| @@ -123,7 +125,7 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) | |||
| 123 | if (user_mode(regs)) | 125 | if (user_mode(regs)) | 
| 124 | return 0; | 126 | return 0; | 
| 125 | 127 | ||
| 126 | if (kgdb_handle_exception(0, SIGTRAP, 0, regs) != 0) | 128 | if (kgdb_handle_exception(1, SIGTRAP, 0, regs) != 0) | 
| 127 | return 0; | 129 | return 0; | 
| 128 | 130 | ||
| 129 | if (*(u32 *) (regs->nip) == *(u32 *) (&arch_kgdb_ops.gdb_bpt_instr)) | 131 | if (*(u32 *) (regs->nip) == *(u32 *) (&arch_kgdb_ops.gdb_bpt_instr)) | 
| 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) { | 
