diff options
author | K.Prasad <prasad@linux.vnet.ibm.com> | 2010-06-15 02:05:41 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2010-06-22 05:40:50 -0400 |
commit | 06532a6743d83fac4b79389fc8c86c88cb4e3302 (patch) | |
tree | 2ca694f5cb71a2296c6b4e0b36f3ddd6e2033084 /arch/powerpc/kernel/signal.c | |
parent | 2538c2d08f46141550a1e68819efa8fe31c6e3dc (diff) |
powerpc, hw_breakpoint: Enable hw-breakpoints while handling intervening signals
A signal delivered between a hw_breakpoint_handler() and the
single_step_dabr_instruction() will not have the breakpoint active
while the signal handler is running -- the signal delivery will
set up a new MSR value which will not have MSR_SE set, so we
won't get the signal step interrupt until and unless the signal
handler returns (which it may never do).
To fix this, we restore the breakpoint when delivering a signal --
we clear the MSR_SE bit and set the DABR again. If the signal
handler returns, the DABR interrupt will occur again when the
instruction that we were originally trying to single-step gets
re-executed.
[Paul Mackerras <paulus@samba.org> pointed out the need to do this.]
Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/signal.c')
-rw-r--r-- | arch/powerpc/kernel/signal.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index a0afb555a7c9..7109f5b1baa8 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/tracehook.h> | 12 | #include <linux/tracehook.h> |
13 | #include <linux/signal.h> | 13 | #include <linux/signal.h> |
14 | #include <asm/hw_breakpoint.h> | ||
14 | #include <asm/uaccess.h> | 15 | #include <asm/uaccess.h> |
15 | #include <asm/unistd.h> | 16 | #include <asm/unistd.h> |
16 | 17 | ||
@@ -149,6 +150,8 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) | |||
149 | if (current->thread.dabr) | 150 | if (current->thread.dabr) |
150 | set_dabr(current->thread.dabr); | 151 | set_dabr(current->thread.dabr); |
151 | #endif | 152 | #endif |
153 | /* Re-enable the breakpoints for the signal stack */ | ||
154 | thread_change_pc(current, regs); | ||
152 | 155 | ||
153 | if (is32) { | 156 | if (is32) { |
154 | if (ka.sa.sa_flags & SA_SIGINFO) | 157 | if (ka.sa.sa_flags & SA_SIGINFO) |