Re: [PATCH bpf v2 1/2] bpf: Fix tracing of kfuncs with implicit args

From: Eduard Zingerman

Date: Mon Jul 13 2026 - 13:04:32 EST


On Mon, 2026-07-13 at 09:48 -0700, Ihor Solodrai wrote:

[...]

> It was silly of me to mention the analysis as an obstacle (which I'm
> not excited to do, sure). We are at -rc3, so there is a couple of
> weeks still if we are targeting 7.2
>
> But resolve_btfids series is certainly a merge-window thing, so the
> fix shouldn't depend on it. And even carving out build-time KF_ flag
> consistentcy enforcement from there is too potentially disruptive for
> a "fix" IMO.
>
> How about the following plan.
>
> In the fix:
>    * delete btf_kfunc_accumulated_flags()
>    * expose (back) btf_kfunc_id_set_contains() from btf.c
>    * in btf_attach_func_proto() walk the hooks and specifically check
>      for *consistent* KF_IMPLICIT_ARGS
>    * -EINVAL on inconsistency
>
> In the v2 of resolve_btfids series (targeting 7.3):
>    * implement kbuild/module-time enforcement of consistency
>      for *all* KF_ flags
>    * fix in-tree cases where that's not true
>    * if there is a valid use-case, it should show up as a blocker, but
>      I'll also eyeball all the kfunc set declarations
>
> Does this make sense?

You can do it like that, but tbh I that think doing it in two phases
complicates the process unnecessarily.