On Sat, 9 Aug 2025 at 22:48, Puranjay Mohan <puranjay@xxxxxxxxxx> wrote: > > Changes in v1->v2: > v1: https://lore.kernel.org/bpf/20250724125443.26182-1-puranjay@xxxxxxxxxx/ > - Added comment in arch_bpf_timed_may_goto() about BPF_REG_FP setup (Xu > Kuohai) > > This set adds support for the timed may_goto instruction for the arm64. > The timed may_goto instruction is implemented by the verifier by > reserving 2 8byte slots in the program stack and then calling > arch_bpf_timed_may_goto() in a loop with the stack offset of these two > slots in BPF_REG_AX. It expects the function to put a timestamp in the > first slot and the returned count in BPF_REG_AX is put into the second > slot by a store instruction emitted by the verifier. > > arch_bpf_timed_may_goto() is special as it receives the parameter in > BPF_REG_AX and is expected to return the result in BPF_REG_AX as well. > It can't clobber any caller saved registers because verifier doesn't > save anything before emitting the call. > > So, arch_bpf_timed_may_goto() is implemented in assembly so the exact > registers that are stored/restored can be controlled (BPF caller saved > registers here) and it also needs to take care of moving arguments and > return values to and from BPF_REG_AX <-> arm64 R0. > > So, arch_bpf_timed_may_goto() acts as a trampoline to call > bpf_check_timed_may_goto() which does the main logic of placing the > timestamp and returning the count. > > All tests that use may_goto instruction pass after the changing some of > them in patch 2 For the set, Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> Xu, can you also provide your acks before we land? Thanks > > [...] >