Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204683
b: refs/heads/master
c: 06532a6
h: refs/heads/master
i:
  204681: 7d9aa74
  204679: 93f070d
v: v3
  • Loading branch information
K.Prasad authored and Paul Mackerras committed Jun 22, 2010
1 parent 975c192 commit 82a3bfe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2538c2d08f46141550a1e68819efa8fe31c6e3dc
refs/heads/master: 06532a6743d83fac4b79389fc8c86c88cb4e3302
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/include/asm/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ static inline void hw_breakpoint_disable(void)
{
set_dabr(0);
}
extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);

#else /* CONFIG_HAVE_HW_BREAKPOINT */
static inline void hw_breakpoint_disable(void) { }
static inline void thread_change_pc(struct task_struct *tsk,
struct pt_regs *regs) { }
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
#endif /* __KERNEL__ */
#endif /* _PPC_BOOK3S_64_HW_BREAKPOINT_H */
18 changes: 18 additions & 0 deletions trunk/arch/powerpc/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
return 0;
}

/*
* Restores the breakpoint on the debug registers.
* Invoke this function if it is known that the execution context is
* about to change to cause loss of MSR_SE settings.
*/
void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs)
{
struct arch_hw_breakpoint *info;

if (likely(!tsk->thread.last_hit_ubp))
return;

info = counter_arch_bp(tsk->thread.last_hit_ubp);
regs->msr &= ~MSR_SE;
set_dabr(info->address | info->type | DABR_TRANSLATION);
tsk->thread.last_hit_ubp = NULL;
}

/*
* Handle debug exception notifications.
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/powerpc/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/tracehook.h>
#include <linux/signal.h>
#include <asm/hw_breakpoint.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>

Expand Down Expand Up @@ -149,6 +150,8 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
if (current->thread.dabr)
set_dabr(current->thread.dabr);
#endif
/* Re-enable the breakpoints for the signal stack */
thread_change_pc(current, regs);

if (is32) {
if (ka.sa.sa_flags & SA_SIGINFO)
Expand Down

0 comments on commit 82a3bfe

Please sign in to comment.