[PATCH v3 09/13] arm64: debug: split single stepping exception entry
Ada Couprie Diaz
ada.coupriediaz at arm.com
Wed Jun 18 03:14:31 PDT 2025
On 18/06/2025 07:25, Anshuman Khandual wrote:
> On 09/06/25 11:04 PM, Ada Couprie Diaz wrote:
>> [...]
>>
>> diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
>> index 74ffdfeff76f..3f5503d61aee 100644
>> --- a/arch/arm64/kernel/debug-monitors.c
>> +++ b/arch/arm64/kernel/debug-monitors.c
>> @@ -21,6 +21,7 @@
>> #include <asm/cputype.h>
>> #include <asm/daifflags.h>
>> #include <asm/debug-monitors.h>
>> +#include <asm/exception.h>
>> #include <asm/kgdb.h>
>> #include <asm/kprobes.h>
>> #include <asm/system_misc.h>
>> @@ -188,18 +189,10 @@ static void send_user_sigtrap(int si_code)
>> "User debug trap");
>> }
>>
>> -static int single_step_handler(unsigned long unused, unsigned long esr,
>> - struct pt_regs *regs)
>> +void do_softstep(unsigned long esr, struct pt_regs *regs)
> do_softstep() has been chosen here just to match the corresponding ESR
> macros ESR_ELx_EC_SOFTSTP_[LOW|CUR] - although it does make sense and
> also consistent.
Exactly, that was the thinking !
>> {
>> - /*
>> - * If we are stepping a pending breakpoint, call the hw_breakpoint
>> - * handler first.
>> - */
>> - if (try_step_suspended_breakpoints(regs))
>> - return 0;
> This check has been moved individual exception handling functions.
Correct, as per explanation in the commit message
>> diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
>> index be2add6b4ae3..5fb636efd554 100644
>> --- a/arch/arm64/kernel/entry-common.c
>> +++ b/arch/arm64/kernel/entry-common.c
>> @@ -535,6 +535,24 @@ static void noinstr el1_breakpt(struct pt_regs *regs, unsigned long esr)
>> arm64_exit_el1_dbg(regs);
>> }
>>
>> +static void noinstr el1_softstp(struct pt_regs *regs, unsigned long esr)
>> +{
>> + arm64_enter_el1_dbg(regs);
>> + if (!cortex_a76_erratum_1463225_debug_handler(regs)) {
> Although mentioned in the commit message, this constraint is not
> there in the present code though.
I believe it is : in mainline it is done for all EL1 debug exceptions in
`el1_dbg()`[0], unless I misunderstood your comment ?
Thanks for the review Anshuman !
Ada
[0]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/entry-common.c#n507
More information about the linux-arm-kernel
mailing list