[PATCH v2 07/11] arm64: debug: split single stepping exception entry

Will Deacon will at kernel.org
Thu May 29 03:10:54 PDT 2025


On Wed, May 28, 2025 at 04:22:05PM +0100, Mark Rutland wrote:
> On Tue, May 20, 2025 at 05:29:14PM +0100, Will Deacon wrote:
> > On Mon, May 12, 2025 at 06:43:22PM +0100, Ada Couprie Diaz wrote:
> > > +	enter_from_user_mode(regs);
> > > +	/*
> > > +	 * After handling a breakpoint, we suspend the breakpoint
> > > +	 * and use single-step to move to the next instruction.
> > > +	 * If we have a suspended breakpoint there's nothing more to do:
> > > +	 * complete the single-step.
> > > +	 */
> > > +	if (reinstall_suspended_bps(regs)) {
> > > +		local_daif_restore(DAIF_PROCCTX);
> > > +		do_softstep(esr, regs);
> > > +	}
> > > +	exit_to_user_mode(regs);
> > 
> > I quite like the look of this now, but perhaps we could rename
> > reinstall_suspended_bps() and change the return value to make things a
> > bit more readable? For example, 'if (!stepped_suspended_breakpt(regs))'
> > or something like that? What do you think?
> 
> How about:
> 
> 	if (!try_step_suspended_breakpoints(regs))
> 
> ... that'd match the naming in do_el0_undef() and do_el1_undef() in
> traps.c, where we have try_${HANDLE_POTENTIAL_CASE}() for a few cases,
> e.g.

That's even better, thanks.

Will



More information about the linux-arm-kernel mailing list