[PATCH v4 04/13] arm64: debug: call step handlers statically
Will Deacon
will at kernel.org
Fri Jun 27 08:45:40 PDT 2025
On Fri, Jun 20, 2025 at 10:11:58PM +0100, Ada Couprie Diaz wrote:
> Software stepping checks for the correct handler by iterating over a list
> of dynamically registered handlers and calling all of them until one
> handles the exception.
>
> This is the only generic way to handle software stepping handlers in arm64
> as the exception does not provide an immediate that could be checked,
> contrary to software breakpoints.
>
> However, the registration mechanism is not exported and has only
> two current users : the KGDB stepping handler, and the uprobe single step
> handler.
> Given that one comes from user mode and the other from kernel mode, call
> the appropriate one by checking the source EL of the exception.
> Add a stand-in that returns DBG_HOOK_ERROR when the configuration
> options are not enabled.
>
> Remove `arch_init_uprobes()` as it is not useful anymore and is
> specific to arm64.
>
> Unify the naming of the handler to XXX_single_step_handler(), making it
> clear they are related.
>
> Signed-off-by: Ada Couprie Diaz <ada.coupriediaz at arm.com>
> Tested-by: Luis Claudio R. Goncalves <lgoncalv at redhat.com>
> ---
> arch/arm64/include/asm/kgdb.h | 9 +++++++++
> arch/arm64/include/asm/uprobes.h | 9 +++++++++
> arch/arm64/kernel/debug-monitors.c | 25 ++++++-------------------
> arch/arm64/kernel/kgdb.c | 17 +++--------------
> arch/arm64/kernel/probes/uprobes.c | 15 +--------------
> 5 files changed, 28 insertions(+), 47 deletions(-)
Reviewed-by: Will Deacon <will at kernel.org>
Will
More information about the linux-arm-kernel
mailing list