[PATCH v2] RFC: ARM: breakpoint: CFI breakpoints only on demand
Linus Walleij
linusw at kernel.org
Fri Jul 3 04:47:14 PDT 2026
On Fri, Jul 3, 2026 at 10:59 AM Mark Rutland <mark.rutland at arm.com> wrote:
> AFAICT, hw_breakpoint_cfi_handler() is only intended to handle
> BKPT instructions executed in kernel mode, and even when the kernel is
> build with CF support, it doesn't make sense to call that for BKPT
> instructions executed in user mode.
>
> On arm64, we have separate paths for BRK exceptions from user mode
> (do_el0_brk64()) and kernel mode (do_el1_brk64()).
>
> Surely you can check kernel_mode(regs) or user_mode(regs) to distinguish
> the two cases, and only call hw_breakpoint_cfi_handler() when the
> exception was taken from kernel mode?
You're right of course... I'll add a check like that and see if this
solves the problem for the reporter.
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list