Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf/hw_breakpoint: Remove arch breakpoint hooks

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

authored by

Benjamin Gray and committed by
Michael Ellerman
53834a0c 58709f6f

-31
-3
include/linux/hw_breakpoint.h
··· 90 90 extern int dbg_release_bp_slot(struct perf_event *bp); 91 91 extern int reserve_bp_slot(struct perf_event *bp); 92 92 extern void release_bp_slot(struct perf_event *bp); 93 - int arch_reserve_bp_slot(struct perf_event *bp); 94 - void arch_release_bp_slot(struct perf_event *bp); 95 - void arch_unregister_hw_breakpoint(struct perf_event *bp); 96 93 97 94 extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); 98 95
-28
kernel/events/hw_breakpoint.c
··· 523 523 return 0; 524 524 } 525 525 526 - __weak int arch_reserve_bp_slot(struct perf_event *bp) 527 - { 528 - return 0; 529 - } 530 - 531 - __weak void arch_release_bp_slot(struct perf_event *bp) 532 - { 533 - } 534 - 535 - /* 536 - * Function to perform processor-specific cleanup during unregistration 537 - */ 538 - __weak void arch_unregister_hw_breakpoint(struct perf_event *bp) 539 - { 540 - /* 541 - * A weak stub function here for those archs that don't define 542 - * it inside arch/.../kernel/hw_breakpoint.c 543 - */ 544 - } 545 - 546 526 /* 547 527 * Constraints to check before allowing this new breakpoint counter. 548 528 * ··· 574 594 enum bp_type_idx type; 575 595 int max_pinned_slots; 576 596 int weight; 577 - int ret; 578 597 579 598 /* We couldn't initialize breakpoint constraints on boot */ 580 599 if (!constraints_initialized) ··· 592 613 if (max_pinned_slots > hw_breakpoint_slots_cached(type)) 593 614 return -ENOSPC; 594 615 595 - ret = arch_reserve_bp_slot(bp); 596 - if (ret) 597 - return ret; 598 - 599 616 return toggle_bp_slot(bp, true, type, weight); 600 617 } 601 618 ··· 609 634 enum bp_type_idx type; 610 635 int weight; 611 636 612 - arch_release_bp_slot(bp); 613 - 614 637 type = find_slot_idx(bp_type); 615 638 weight = hw_breakpoint_weight(bp); 616 639 WARN_ON(toggle_bp_slot(bp, false, type, weight)); ··· 618 645 { 619 646 struct mutex *mtx = bp_constraints_lock(bp); 620 647 621 - arch_unregister_hw_breakpoint(bp); 622 648 __release_bp_slot(bp, bp->attr.bp_type); 623 649 bp_constraints_unlock(mtx); 624 650 }