From: sashiko-bot@kernel.org
To: "Daniel Borkmann" <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 14/20] bpf, arm64: Shorten the tail call sequence
Date: Tue, 03 Nov 2026 12:36:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-195256@kernel.org> (raw)
In-Reply-To: <20261103122733.1383002-15-daniel@iogearbox.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] bpf, arm64: multi-line comment style violation in emit_bpf_tail_call()
--
commit 4fbf9f6098933836065a7c888c2383cfd6d009d7
Author: Daniel Borkmann <daniel@iogearbox.net>
bpf, arm64: Shorten the tail call sequence
This commit shortens the arm64 BPF tail call sequence by six instructions by
using immediate offset forms for struct member accesses and tail call count
comparison, along with an extended and scaled register offset load for the
program array lookup.
> diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
> index a327c90fe2c78..bc1ec8b179b2e 100644
> --- a/arch/arm64/net/bpf_jit_comp.c
> +++ b/arch/arm64/net/bpf_jit_comp.c
> @@ -905,13 +905,19 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx)
> __le32 *branch2 = NULL;
> __le32 *branch3 = NULL;
>
> - /* if (index >= array->map.max_entries)
> + /* The struct offsets fit the immediate forms, the count fits cmp */
> + BUILD_BUG_ON(offsetof(struct bpf_array, map.max_entries) % 4 ||
> + offsetof(struct bpf_array, map.max_entries) > 0xfff * 4);
> + BUILD_BUG_ON(offsetof(struct bpf_array, ptrs) > 0xfff);
> + BUILD_BUG_ON(offsetof(struct bpf_prog, bpf_func) % 8 ||
> + offsetof(struct bpf_prog, bpf_func) > 0xfff * 8);
> + BUILD_BUG_ON(MAX_TAIL_CALL_CNT > 0xfff);
> +
> + /* if ((u32)index >= array->map.max_entries)
> * goto out;
> */
[Severity: Low]
This isn't a bug, but in emit_bpf_tail_call() in arch/arm64/net/bpf_jit_comp.c,
should the modified multi-line comment place the opening /* on its own line
to follow the BPF coding style?
/*
* if ((u32)index >= array->map.max_entries)
* goto out;
*/
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261103122733.1383002-1-daniel@iogearbox.net?part=14
next prev parent reply other threads:[~2026-11-03 12:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 12:27 [PATCH bpf-next v2 00/20] bpf: Various arm64 BPF JIT improvements Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 01/20] bpf, arm64: Free the offset table of a subprog in bpf_jit_free Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 02/20] bpf, arm64: Free the private stack when a pass over the image fails Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 03/20] bpf, arm64: Emit ISB SY in the speculation barriers Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 04/20] arm64, insn: Reject sign extending loads of 64 bits Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 05/20] bpf, arm64: Keep the ll/sc atomics address apart from the old value Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 06/20] arm64, insn: Add the LDUR/STUR and TBZ/TBNZ encodings Daniel Borkmann
2026-11-03 17:46 ` Alexei Starovoitov
2026-11-03 12:27 ` [PATCH bpf-next v2 07/20] bpf: Move the division magic number selection out of the x86 JIT Daniel Borkmann
2026-11-03 13:06 ` bot+bpf-ci
2026-11-03 13:16 ` Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 08/20] bpf, arm64: Consolidate the load and store emission into a helper Daniel Borkmann
2026-11-03 17:45 ` Alexei Starovoitov
2026-11-03 12:27 ` [PATCH bpf-next v2 09/20] bpf, arm64: Use the unscaled forms for negative and unaligned offsets Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 10/20] bpf, arm64: Store zero immediates from the zero register Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 11/20] bpf, arm64: Zero extend the arena offset in register offset accesses Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 12/20] bpf, arm64: Adjust compares with unencodable immediates by one Daniel Borkmann
2026-11-03 13:06 ` bot+bpf-ci
2026-11-03 12:27 ` [PATCH bpf-next v2 13/20] bpf, arm64: Materialize immediates with fewer instructions Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 14/20] bpf, arm64: Shorten the tail call sequence Daniel Borkmann
2026-11-03 12:36 ` sashiko-bot [this message]
2026-11-03 12:57 ` Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 15/20] bpf, arm64: Divide by constants via multiplication with a magic number Daniel Borkmann
2026-11-03 17:49 ` Alexei Starovoitov
2026-11-03 12:27 ` [PATCH bpf-next v2 16/20] bpf, arm64: Use a move or mvn for the and and xor with all ones Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 17/20] bpf, arm64: Use cbz, cbnz, tbz and tbnz for zero, sign and bit tests Daniel Borkmann
2026-11-03 17:51 ` Alexei Starovoitov
2026-11-03 12:27 ` [PATCH bpf-next v2 18/20] bpf, arm64: Multiply by constants with shifts, adds and subs Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 19/20] selftests/bpf: Let the arm64 private stack check skip the BTI pad Daniel Borkmann
2026-11-03 12:27 ` [PATCH bpf-next v2 20/20] selftests/bpf: Extend the JIT instruction tests for arm64 encodings Daniel Borkmann
2026-11-03 13:06 ` bot+bpf-ci
2026-11-03 13:15 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-195256@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox