diff options
| author | Ada Couprie Diaz <ada.coupriediaz@arm.com> | 2025-07-07 12:41:09 +0100 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2025-07-08 13:27:42 +0100 |
| commit | a8b8cce9d96d65dfe3d89abf02033151f8b7d670 (patch) | |
| tree | 9fedbcfcffdd668040aec442ba2b89344e267641 /arch/arm64/kernel | |
| parent | fc5e5d0477c532054ce8692fd16fdaab2cb8946f (diff) | |
arm64: debug: remove debug exception registration infrastructure
Now that debug exceptions are handled individually and without the need
for dynamic registration, remove the unused registration infrastructure.
This removes the external caller for `debug_exception_enter()` and
`debug_exception_exit()`.
Make them static again and remove them from the header.
Remove `early_brk64()` as it has been made redundant by
(arm64: debug: split brk64 exception entry) and is not used anymore.
Note : in `early_brk64()` `bug_brk_handler()` is called unconditionally
as a fall-through, but now `call_break_hook()` only calls it if the
immediate matches.
This does not change the behaviour in early boot, as if
`bug_brk_handler()` was called on a non-BUG immediate it would return
DBG_HOOK_ERROR anyway, which `call_break_hook()` will do if no immediate
matches.
Remove `trap_init()`, as it would be empty and a weak definition already
exists in `init/main.c`.
Signed-off-by: Ada Couprie Diaz <ada.coupriediaz@arm.com>
Tested-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Reviewed-by: Will Deacon <will@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250707114109.35672-14-ada.coupriediaz@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel')
| -rw-r--r-- | arch/arm64/kernel/debug-monitors.c | 3 | ||||
| -rw-r--r-- | arch/arm64/kernel/entry-common.c | 4 | ||||
| -rw-r--r-- | arch/arm64/kernel/traps.c | 27 |
3 files changed, 2 insertions, 32 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 43a612eaa7d2..43f342a01fdf 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -316,9 +316,6 @@ bool try_handle_aarch32_break(struct pt_regs *regs) } NOKPROBE_SYMBOL(try_handle_aarch32_break); -void __init debug_traps_init(void) -{} - /* Re-enable single step for syscall restarting. */ void user_rewind_single_step(struct task_struct *task) { diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c index bbf58fcab142..4b67312a88ad 100644 --- a/arch/arm64/kernel/entry-common.c +++ b/arch/arm64/kernel/entry-common.c @@ -448,7 +448,7 @@ static __always_inline void fpsimd_syscall_exit(void) * accidentally schedule in exception context and it will force a warning * if we somehow manage to schedule by accident. */ -void debug_exception_enter(struct pt_regs *regs) +static void debug_exception_enter(struct pt_regs *regs) { preempt_disable(); @@ -457,7 +457,7 @@ void debug_exception_enter(struct pt_regs *regs) } NOKPROBE_SYMBOL(debug_exception_enter); -void debug_exception_exit(struct pt_regs *regs) +static void debug_exception_exit(struct pt_regs *regs) { preempt_enable_no_resched(); } diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 654c8ea46ec6..98b11da5a5ad 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -1100,30 +1100,3 @@ int ubsan_brk_handler(struct pt_regs *regs, unsigned long esr) return DBG_HOOK_HANDLED; } #endif - -/* - * Initial handler for AArch64 BRK exceptions - * This handler only used until debug_traps_init(). - */ -int __init early_brk64(unsigned long addr, unsigned long esr, - struct pt_regs *regs) -{ -#ifdef CONFIG_CFI_CLANG - if (esr_is_cfi_brk(esr)) - return cfi_brk_handler(regs, esr) != DBG_HOOK_HANDLED; -#endif -#ifdef CONFIG_KASAN_SW_TAGS - if ((esr_brk_comment(esr) & ~KASAN_BRK_MASK) == KASAN_BRK_IMM) - return kasan_brk_handler(regs, esr) != DBG_HOOK_HANDLED; -#endif -#ifdef CONFIG_UBSAN_TRAP - if (esr_is_ubsan_brk(esr)) - return ubsan_brk_handler(regs, esr) != DBG_HOOK_HANDLED; -#endif - return bug_brk_handler(regs, esr) != DBG_HOOK_HANDLED; -} - -void __init trap_init(void) -{ - debug_traps_init(); -} |
