Re: [PATCH bpf-next 4/5] bpf: simplify the bpf_is_reg64() signature
[email protected] Fri, 31 Jul 2026 20:09:52 +0000 (UTC)
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <41de1b91c637814541763c352b7254d39f2f44cb4810e646022f31c98e55a37f@mail.kernel.org> |
> bpf: simplify the bpf_is_reg64() signature
>
> After the previous commit this function is only used in a context
> where destination register's property is queried.
> Hence, simplify the function by removing the 'regno' and 't'
> parameters.
The changelog appears to undercount the removed parameters. Looking at the
actual signature change:
include/linux/bpf_verifier.h:
-bool bpf_is_reg64(struct bpf_insn *insn, u32 regno, struct bpf_reg_state *reg, enum bpf_reg_arg_type t);
+bool bpf_is_reg64(struct bpf_insn *insn);
Three parameters are dropped: regno, reg, and t. The message mentions only
'regno' and 't', omitting 'struct bpf_reg_state *reg'.
The reg parameter isn't incidental: it was the only pointer argument, both
call sites passed NULL for it, and its removal retires the contract that
the BPF_STX SRC_OP arm relied on. The fixups.c comment at line 622
explicitly documented this:
kernel/bpf/fixups.c:
/* NOTE: arg "reg" (the fourth one) is only used for
* BPF_STX + SRC_OP, so it is safe to pass NULL
* here.
*/
if (bpf_is_reg64(&insn)) {
Could the message say 'removing the regno, reg and t parameters' (or
'removing all parameters except insn') so readers following the series can
account for all three removals?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/30658911996