Subject: Re: [PATCH bpf-next v2 1/3] bpf, arm64: Map BPF_REG_0 to x8 instead of x7

From: Will Deacon <[email-masked]>
Date: Thu, 28 May 2026 14:42:28 +0100

On Mon, Apr 27, 2026 at 04:47:58PM -0700, Puranjay Mohan wrote:
> Move the BPF return value register from x7 to x8, freeing x7 for use
> as an argument register. AAPCS64 designates x8 as the indirect result
> location register; it is caller-saved and not used for argument
> passing, making it a suitable home for BPF_REG_0.
> 
> This is a prerequisite for stack argument support, which needs x5-x7
> to pass arguments 6-8 to native kfuncs following the AAPCS64 calling
> convention.
> 
> Signed-off-by: Yonghong Song <[email-masked]>
> Signed-off-by: Puranjay Mohan <[email-masked]>
> ---
>  arch/arm64/net/bpf_jit_comp.c                          |  4 ++--
>  arch/arm64/net/bpf_timed_may_goto.S                    |  8 ++++----
>  .../testing/selftests/bpf/progs/verifier_jit_inline.c  |  2 +-
>  tools/testing/selftests/bpf/progs/verifier_ldsx.c      |  6 +++---
>  .../selftests/bpf/progs/verifier_private_stack.c       | 10 +++++-----
>  5 files changed, 15 insertions(+), 15 deletions(-)

Makes sense to me:

Acked-by: Will Deacon <[email-masked]>

Will