Commit a8b8cce9 authored by Ada Couprie Diaz's avatar Ada Couprie Diaz Committed by Will Deacon
Browse files

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: default avatarAda Couprie Diaz <ada.coupriediaz@arm.com>
Tested-by: default avatarLuis Claudio R. Goncalves <lgoncalv@redhat.com>
Reviewed-by: default avatarWill Deacon <will@kernel.org>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250707114109.35672-14-ada.coupriediaz@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent fc5e5d04
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -94,7 +94,5 @@ static inline bool try_step_suspended_breakpoints(struct pt_regs *regs)

bool try_handle_aarch32_break(struct pt_regs *regs);

void debug_traps_init(void);

#endif	/* __ASSEMBLY */
#endif	/* __ASM_DEBUG_MONITORS_H */
+0 −6
Original line number Diff line number Diff line
@@ -59,8 +59,6 @@ void do_el0_bti(struct pt_regs *regs);
void do_el1_bti(struct pt_regs *regs, unsigned long esr);
void do_el0_gcs(struct pt_regs *regs, unsigned long esr);
void do_el1_gcs(struct pt_regs *regs, unsigned long esr);
void do_debug_exception(unsigned long addr_if_watchpoint, unsigned long esr,
			struct pt_regs *regs);
#ifdef CONFIG_HAVE_HW_BREAKPOINT
void do_breakpoint(unsigned long esr, struct pt_regs *regs);
void do_watchpoint(unsigned long addr, unsigned long esr,
@@ -94,8 +92,4 @@ void do_serror(struct pt_regs *regs, unsigned long esr);
void do_signal(struct pt_regs *regs);

void __noreturn panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigned long far);

void debug_exception_enter(struct pt_regs *regs);
void debug_exception_exit(struct pt_regs *regs);

#endif	/* __ASM_EXCEPTION_H */
+0 −4
Original line number Diff line number Diff line
@@ -25,10 +25,6 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
		      int signo, int sicode, unsigned long far,
		      unsigned long err);

void hook_debug_fault_code(int nr, int (*fn)(unsigned long, unsigned long,
					     struct pt_regs *),
			   int sig, int code, const char *name);

struct mm_struct;
extern void __show_regs(struct pt_regs *);

+0 −3
Original line number Diff line number Diff line
@@ -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)
{
+2 −2
Original line number Diff line number Diff line
@@ -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();
}
Loading