bpf: Remove unused BTF_FMODEL_STRUCT_ARG
Yonghong Song
reviewerPATCH 1/1 bpf: Remove unused BTF_FMODEL_STRUCT_ARG
Commit 814cba835ef6 ("bpf, x86: Fix trampoline stack size for 128-bit arguments") changed the x86 trampoline to compute the number of registers from arg_size for every argument, which removed the last user of BTF_FMODEL_STRUCT_ARG. No other architecture or verifier code looks at the flag, so remove the macro and the code in __get_type_fmodel_flags() which sets it.
Keep BTF_FMODEL_SIGNED_ARG at BIT(1) rather than renumbering it to BIT(0), so BIT(0) is available for a future flag.
No functional change.
--- include/linux/bpf.h | 3 --- kernel/bpf/btf.c | 2 -- 2 files changed, 5 deletions(-)
include/linux/bpf.h +0 -3
@@ -1207,9 +1207,6 @@ struct bpf_prog_offload {u32 jited_len; }; -/* The argument is a structure or a union. */ -#define BTF_FMODEL_STRUCT_ARG BIT(0) -/* The argument is signed. */ #define BTF_FMODEL_SIGNED_ARG BIT(1)
kernel/bpf/btf.c +0 -2
@@ -7533,8 +7533,6 @@ static u8 __get_type_fmodel_flags(const struct btf_type *t) {u8 flags =0 ; -if (btf_type_is_struct (t)) - flags |=BTF_FMODEL_STRUCT_ARG ;if (btf_type_is_signed_int (t)) flags |=BTF_FMODEL_SIGNED_ARG ;
Signature · 1 line
2.53.0-Meta
Quoted 7 lines · Yonghong Song
Commit
814cba835ef6("bpf, x86: Fix trampoline stack size for 128-bit arguments") changed the x86 trampoline to compute the number of registers fromarg_sizefor every argument, which removed the last user ofBTF_FMODEL_STRUCT_ARG. No other architecture or verifier code looks at the flag, so remove the macro and the code in__get_type_fmodel_flags()which sets it.
Quoted 6 lines
Keep
BTF_FMODEL_SIGNED_ARGat BIT(1) rather than renumbering it to BIT(0), so BIT(0) is available for a future flag.No functional change.
Signed-off-by Yonghong Song <[email protected]>
Quoted 1 line
[...]
Quoted 7 lines · Yonghong Song
Commit
814cba835ef6("bpf, x86: Fix trampoline stack size for 128-bit arguments") changed the x86 trampoline to compute the number of registers fromarg_sizefor every argument, which removed the last user ofBTF_FMODEL_STRUCT_ARG. No other architecture or verifier code looks at the flag, so remove the macro and the code in__get_type_fmodel_flags()which sets it.
Quoted 6 lines
Keep
BTF_FMODEL_SIGNED_ARGat BIT(1) rather than renumbering it to BIT(0), so BIT(0) is available for a future flag.No functional change.
Signed-off-by Yonghong Song <[email protected]>
jirka
Quoted 36 lines
--- include/linux/bpf.h | 3 --- kernel/bpf/btf.c | 2 -- 2 files changed, 5 deletions(-)include/linux/bpf.h +0
-3@@ -1207,9 +1207,6 @@ struct bpf_prog_offload {u32 jited_len; }; -/* The argument is a structure or a union. */ -#define BTF_FMODEL_STRUCT_ARG BIT(0) -/* The argument is signed. */ #define BTF_FMODEL_SIGNED_ARG BIT(1)kernel/bpf/btf.c +0
-2@@ -7533,8 +7533,6 @@ static u8 __get_type_fmodel_flags(const struct btf_type *t) {u8 flags =0 ; -if (btf_type_is_struct (t)) - flags |=BTF_FMODEL_STRUCT_ARG ;if (btf_type_is_signed_int (t)) flags |=BTF_FMODEL_SIGNED_ARG ;Signature · 1 line
2.53.0-Meta
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Quoted 8 lines · On Sun, 2 Aug 2026 22:27:26 -0700 you wrote:
Commit
814cba835ef6("bpf, x86: Fix trampoline stack size for 128-bit arguments") changed the x86 trampoline to compute the number of registers fromarg_sizefor every argument, which removed the last user ofBTF_FMODEL_STRUCT_ARG. No other architecture or verifier code looks at the flag, so remove the macro and the code in__get_type_fmodel_flags()which sets it.[...]
Here is the summary with links:
- [bpf-next] bpf: Remove unused BTF_FMODEL_STRUCT_ARG
https://git.kernel.org/bpf/bpf-next/c/457d4ecb47aa
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html