From: Andrii Nakryiko Date: Fri, 27 Sep 2024 21:54:22 +0000 (-0700) Subject: Merge branch 'bpf_fastcall-attribute-in-vmlinux-h-and-bpf_helper_defs-h' X-Git-Tag: v6.13-rc1~136^2~70 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=904181b33478a25bbc08f3427f6b25c9001cdbeb;p=linux-block.git Merge branch 'bpf_fastcall-attribute-in-vmlinux-h-and-bpf_helper_defs-h' 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 Signed-off-by: Alexei Starovoitov --- 904181b33478a25bbc08f3427f6b25c9001cdbeb