[PATCH v4 10/13] arm64: debug: split hardware watchpoint exception entry
Will Deacon
will at kernel.org
Fri Jun 27 08:46:58 PDT 2025
On Fri, Jun 20, 2025 at 10:12:04PM +0100, Ada Couprie Diaz wrote:
> Currently all debug exceptions share common entry code and are routed
> to `do_debug_exception()`, which calls dynamically-registered
> handlers for each specific debug exception. This is unfortunate as
> different debug exceptions have different entry handling requirements,
> and it would be better to handle these distinct requirements earlier.
>
> Hardware watchpoints are the only debug exceptions that will write
> FAR_EL1, so we need to preserve it and pass it down.
> However, they cannot be used to maliciously train branch predictors, so
> we can omit calling `arm64_bp_hardening()`, nor do they need to handle
> the Cortex-A76 erratum #1463225, as it only applies to single stepping
> exceptions.
>
> As the hardware watchpoint handler only returns 0 and never triggers
> the call to `arm64_notify_die()`, we can call it directly from
> `entry-common.c`.
> Split the hardware watchpoint exception entry and adjust the behaviour
> to match the lack of needed mitigations.
>
> 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/exception.h | 2 ++
> arch/arm64/kernel/entry-common.c | 31 +++++++++++++++++++++++++++++-
> arch/arm64/kernel/hw_breakpoint.c | 17 +++++-----------
> 3 files changed, 37 insertions(+), 13 deletions(-)
Reviewed-by: Will Deacon <will at kernel.org>
Will
More information about the linux-arm-kernel
mailing list