libbpf: Support kernel-side kfunc flavors
Subsystems (7)
Ihor Solodrai
reviewercover libbpf: Support kernel-side kfunc flavors
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
sched_ext ran into this. cded46d97159 ("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype as scx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them. 2dbbdeda77a6 ("sched_ext: Fix scx_bpf_dsq_insert() backward binary compatibility") reversed the naming. A ___v2 kfunc declared as vmlinux.h spells it doesn't bind: 56bbc91219c0 ("sched_ext: Fix scx_bpf_dsq_move_to_local___v2 compat detection") fixed a compat macro that silently dropped enq_flags because of this.
With this series, if the kernel's bpf_foo kfunc is missing or its prototype is incompatible with the declaration, libbpf binds the bpf_foo___<flavor> that has a compatible prototype. So a changed kfunc can keep its name, and the old prototype stays available as foo___v1.
resolve_btfids fails the build if two of bpf_foo and its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures at kernel / module build time that no ambigous kfunc flavors exist. Documentation/bpf/kfuncs.rst describes the rules.
Compatibility is determined by bpf_core_types_are_compat(), the check libbpf already applies to kfuncs. Of the 70 same-name kfunc prototype changes between v6.6 and bpf-next, it finds 8 incompatible (arity, return kind, callback prototype). The other 62 (const, typedefs, parameter names, integer widths, pointee struct names, annotation suffixes) were made in place without breaking old callers.
The flavors feature is backwards compatible: declarations that resolve today bind the same kernel function. The exact name lookup is attempted first. Declarations rejected today for an incompatible prototype, or left unresolved if __weak, may now bind to a flavor, for example scx_bpf_dsq_insert___v2 as vmlinux.h declares it. Older libbpf and light skeletons don't get the fallback.
---
Ihor Solodrai (4):
libbpf: Fall back to kernel ___ flavors when resolving kfuncs selftests/bpf: Test kfunc flavor resolution
resolve_btfids: Reject kfunc families that libbpf can't disambiguate docs/bpf: Describe how to change a kfunc's prototype
Documentation/bpf/kfuncs.rst | 83 +++++++++++ tools/bpf/resolve_btfids/btf_colors.c | 11 ++ tools/bpf/resolve_btfids/btf_colors.h | 3 + tools/bpf/resolve_btfids/main.c | 134 +++++++++++++++++ tools/lib/bpf/btf.c | 26 ++++ tools/lib/bpf/libbpf.c | 140 +++++++++++++++++- tools/lib/bpf/libbpf_internal.h | 1 + .../selftests/bpf/prog_tests/verifier.c | 3 + .../selftests/bpf/progs/kfunc_flavors.c | 55 +++++++ .../selftests/bpf/test_kmods/bpf_testmod.c | 24 +++ .../bpf/test_kmods/bpf_testmod_kfunc.h | 4 + 11 files changed, 482 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/kfunc_flavors.c
base-commit: 32b66b94c86f009b49668de7340f2ed65aad2dc5
Signature · 1 line
2.56.1
Ihor Solodrai
reviewerPATCH 1/4 libbpf: Fall back to kernel ___ flavors when resolving kfuncs
When resolving a kfunc, libbpf strips the ___<flavor> suffix from its name and binds the kfunc with the resulting name if its prototype is compatible. So when a kfunc foo changes its prototype, the kernel can't keep the old one available to existing BPF programs as foo___v1: they declare foo, and libbpf never looks at foo___v1.
sched_ext worked around this by giving the new prototype the name scx_bpf_dsq_insert___v2 and spelling it scx_bpf_dsq_insert___v2___compat in BPF programs, so that the stripped name matches the kernel name exactly. That leaks kernel naming into BPF programs, and calling the kfunc as vmlinux.h declares it fails: scx_bpf_dsq_insert___v2 strips to scx_bpf_dsq_insert, whose prototype is incompatible.
If the kfunc with the stripped name is missing or its prototype is incompatible, look among the kfuncs named <name>___<flavor>, in vmlinux first and then in the first module that has any, and bind the one whose prototype is compatible. Only FUNCs with the bpf_kfunc decl tag are candidates. More than one compatible flavor is an error even for a kfunc declared __weak: ambiguity isn't absence.
The lookup of the stripped name comes first and is unchanged, so bindings that work today stay the same.
Print the name of the chosen kfunc in the debug message.
--- tools/lib/bpf/btf.c | 26 ++++++ tools/lib/bpf/libbpf.c | 140 +++++++++++++++++++++++++++++++- tools/lib/bpf/libbpf_internal.h | 1 + 3 files changed, 165 insertions(+), 2 deletions(-)
tools/lib/bpf/btf.c +26 -0
@@ -1164,6 +1164,32 @@ static __s32 btf_find_type_by_name_bsearch(const struct btf *btf, const char *nareturn btf__type_cnt (btf); } +/* +* Set [*start, *end) to the IDs of btf's own types that can have a name +* starting with prefix. On BTF sorted by name these are exactly the ones that +* do, a contiguous run found by binary search; otherwise all own types. +*/ +void btf_name_prefix_range (const struct btf *btf,const char *prefix,__u32 *start,__u32 *end) +{ +__u32 i, n =btf__type_cnt (btf); +size_t len =strlen (prefix); + +if (btf->named_start_id <=0 ) { + *start = btf->start_id; + *end = n; +return ; + } + *start =btf_find_type_by_name_bsearch (btf, prefix, btf->named_start_id); +for (i = *start; i < n; i++) { +const struct btf_type *t =btf_type_by_id (btf, i); +const char *name =btf__str_by_offset (btf, t->name_off); + +if (strncmp (name, prefix, len) !=0 ) +break ; + } + *end = i; +} +static __s32 btf_find_by_name_kind (const struct btf *btf,int start_id,const char *type_name,__s32 kind) {
tools/lib/bpf/libbpf.c +138 -2
158 lines not on this page · raw message
tools/lib/bpf/libbpf_internal.h +1 -0
@@ -248,6 +248,7 @@ struct btf_type *btf_type_by_id(const struct btf *btf, __u32 type_id);const char *btf_kind_str (const struct btf_type *t);const struct btf_type *skip_mods_and_typedefs (const struct btf *btf,__u32 id,__u32 *res_id);const struct btf_header *btf_header (const struct btf *btf); +void btf_name_prefix_range (const struct btf *btf,const char *prefix,__u32 *start,__u32 *end);void btf_set_base_btf (struct btf *btf,const struct btf *base_btf);int btf_relocate (struct btf *btf,const struct btf *base_btf,__u32 **id_map,__u32 **str_map);
Signature · 1 line
2.56.1
Eduard Zingerman
maintainerRe: [PATCH bpf-next v1 1/4] libbpf: Fall back to kernel ___ flavors when resolving kfuncs
On Tue, 2026-11-17 at 12:21 -0700, Ihor Solodrai wrote:
...
Quoted 8 lines
tools/lib/bpf/libbpf.c +8
-0+/* id is a kfunc named <name>___<flavor>, where len is strlen(name) */ +static bool btf_is_kfunc_flavor (const struct btf *btf,int id,const char *name,size_t len) +{ +const struct btf_type *t =btf__type_by_id (btf, id); +const char *kname; + +if (!btf_is_func (t)) +return false;
tools/lib/bpf/libbpf.c static int bpf_object__resolve_ksym_var_btf_id(struct bpf_object *obj, · line 9559
Quoted 10 lines
tools/lib/bpf/libbpf.c +10
-0+ kname =btf__name_by_offset (btf, t->name_off); +if (strncmp (kname, name, len) !=0 ) +return false; +/* kname is <name> itself, already tried by the exact lookup */ +if (kname[len] =='\0' ) +return false; +if (bpf_core_essential_name_len (kname) != len) +return false; +return btf_is_kfunc (btf, id); +}
Why is btf_is_kfunc filter necessary?
As far as I understand, main kfunc resolution logic does not check for it. Having different rules for exact name matches and for flavoured matches seem to be inconsistent for no good reason.
...
Quoted 5 lines
(quoted diff) +0
-0@@ -9526,6 +9650,17 @@ static int bpf_object__resolve_ksym_func_btf_id(struct bpf_object *obj,
kfunc_id=find_ksym_btf_id(obj, ext->essent_name ?: ext->name, BTF_KIND_FUNC, &kern_btf, &mod_btf);tools/lib/bpf/libbpf.c +1
-0+if (need_kfunc_flavor (obj, ext, kern_btf, kfunc_id)) {
tools/lib/bpf/libbpf.c static int bpf_object__resolve_ksym_func_btf_id(struct bpf_object *obj, · line 9663
Quoted 10 lines
tools/lib/bpf/libbpf.c +10
-0+ ret =find_kfunc_flavor_btf_id (obj, ext, &kern_btf, &mod_btf); +if (ret == -ENOTUNIQ ) { +/* an error even if declared __weak: ambiguity isn't absence */ +pr_warn ("extern (func ksym) '%s': more than one compatible kfunc flavor\n" , + ext->name); +return ret; + } +if (ret && ret != -ESRCH ) + kfunc_id = ret; + }
Idk, I don't like that this is implemented as a special case:
- Check exact name match first.
- Check flavours in a separate loop.
It appears that having a single loop looking for name candidates is a bit better from code structuring point of view.
Quoted 3 lines
if (
kfunc_id< 0) {
if (kfunc_id==-ESRCH&&ext->is_weak) return 0;
...
Ihor Solodrai
reviewerPATCH 2/4 selftests/bpf: Test kfunc flavor resolution
In reply to Ihor SolodraiAdd a kfunc family to bpf_testmod: bpf_kfunc_flavor() with the current prototype, bpf_kfunc_flavor___v1() with an older one that takes one fewer parameter, and bpf_kfunc_flavor___v2(), an alias with the exact prototype of bpf_kfunc_flavor().
Check that libbpf binds:
- bpf_kfunc_flavor to the kfunc itself rather than to its alias ___v2;
- the old prototype to ___v1, both under a local flavor and under the kernel name, as a header generated from BTF spells it;
- the kernel name with a local flavor on top to ___v1;
- a __weak kfunc that matches no member to nothing.
--- .../selftests/bpf/prog_tests/verifier.c | 3 + .../selftests/bpf/progs/kfunc_flavors.c | 55 +++++++++++++++++++ .../selftests/bpf/test_kmods/bpf_testmod.c | 24 ++++++++ .../bpf/test_kmods/bpf_testmod_kfunc.h | 4 ++ 4 files changed, 86 insertions(+) create mode 100644 tools/testing/selftests/bpf/progs/kfunc_flavors.c
tools/testing/selftests/bpf/prog_tests/verifier.c +3 -0
@@ -8,6 +8,7 @@#include "cap_helpers.h" #include "sysctl_helpers.h" #include "cb_refs.skel.h" +#include "kfunc_flavors.skel.h" #include "verifier_aggregate_arg.skel.h" #include "verifier_aggregate_ret.skel.h" #include "verifier_alu_range.skel.h"
@@ -220,6 +221,8 @@ void test_arena_kfunc_jit(void) { RUN_TESTS(arena_kfunc_jit); }void test_cb_refs (void ) {RUN_TESTS (cb_refs); } +void test_kfunc_flavors (void ) {RUN_TESTS (kfunc_flavors); } +void test_verifier_aggregate_arg (void ) {RUN_TESTS (verifier_aggregate_arg); }void test_verifier_aggregate_ret (void ) {RUN_TESTS (verifier_aggregate_ret); }void test_verifier_alu_range (void ) {RUN (verifier_alu_range); }
tools/testing/selftests/bpf/progs/kfunc_flavors.c new file +55 -0
55 lines not on this page · raw message
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +24 -0
@@ -1926,6 +1926,27 @@ __bpf_kfunc void bpf_kfunc_trigger_ctx_check(void)irq_work_queue (&ctx_check_irq); } +/* +* A kfunc family for the kfunc_flavors test: bpf_kfunc_flavor() has the +* current prototype, ___v1 an older one, and ___v2 is an alias with its exact +* prototype. ___v2 negates the result, so that the test can tell which of the +* two it called. +*/ +__bpf_kfunc int bpf_kfunc_flavor(int a, int b) +{ +return a + b; +} + +__bpf_kfunc int bpf_kfunc_flavor___v1(int a) +{ +return bpf_kfunc_flavor (a,0 ); +} + +__bpf_kfunc int bpf_kfunc_flavor___v2(int a, int b) +{ +return -bpf_kfunc_flavor (a, b); +} + BTF_KFUNCS_START(bpf_testmod_check_kfunc_ids) BTF_ID_FLAGS(func, bpf_testmod_test_mod_kfunc, KF_SPINLOCK_SAFE) BTF_ID_FLAGS(func, bpf_kfunc_call_test1)
@@ -2017,6 +2038,9 @@ BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg, KF_IMPLICIT_ARGS) BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg_legacy, KF_IMPLICIT_ARGS) BTF_ID_FLAGS(func, bpf_kfunc_implicit_arg_legacy_impl) BTF_ID_FLAGS(func, bpf_kfunc_trigger_ctx_check) +BTF_ID_FLAGS(func, bpf_kfunc_flavor) +BTF_ID_FLAGS(func, bpf_kfunc_flavor___v1) +BTF_ID_FLAGS(func, bpf_kfunc_flavor___v2)BTF_KFUNCS_END (bpf_testmod_check_kfunc_ids) static int bpf_testmod_ops_init(struct btf *btf)
tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h +4 -0
@@ -381,4 +381,8 @@ void bpf_testmod_test_hardirq_fn(void);void bpf_testmod_test_softirq_fn (void ); void bpf_kfunc_trigger_ctx_check(void) __ksym; +int bpf_kfunc_flavor(int a, int b) __ksym; +int bpf_kfunc_flavor___v1(int a) __ksym; +int bpf_kfunc_flavor___v2(int a, int b) __ksym; +#endif /* _BPF_TESTMOD_KFUNC_H */
Signature · 1 line
2.56.1
Ihor Solodrai
reviewerPATCH 3/4 resolve_btfids: Reject kfunc families that libbpf can't disambiguate
In reply to Ihor SolodraiKfuncs sharing an essential name, foo and foo___<flavor>, form a family. When resolving a kfunc foo, libbpf binds the kernel's foo if the prototypes are compatible, and otherwise the only family member whose prototype passes bpf_core_types_are_compat() against the declaration. That is only safe if no declaration can be compatible with two members at once.
bpf_core_types_are_compat() compares prototypes kind by kind, so it acts as an equivalence and a pairwise check is enough. Run it on every pair of family members after dedup, using libbpf's own function, and fail the build if any pair is compatible. A foo___<flavor> with the same deduplicated FUNC_PROTO as foo is an alias and is allowed: libbpf binds foo first, so the alias is never picked in its place. There is only one foo: btf_check_kfunc_name() refuses to register a module kfunc named like a function in vmlinux or in another module. Dedup compares parameter names too, so an alias has to copy the signature verbatim.
Recognize family members by their bpf_kfunc decl tags rather than by the BTF ID sets. The tags are what libbpf filters candidates on, and for a module they also cover the vmlinux kfuncs in base BTF, so module kfuncs get checked against vmlinux kfuncs of the same family.
The bpf_kfunc_flavor family in bpf_testmod passes: ___v1 differs in arity and ___v2 is an alias.
--- tools/bpf/resolve_btfids/btf_colors.c | 11 +++ tools/bpf/resolve_btfids/btf_colors.h | 3 + tools/bpf/resolve_btfids/main.c | 134 ++++++++++++++++++++++++++ 3 files changed, 148 insertions(+)
tools/bpf/resolve_btfids/btf_colors.c +11 -0
@@ -13,6 +13,17 @@ void btf_sha256(const void *data, size_t len,libbpf_sha256 (data, len, out); } +size_t btf_essential_name_len (const char *name) +{ +return bpf_core_essential_name_len (name); +} + +int btf_types_are_compat (const struct btf *btf1,__u32 id1, +const struct btf *btf2,__u32 id2) +{ +return bpf_core_types_are_compat (btf1, id1, btf2, id2); +} +/* * Marks `root_id` and local types reachable from it with `color`. * `colors` is indexed by source ID; worklist has room for every local type.
tools/bpf/resolve_btfids/btf_colors.h +3 -0
@@ -15,6 +15,9 @@ enum btf_color {void btf_sha256 (const void *data,size_t len,__u8 out[BTF_SHA256_DIGEST_LENGTH ]); +size_t btf_essential_name_len (const char *name); +int btf_types_are_compat (const struct btf *btf1,__u32 id1, +const struct btf *btf2,__u32 id2);void btf_mark_reachable (struct btf *btf,__u32 root,enum btf_color color,__u8 *colors,__u32 *worklist);
tools/bpf/resolve_btfids/main.c +134 -0
146 lines not on this page · raw message
Signature · 1 line
2.56.1
Re: [PATCH bpf-next v1 3/4] resolve_btfids: Reject kfunc families that libbpf can't disambiguate
Quoted 22 lines · Ihor Solodrai
Kfuncs sharing an essential name, foo and foo___<flavor>, form a family. When resolving a kfunc foo, libbpf binds the kernel's foo if the prototypes are compatible, and otherwise the only family member whose prototype passes
bpf_core_types_are_compat()against the declaration. That is only safe if no declaration can be compatible with two members at once.
bpf_core_types_are_compat()compares prototypes kind by kind, so it acts as an equivalence and a pairwise check is enough. Run it on every pair of family members after dedup, using libbpf's own function, and fail the build if any pair is compatible. A foo___<flavor> with the same deduplicatedFUNC_PROTOas foo is an alias and is allowed: libbpf binds foo first, so the alias is never picked in its place. There is only one foo:btf_check_kfunc_name()refuses to register a module kfunc named like a function in vmlinux or in another module. Dedup compares parameter names too, so an alias has to copy the signature verbatim.Recognize family members by their
bpf_kfuncdecl tags rather than by the BTF ID sets. The tags are what libbpf filters candidates on, and for a module they also cover the vmlinux kfuncs in base BTF, so module kfuncs get checked against vmlinux kfuncs of the same family.
Quoted 5 lines
The
bpf_kfunc_flavorfamily inbpf_testmodpasses:___v1differs in arity and___v2is an alias.Signed-off-by Ihor Solodrai <[email protected]>---
Quoted 13 lines
tools/bpf/resolve_btfids/btf_colors.c | 11 +++
tools/bpf/resolve_btfids/btf_colors.h| 3 + tools/bpf/resolve_btfids/main.c | 134 ++++++++++++++++++++++++++3 files changed, 148 insertions(+)tools/bpf/resolve_btfids/btf_colors.c +0
-0@@ -13,6 +13,17 @@ void btf_sha256(const void *data, size_t len, libbpf_sha256(data, len, out); }
tools/bpf/resolve_btfids/btf_colors.c void btf_sha256(const void *data, size_t len, · line 25
Quoted 10 lines
tools/bpf/resolve_btfids/btf_colors.c +10
-0+size_t btf_essential_name_len (const char *name) +{ +return bpf_core_essential_name_len (name); +} + +int btf_types_are_compat (const struct btf *btf1,__u32 id1, +const struct btf *btf2,__u32 id2) +{ +return bpf_core_types_are_compat (btf1, id1, btf2, id2); +}
Can main.c include bpf/relo_core.h instead of this symbol-laundering scheme? Or just define two extern prototypes?
...
Ihor Solodrai
reviewerPATCH 4/4 docs/bpf: Describe how to change a kfunc's prototype
In reply to Ihor SolodraiAdd a section on changing a kfunc's prototype to the kfunc lifecycle expectations. libbpf now falls back to ___-suffixed kfuncs and resolve_btfids rejects kfuncs that libbpf can't tell apart, so kernel developers can keep BPF programs built against an old prototype loading, provided they follow the rules this section describes.
--- Documentation/bpf/kfuncs.rst | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+)
Documentation/bpf/kfuncs.rst +83 -0
@@ -800,6 +800,89 @@ procedure is followed for removal: 3. After the deprecation period the kfunc will be removed. At this point, BPF programs calling the kfunc will be rejected by the verifier. +3.2 Changing a kfunc's prototype +-------------------------------- + +libbpf binds a kfunc by name, ignoring any ``___suffix`` in the BPF program's +declaration, if the declared prototype is compatible with the kernel's. +Otherwise, it looks for a kfunc named ``<name>___<anything>`` with a compatible +prototype. + +Prototypes are compatible if they have the same number of parameters and the +same kind (integer, enum, pointer, struct, union, ...) of each parameter and of +the return value. A pointer's kind includes the kind it points to: ``int *`` +and ``struct task_struct *`` differ, ``struct file *`` and +``struct task_struct *`` don't. Integer sizes and signedness don't matter, nor +do the names and members of structs, unions and enums. Typedefs, ``const`` and +``volatile`` are looked through. + +A change that keeps the prototype compatible, e.g. widening an integer or adding +``const``, is done in place. Otherwise the new prototype keeps the name, and the +old one stays available as ``<name>___v1`` (``___v2`` for the next change, and +so on) for a deprecation period, usually as a thin wrapper registered with the +same flags: + +.. code-block:: c + + __bpf_kfunc int bpf_foo(struct task_struct *p, u64 flags) + { + ... + } + + /* bpf_foo() before flags was added */ + __bpf_kfunc int bpf_foo___v1(struct task_struct *p) + { + return bpf_foo(p, 0); + } + + BTF_ID_FLAGS(func, bpf_foo, KF_RCU) + BTF_ID_FLAGS(func, bpf_foo___v1, KF_RCU) + +BPF programs built against either prototype then load: + +.. code-block:: c + + /* built against the old prototype: binds bpf_foo___v1 */ + extern int bpf_foo(struct task_struct *p) __ksym; + + /* built against the new prototype: binds bpf_foo */ + extern int bpf_foo(struct task_struct *p, u64 flags) __ksym; + +Only libbpf 1.9 and later look for ``bpf_foo___v1``. Older libbpf and light +skeletons see only ``bpf_foo``, as after an in-place change. + +Two kfuncs whose names differ only in the ``___`` suffix must not have +compatible prototypes: libbpf couldn't tell them apart, and ``resolve_btfids`` +fails the build. The one exception is an alias of ``<name>``: a kfunc with the +identical prototype, parameter names included (BTF dedup compares them). + +For example, this widens an offset to 64 bits and keeps the old prototype as +``bpf_bar___v1``: + +.. code-block:: c + + __bpf_kfunc int bpf_bar(const struct bpf_dynptr *p, u64 offset); + + /* bpf_bar() before offset was widened */ + __bpf_kfunc int bpf_bar___v1(const struct bpf_dynptr *p, u32 offset); + +``resolve_btfids`` rejects it:: + + ERROR: resolve_btfids: kfuncs bpf_bar and bpf_bar___v1 have compatible prototypes, libbpf cannot tell them apart + +Widening keeps the prototype compatible, so it is done in place instead: drop +``bpf_bar___v1``, and programs built against the old prototype bind +``bpf_bar``. + +Give the new prototype a new name that doesn't start with ``<name>___`` if +programs loaded by older libbpf or light skeletons must keep working, or if the +prototypes are compatible but the change breaks callers, e.g. two integer +parameters swap places. + +Don't rename a ``<name>___vN`` kfunc in place: BPF programs may call it by that +name. To give its prototype to ``<name>``, keep it as an alias for a +deprecation period. + 4. Core kfuncs ==============
Signature · 1 line
2.56.1
Tejun Heo
reviewerHello, Ihor.
Thanks for working on this. This would make compat support a lot easier and more robust for sched_ext.
Thanks.
--
tejun
Eduard Zingerman
maintainerQuoted 6 lines · Ihor Solodrai
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
Quoted 8 lines
sched_extran into this.cded46d97159("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6("sched_ext: Fixscx_bpf_dsq_insert()backward binary compatibility") reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0("sched_ext: Fixscx_bpf_dsq_move_to_local___v2compat detection") fixed a compat macro that silently droppedenq_flagsbecause of this.
Please prefer examples to prose in cover letters.
Also, please de-Claude the included prose.
Quoted 8 lines
With this series, if the kernel's
bpf_fookfunc is missing or its prototype is incompatible with the declaration, libbpf binds the bpf_foo___<flavor> that has a compatible prototype. So a changed kfunc can keep its name, and the old prototype stays available asfoo___v1.
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures at
Why is an exception for kfuncs with identical prototypes necessary?
Quoted 9 lines
kernel / module build time that no ambigous kfunc flavors exist.
Documentation/bpf/kfuncs.rstdescribes the rules.Compatibility is determined by
bpf_core_types_are_compat(), the check libbpf already applies to kfuncs. Of the 70 same-name kfunc prototype changes between v6.6 and bpf-next, it finds 8 incompatible (arity, return kind, callback prototype). The other 62 (const, typedefs, parameter names, integer widths, pointee struct names, annotation suffixes) were made in place without breaking old callers.
Do you mean that without this series programs referring old prototypes are broken?
...
Ihor Solodrai
reviewerQuoted 16 lines · Eduard Zingerman
Quoted 6 lines · Ihor Solodrai
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
Quoted 8 lines
sched_extran into this.cded46d97159("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6("sched_ext: Fixscx_bpf_dsq_insert()backward binary compatibility") reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0("sched_ext: Fixscx_bpf_dsq_move_to_local___v2compat detection") fixed a compat macro that silently droppedenq_flagsbecause of this.
Quoted 1 line
Please prefer examples to prose in cover letters.
The sched_ext story above narrates the commit history to illustrate the motivation for the feature. Would you like to see code samples from there, or are you suggesting to drop the paragraph?
The documentation patch includes code examples of the new binding rules, I didn't want to duplicate that in the cover.
Quoted 1 line
Also, please de-Claude the included prose.
Please be more specific. Which "included prose"?
Quoted 11 lines
Quoted 9 lines
With this series, if the kernel's
bpf_fookfunc is missing or its prototype is incompatible with the declaration, libbpf binds the bpf_foo___<flavor> that has a compatible prototype. So a changed kfunc can keep its name, and the old prototype stays available asfoo___v1.
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures atWhy is an exception for kfuncs with identical prototypes necessary?
For example, when the void scx_bpf_dsq_insert() is deprecated, the kernel side can do this:
Today: void scx_bpf_dsq_insert(...)
bool scx_bpf_dsq_insert___v2(...)
Later: bool scx_bpf_dsq_insert(...)
bool scx_bpf_dsq_insert___v2(...) /* calls
scx_bpf_dsq_insert() */
Existing schedulers declare scx_bpf_dsq_insert___v2___compat.
libbpf strips the last suffix, so the bpf progs still call scx_bpf_dsq_insert___v2(). The wrapper keeps them working during the transition, including with older libbpf.
The exception allows to do this.
Otherwise we break the ___v2___compat trick.
Quoted 11 lines
Quoted 10 lines
kernel / module build time that no ambigous kfunc flavors exist.
Documentation/bpf/kfuncs.rstdescribes the rules.Compatibility is determined by
bpf_core_types_are_compat(), the check libbpf already applies to kfuncs. Of the 70 same-name kfunc prototype changes between v6.6 and bpf-next, it finds 8 incompatible (arity, return kind, callback prototype). The other 62 (const, typedefs, parameter names, integer widths, pointee struct names, annotation suffixes) were made in place without breaking old callers.
Quoted 2 lines
Do you mean that without this series programs referring old prototypes are broken?
Yes, if the kernel changed the prototype in place and the BPF program still expects the old one. For example, 8fe4dc4f6456 ("bpf: change prototype of bpf_session_{cookie,is_return}") added a ctx argument to bpf_session_is_return() in v7.0. libbpf can't resolve an object's old no-argument declaration on that kernel.
This series alone doesn't fix this, but with it the kernel *can* provide bpf_session_is_return___v1(void) for the old callers.
Quoted 2 lines
...
Eduard Zingerman
maintainerQuoted 17 lines · Ihor Solodrai
Quoted 16 lines · Eduard Zingerman
Quoted 14 lines · Ihor Solodrai
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
sched_extran into this.cded46d97159("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6("sched_ext: Fixscx_bpf_dsq_insert()backward binary compatibility") reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0("sched_ext: Fixscx_bpf_dsq_move_to_local___v2compat detection") fixed a compat macro that silently droppedenq_flagsbecause of this.
Quoted 8 lines
Quoted 1 line
Please prefer examples to prose in cover letters.
The
sched_extstory above narrates the commit history to illustrate the motivation for the feature. Would you like to see code samples from there, or are you suggesting to drop the paragraph?The documentation patch includes code examples of the new binding rules, I didn't want to duplicate that in the cover.
There are two ways to act while reading the above paragraph:
- follow the referenced commits and reconstruct the issue (time consuming).
- ignore it (not helpful).
Quoted 3 lines
Quoted 1 line
Also, please de-Claude the included prose.
Please be more specific. Which "included prose"?
sched_ext ran into this. cded46d97159 ... kept the old prototype as scx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them. 2dbbdeda77a6 ... reversed the naming. A ___v2 kfunc declared as vmlinux.h spells it doesn't bind: 56bbc91219c0 ... fixed a compat macro that silently dropped enq_flags because of this.
This screams Claude from 1000 miles distance.
Maybe I have reading comprehension issues, but in order to decipher it one has to:
- "kept old prototype" - figure out that two functions were declared "scx_bpf_dsq_insert" and "scx_bpf_dsq_insert___compat"
- "bind old binaries to it and broke them" - figure out that existing bpf programs referred to "scx_bpf_dsq_insert" and libbpf mechanics didn't work as expected.
- "reversed the naming" - like a new function became ___compat or what happened?
- "A ___v2 kfunc declared as vmlinux.h spells it ..."
Now there is a ___v2 in the picture.
- "... doesn't bind" - figure out that this refers to libbpf mechanics.
- "fixed a compat macro that silently dropped enq_flags because of this." Incomprehensible w/o looking in the code.
Quoted 22 lines
Quoted 11 lines
Quoted 9 lines
With this series, if the kernel's
bpf_fookfunc is missing or its prototype is incompatible with the declaration, libbpf binds the bpf_foo___<flavor> that has a compatible prototype. So a changed kfunc can keep its name, and the old prototype stays available asfoo___v1.
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures atWhy is an exception for kfuncs with identical prototypes necessary?
For example, when the void
scx_bpf_dsq_insert()is deprecated, the kernel side can do this:Today: void
scx_bpf_dsq_insert(...)
boolscx_bpf_dsq_insert___v2(...)Later: bool
scx_bpf_dsq_insert(...)
bool scx_bpf_dsq_insert___v2(...) /* callsscx_bpf_dsq_insert()*/
Quoted 8 lines
Existing schedulers declare
scx_bpf_dsq_insert___v2___compat.libbpf strips the last suffix, so the bpf progs still call
scx_bpf_dsq_insert___v2(). The wrapper keeps them working during the transition, including with older libbpf.The exception allows to do this.
Otherwise we break the___v2___compattrick.
Thank you.
Quoted 14 lines
Quoted 11 lines
Quoted 10 lines
kernel / module build time that no ambigous kfunc flavors exist.
Documentation/bpf/kfuncs.rstdescribes the rules.Compatibility is determined by
bpf_core_types_are_compat(), the check libbpf already applies to kfuncs. Of the 70 same-name kfunc prototype changes between v6.6 and bpf-next, it finds 8 incompatible (arity, return kind, callback prototype). The other 62 (const, typedefs, parameter names, integer widths, pointee struct names, annotation suffixes) were made in place without breaking old callers.Quoted 2 lines
Do you mean that without this series programs referring old prototypes are broken?
Quoted 8 lines
Yes, if the kernel changed the prototype in place and the BPF program still expects the old one. For example,
8fe4dc4f6456("bpf: change prototype of bpf_session_{cookie,is_return}") added a ctx argument tobpf_session_is_return()in v7.0. libbpf can't resolve an object's old no-argument declaration on that kernel.This series alone doesn't fix this, but with it the kernel *can* provide
bpf_session_is_return___v1(void)for the old callers.
Ok, this clarifies things, thank you.
Ihor Solodrai
reviewerQuoted 24 lines · Eduard Zingerman
Quoted 23 lines · Ihor Solodrai
Quoted 16 lines · Eduard Zingerman
Quoted 6 lines · Ihor Solodrai
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
Quoted 8 lines
sched_extran into this.cded46d97159("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6("sched_ext: Fixscx_bpf_dsq_insert()backward binary compatibility") reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0("sched_ext: Fixscx_bpf_dsq_move_to_local___v2compat detection") fixed a compat macro that silently droppedenq_flagsbecause of this.Quoted 1 line
Please prefer examples to prose in cover letters.
The
sched_extstory above narrates the commit history to illustrate the motivation for the feature. Would you like to see code samples from there, or are you suggesting to drop the paragraph?
Quoted 6 lines
Quoted 2 lines
The documentation patch includes code examples of the new binding rules, I didn't want to duplicate that in the cover.
There are two ways to act while reading the above paragraph:
- follow the referenced commits and reconstruct the issue (time consuming).
- ignore it (not helpful).
sigh... There are more:
- Read the paragraph to understand the issue on the high level, without loading the entirety of the details into your head. Example interpretation:
- sched-ext had a problem with scx_bpf_dsq_insert() changing the return type, which led to reverts and inconvenient hacks
- Give the paragraph to your helpful assistant and ask it exact questions that interest you. Since the paragraph has commit hashes, it's trivial for ai to navigate this.
And other approaches in between. It all depends on how deeply do you want/need to understand the specific thing.
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
Also, please de-Claude the included prose.
Please be more specific. Which "included prose"?
Quoted 7 lines
sched_extran into this.cded46d97159... kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6... reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0... fixed a compat macro that silently droppedenq_flagsbecause of this.This screams Claude from 1000 miles distance.
Sure. So what? Have you read the bpf list lately?
(I also use Codex and Muse btw, not only Claude)
AI-generated prose is not a bad thing by itself. It can be no less useful than human-written prose. Yes there is a wide spectrum of slopiness, and submitters need to know what they are posting.
Personally, I try to be careful about commit messages and cover letters. I iterate on them multiple times with AI, then I read them and edit by hand. If I posted the first generated thing it would look much worse.
Look around on the list. Do you think this paragraph is the worst slop cover letter compared to things that have been landed already?
I'm a little annoyed by your comment, because the slop filter you are applying now is not applied uniformly on the list. It's not fair.
I would write the cover entirely by hand if that was a strict rule here, because I respect the rules. But it's not.
Quoted 6 lines
Maybe I have reading comprehension issues, but in order to decipher it one has to:
- "kept old prototype" - figure out that two functions were declared "scx_bpf_dsq_insert" and "scx_bpf_dsq_insert___compat"
- "bind old binaries to it and broke them" - figure out that existing bpf programs referred to "scx_bpf_dsq_insert" and libbpf mechanics
Quoted 8 lines
didn't work as expected.
- "reversed the naming" - like a new function became___compator what happened?
- "A___v2kfunc declared asvmlinux.hspells it ..."
Now there is a___v2in the picture.
- "... doesn't bind" - figure out that this refers to libbpf mechanics.
- "fixed a compat macro that silently droppedenq_flagsbecause of this." Incomprehensible w/o looking in the code.
Your reading is a valid approach to understand the history in more details, and you are correct that the paragraph does not provide them.
However IMO those details are unnecessary in the cover, but pointers are useful. Which is why I left this ai-generated paragraph be.
It's a minor issue, however. I'm happy to drop the paragraph, I just disagree that "it screams Claude" is a valid reason.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[...]
Eduard Zingerman
maintainerOn Wed, 2026-11-18 at 16:13 -0700, Ihor Solodrai wrote:
...
Quoted 15 lines
Quoted 6 lines
Maybe I have reading comprehension issues, but in order to decipher it one has to:
- "kept old prototype" - figure out that two functions were declared "scx_bpf_dsq_insert" and "scx_bpf_dsq_insert___compat"
- "bind old binaries to it and broke them" - figure out that existing bpf programs referred to "scx_bpf_dsq_insert" and libbpf mechanicsQuoted 8 lines
didn't work as expected.
- "reversed the naming" - like a new function became___compator what happened?
- "A___v2kfunc declared asvmlinux.hspells it ..."
Now there is a___v2in the picture.
- "... doesn't bind" - figure out that this refers to libbpf mechanics.
- "fixed a compat macro that silently droppedenq_flagsbecause of this." Incomprehensible w/o looking in the code.
Quoted 5 lines
Your reading is a valid approach to understand the history in more details, and you are correct that the paragraph does not provide them.
However IMO those details are unnecessary in the cover, but pointers are useful. Which is why I left this ai-generated paragraph be.
Examples are very helpful in cover letters, they save reviewers time and make the changes easier to understand for people monitoring the list.
Eduard Zingerman
maintainerQuoted 1 line · Eduard Zingerman
On Tue, 2026-11-17 at 12:21 -0700, Ihor Solodrai wrote:
...
Quoted 5 lines
Quoted 3 lines
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures atWhy is an exception for kfuncs with identical prototypes necessary?
Ok, my helpful assistant points out the following use case:
On kernel side:
__bpf_kfunc bool foo(struct task_struct *p, u64 flags); __bpf_kfunc bool foo___v2(struct task_struct *p, u64 flags);
On BPF side:
extern bool foo(struct task_struct *p, u64 flags) __ksym; extern bool foo___v2___compat(struct task_struct *p, u64 flags) __ksym; /* Resolves to the kernel's foo(). */ foo(p, 0);
/* libbpf strips ___compat; resolves to the kernel's foo___v2().
* workaround used before this series.
*/
foo___v2___compat(p, 0);
New mechanics adds an obligation on the kernel side to maintain that foo and foo___v2___compat are semantically identical, despite being physically different functions. (Does it?)
Would it be possible to use some kind of annotation, e.g.:
- __alias(foo___v2) (an ELF symbol alias), or
- __kfunc_alias(foo___v2)
(resolving to some sort of btf_decl_tag for resolve_btfids to act upon).
And avoid allowing functions with compatible prototypes w/o exceptions.
?
Ihor Solodrai
reviewerQuoted 28 lines · Eduard Zingerman
Quoted 1 line · Eduard Zingerman
On Tue, 2026-11-17 at 12:21 -0700, Ihor Solodrai wrote:
...
Quoted 5 lines
Quoted 3 lines
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures atWhy is an exception for kfuncs with identical prototypes necessary?
Ok, my helpful assistant points out the following use case:
On kernel side:
__bpf_kfunc bool foo(struct task_struct *p, u64 flags); __bpf_kfunc bool foo___v2(struct task_struct *p, u64 flags);On BPF side:
extern bool foo(struct task_struct *p, u64 flags) __ksym; extern bool foo___v2___compat(struct task_struct *p, u64 flags) __ksym; /* Resolves to the kernel's foo(). */ foo(p, 0);
Quoted 8 lines
/* libbpf strips ___compat; resolves to the kernel's foo___v2(). * workaround used before this series. */ foo___v2___compat(p, 0);New mechanics adds an obligation on the kernel side to maintain that foo and
foo___v2___compatare semantically identical, despite being physically different functions. (Does it?)
Yes. I just replied with exactly same example (it's used in sched-ext).
Quoted 8 lines
Would it be possible to use some kind of annotation, e.g.:
-__alias(foo___v2)(an ELF symbol alias), or
-__kfunc_alias(foo___v2)
(resolving to some sort ofbtf_decl_tagforresolve_btfidsto act upon).
And avoid allowing functions with compatible prototypes w/o exceptions.?
My intuition is that it's possible, but it'd be more complicated. The question is why? libbpf side might become marginally simpler, but we'd add complexity on the kernel side, no?
Eduard Zingerman
maintainerQuoted 47 lines · Ihor Solodrai
Quoted 28 lines · Eduard Zingerman
Quoted 1 line · Eduard Zingerman
On Tue, 2026-11-17 at 12:21 -0700, Ihor Solodrai wrote:
...
Quoted 5 lines
Quoted 3 lines
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures atWhy is an exception for kfuncs with identical prototypes necessary?
Ok, my helpful assistant points out the following use case:
On kernel side:
__bpf_kfuncboolfoo(struct task_struct *p, u64 flags);__bpf_kfuncboolfoo___v2(struct task_struct *p, u64 flags);On BPF side:
extern bool
foo(struct task_struct *p, u64 flags)__ksym; extern boolfoo___v2___compat(struct task_struct *p, u64 flags)__ksym;/* Resolves to the kernel's
foo(). */
foo(p, 0);Quoted 8 lines
/* libbpf strips
___compat; resolves to the kernel'sfoo___v2().
* workaround used before this series.
*/
foo___v2___compat(p, 0);New mechanics adds an obligation on the kernel side to maintain that foo and
foo___v2___compatare semantically identical, despite being physically different functions. (Does it?)Yes. I just replied with exactly same example (it's used in sched-ext).
Quoted 7 lines
Would it be possible to use some kind of annotation, e.g.:
-__alias(foo___v2)(an ELF symbol alias), or
-__kfunc_alias(foo___v2)
(resolving to some sort ofbtf_decl_tagforresolve_btfidsto act upon). And avoid allowing functions with compatible prototypes w/o exceptions.
Quoted 4 lines
Quoted 1 line
?
My intuition is that it's possible, but it'd be more complicated. The question is why?
Is it a requirement now for foo() and foo___v2___compat() to be semantically identical? If it is, the alias mechanics forgoes this requirement.
Quoted 2 lines
libbpf side might become marginally simpler, but we'd add complexity on the kernel side, no?
On kernel side or on resolve_btfids side?
Ihor Solodrai
reviewerQuoted 33 lines · Ihor Solodrai
An incompatible change to a kfunc's prototype, such as an added parameter, breaks BPF programs built against the old one. libbpf ignores the ___<flavor> suffix of a kfunc declared in a BPF program, but makes an exact name look up on the kernel side, so the kernel can't keep the old prototype available under the kfunc's name.
sched_extran into this.cded46d97159("sched_ext: Make scx_bpf_dsq_insert*() return bool") kept the old prototype asscx_bpf_dsq_insert___compat, expecting libbpf to bind old binaries to it, and broke them.2dbbdeda77a6("sched_ext: Fixscx_bpf_dsq_insert()backward binary compatibility") reversed the naming. A___v2kfunc declared asvmlinux.hspells it doesn't bind:56bbc91219c0("sched_ext: Fixscx_bpf_dsq_move_to_local___v2compat detection") fixed a compat macro that silently droppedenq_flagsbecause of this.With this series, if the kernel's
bpf_fookfunc is missing or its prototype is incompatible with the declaration, libbpf binds the bpf_foo___<flavor> that has a compatible prototype. So a changed kfunc can keep its name, and the old prototype stays available asfoo___v1.
resolve_btfidsfails the build if two ofbpf_fooand its flavors have compatible prototypes, unless both have foo's exact prototype (aliases), so the fallback finds at most one match. This ensures at kernel / module build time that no ambigous kfunc flavors exist.Documentation/bpf/kfuncs.rstdescribes the rules.Compatibility is determined by
bpf_core_types_are_compat(), the check libbpf already applies to kfuncs. Of the 70 same-name kfunc prototype changes between v6.6 and bpf-next, it finds 8 incompatible (arity, return kind, callback prototype). The other 62 (const, typedefs, parameter names, integer widths, pointee struct names, annotation suffixes) were made in place without breaking old callers.
Quoted 6 lines
The flavors feature is backwards compatible: declarations that resolve today bind the same kernel function. The exact name lookup is attempted first. Declarations rejected today for an incompatible prototype, or left unresolved if
__weak, may now bind to a flavor, for examplescx_bpf_dsq_insert___v2asvmlinux.hdeclares it. Older libbpf and light skeletons don't get the fallback.
We had an off-list discussion with Eduard and Andrii today. We agreed on the implementation as described below, which I plan to submit as v2 of this series (soon).
Writing from memory, please correct me if I forgot or misremembered anything.
A single kfunc selection mechanism in libbpf:
1. Find all functions in kernel BTF with the essential name (the name before the first ___ separator) that matches target kfunc's essential name. "bpf_kfunc" decl tag is ignored.
This gives a candidate list.
2. From the candidate list, find the one with a compatible prototype. Error on ambiguity.
No exceptions for "exact name" match (as in v1) or anything like that.
A function prototype compatibility check here will be a little stricter than bpf_core_types_are_compat(). But it's also not going to be a type traversal as done by bpf_core_types_match(). It will be a new check specifically for func prototype comparison.
In particular, for pointers to structs, unions or typedefs *the name* of the type will also be checked. And the typedefs won't "skipped" anymore, but shallowly compared. For example:
void kfunc(struct foo *arg);
vs
void kfunc(struct bar *arg);become incompatible now. And
typedef struct foo {...} foo_t;
void kfunc(foo_t *arg);
vs
void kfunc(struct foo *arg);become incompatible now.
However:
typedef struct foo_v1 {...} foo_t;
void kfunc(foo_t *arg);
vs
typedef struct foo_v2 {...} foo_t;
void kfunc(foo_t *arg);are compatible, because the name "foo_t" matches.
resolve_btfids built-time "no ambiguity" enforcement remains.
The consequence of this approach is that a BPF program expecting a kfunc that changed its prototype in the past in a CO-RE compatible way, will now get an error if loaded with new libbpf. The fix is
simple: use an up-to-date kfunc prototype in the BPF program.
A notable recent example is bpf_cpumask_populate() change [1].
[1] https://lore.kernel.org/bpf/[email protected]/
Quoted 2 lines
[...]