Skip to content

Commit

Permalink
hw-breakpoints: Check disabled breakpoints again
Browse files Browse the repository at this point in the history
We stopped checking disabled breakpoints because we weren't
allowing breakpoints on NULL addresses. And gdb tends to set
NULL addresses on inactive breakpoints.

But refusing NULL addresses was actually a regression that has
been fixed now. There is no reason anymore to not validate
inactive breakpoint settings.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: K. Prasad <prasad@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker committed May 1, 2010
1 parent 73266fc commit 87e9b20
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,7 @@ int register_perf_hw_breakpoint(struct perf_event *bp)
if (ret)
return ret;

/*
* Ptrace breakpoints can be temporary perf events only
* meant to reserve a slot. In this case, it is created disabled and
* we don't want to check the params right now (as we put a null addr)
* But perf tools create events as disabled and we want to check
* the params for them.
* This is a quick hack that will be removed soon, once we remove
* the tmp breakpoints from ptrace
*/
if (!bp->attr.disabled || !bp->overflow_handler)
ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);
ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);

/* if arch_validate_hwbkpt_settings() fails then release bp slot */
if (ret)
Expand Down

0 comments on commit 87e9b20

Please sign in to comment.