[PATCH] arm64: Fix early single-stepping

Jean-Philippe Brucker jean-philippe at linaro.org
Wed Oct 28 05:48:27 EDT 2020


On Wed, Oct 28, 2020 at 06:07:31PM +0900, Masami Hiramatsu wrote:
> > > Yes, I think so. Same order problem as the OS lock, they need to be reset
> > > before enable_debug_monitors(). On CPU0 that would be before
> > > early_initcall and for secondaries the hotplug notifier needs to be
> > > installed earlier as well. I'll send a v2.
> > 
> > Cheers. An alternative (which I think would be better in the long run
> > anyway) would be to avoid using hardware step in kprobes and instead rely
> > on a BRK instruction to trap after running the trampoline.
> 
> But how we trap the instruction which can change pc? (like br?)
> Are all those instruction emulated now?

According to aarch64_insn_is_steppable() anything that changes the PC is
emulated. I'm also checking whether there is a change of behavior with
synchronous exceptions taken while single-stepping (page faults).

Thanks,
Jean



More information about the linux-arm-kernel mailing list