Merge branch 'bpf_fastcall-attribute-in-vmlinux-h-and-bpf_helper_defs-h'
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 27 Sep 2024 21:54:22 +0000 (14:54 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Oct 2024 00:47:53 +0000 (17:47 -0700)
Eduard Zingerman says:

====================
'bpf_fastcall' attribute in vmlinux.h and bpf_helper_defs.h

The goal of this patch-set is to reflect attribute bpf_fastcall
for supported helpers and kfuncs in generated header files.
For helpers this requires a tweak for scripts/bpf_doc.py and an update
to uapi/linux/bpf.h doc-comment.
For kfuncs this requires:
- introduction of a new KF_FASTCALL flag;
- modification to pahole to read kfunc flags and generate
  DECL_TAG "bpf_fastcall" for marked kfuncs;
- modification to bpftool to scan for DECL_TAG "bpf_fastcall"
  presence.

In both cases the following helper macro is defined in the generated
header:

    #ifndef __bpf_fastcall
    #if __has_attribute(bpf_fastcall)
    #define __bpf_fastcall __attribute__((bpf_fastcall))
    #else
    #define __bpf_fastcall
    #endif
    #endif

And is used to mark appropriate function prototypes. More information
about bpf_fastcall attribute could be found in [1] and [2].

Modifications to pahole are submitted separately.

[1] LLVM source tree commit:
    64e464349bfc ("[BPF] introduce __attribute__((bpf_fastcall))")

[2] Linux kernel tree commit (note: feature was renamed from
    no_caller_saved_registers to bpf_fastcall after this commit):
    52839f31cece ("Merge branch 'no_caller_saved_registers-attribute-for-helper-calls'")
====================

Link: https://lore.kernel.org/r/20240916091712.2929279-1-eddyz87@gmail.com
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Trivial merge