Skip to contentSkip to conversation

bpf: Remove unused BTF_FMODEL_STRUCT_ARG

PATCH Applied Yonghong Song 4 participants 4 messages Aug 3

Subsystems (2)
lore
Share & tools
lore

Yonghong Song

author reviewer
#0 lore raw

PATCH 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
index 356884587ae1..73bacfc6444d 100644
@@ -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
index 5e8ac45ce56a..42414633cf26 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
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 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.

Quoted 6 lines

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.

Quoted 1 line

[...]

Acked-by on v1 1/1
#2 lore raw
In reply to Yonghong Song
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 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.

Quoted 6 lines

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.

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
index 356884587ae1..73bacfc6444d 100644
@@ -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
index 5e8ac45ce56a..42414633cf26 100644
@@ -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
#3 lore raw
In reply to Yonghong Song
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 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.

[...]

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