Skip to content

Commit

Permalink
perf/hw_breakpoint: Remove arch breakpoint hooks
Browse files Browse the repository at this point in the history
PowerPC was the only user of these hooks, and has been refactored to no
longer require them. There is no need to keep them around, so remove
them to reduce complexity.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230801011744.153973-8-bgray@linux.ibm.com
  • Loading branch information
Benjamin Gray authored and Michael Ellerman committed Aug 16, 2023
1 parent 58709f6 commit 53834a0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
3 changes: 0 additions & 3 deletions include/linux/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ extern int dbg_reserve_bp_slot(struct perf_event *bp);
extern int dbg_release_bp_slot(struct perf_event *bp);
extern int reserve_bp_slot(struct perf_event *bp);
extern void release_bp_slot(struct perf_event *bp);
int arch_reserve_bp_slot(struct perf_event *bp);
void arch_release_bp_slot(struct perf_event *bp);
void arch_unregister_hw_breakpoint(struct perf_event *bp);

extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk);

Expand Down
28 changes: 0 additions & 28 deletions kernel/events/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,26 +523,6 @@ toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type, int we
return 0;
}

__weak int arch_reserve_bp_slot(struct perf_event *bp)
{
return 0;
}

__weak void arch_release_bp_slot(struct perf_event *bp)
{
}

/*
* Function to perform processor-specific cleanup during unregistration
*/
__weak void arch_unregister_hw_breakpoint(struct perf_event *bp)
{
/*
* A weak stub function here for those archs that don't define
* it inside arch/.../kernel/hw_breakpoint.c
*/
}

/*
* Constraints to check before allowing this new breakpoint counter.
*
Expand Down Expand Up @@ -594,7 +574,6 @@ static int __reserve_bp_slot(struct perf_event *bp, u64 bp_type)
enum bp_type_idx type;
int max_pinned_slots;
int weight;
int ret;

/* We couldn't initialize breakpoint constraints on boot */
if (!constraints_initialized)
Expand All @@ -613,10 +592,6 @@ static int __reserve_bp_slot(struct perf_event *bp, u64 bp_type)
if (max_pinned_slots > hw_breakpoint_slots_cached(type))
return -ENOSPC;

ret = arch_reserve_bp_slot(bp);
if (ret)
return ret;

return toggle_bp_slot(bp, true, type, weight);
}

Expand All @@ -634,8 +609,6 @@ static void __release_bp_slot(struct perf_event *bp, u64 bp_type)
enum bp_type_idx type;
int weight;

arch_release_bp_slot(bp);

type = find_slot_idx(bp_type);
weight = hw_breakpoint_weight(bp);
WARN_ON(toggle_bp_slot(bp, false, type, weight));
Expand All @@ -645,7 +618,6 @@ void release_bp_slot(struct perf_event *bp)
{
struct mutex *mtx = bp_constraints_lock(bp);

arch_unregister_hw_breakpoint(bp);
__release_bp_slot(bp, bp->attr.bp_type);
bp_constraints_unlock(mtx);
}
Expand Down

0 comments on commit 53834a0

Please sign in to comment.