Skip to contentSkip to conversation

selftests/bpf: remove enum64 case from __arg_untrusted test suite

PATCH Applied Eduard Zingerman 3 participants 3 messages Jul 8, 2025 – Jul 9, 2025

Subsystems (3)
lore
Share & tools
lore

Eduard Zingerman

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: remove enum64 case from __arg_untrusted test suite

The enum64 type used by verifier_global_ptr_args test case requires CONFIG_SCHED_CLASS_EXT. At the moment selftets do not depend on this option. There are just a few enum64 types in the kernel. Instead of tying selftests to implementation details of unrelated sub-systems, just remove enum64 test case. Simple enums are covered and that should be sufficient.

Fixes 68cca81fd57 ("selftests/bpf: tests for __arg_untrusted void * global func params")
---
 .../selftests/bpf/progs/verifier_global_ptr_args.c        | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c +1 -7
index b346f669d159..181da86ba5f0 100644
@@ -275,11 +275,6 @@ __weak int subprog_enum_untrusted(enum bpf_attach_type *p __arg_untrusted)
 	return *(int *)p;
 }
 
-__weak int subprog_enum64_untrusted(enum scx_public_consts *p __arg_untrusted)
-{
-	return *(int *)p;
-}
-
 SEC("tp_btf/sys_enter")
 __success
 __log_level(2)
@@ -306,10 +301,9 @@ int anything_to_untrusted_mem(void *ctx)
 	subprog_void_untrusted((void *)mem + off);
 	/* variable offset to untrusted mem (trusted) */
 	subprog_void_untrusted(bpf_get_current_task_btf() + off);
-	/* variable offset to untrusted char/enum/enum64 (map) */
+	/* variable offset to untrusted char/enum (map) */
 	subprog_char_untrusted(mem + off);
 	subprog_enum_untrusted((void *)mem + off);
-	subprog_enum64_untrusted((void *)mem + off);
 	return 0;
 }
 
Signature · 1 line
2.47.1
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Eduard Zingerman

The enum64 type used by verifier_global_ptr_args test case requires CONFIG_SCHED_CLASS_EXT. At the moment selftets do not depend on this option. There are just a few enum64 types in the kernel. Instead of tying selftests to implementation details of unrelated sub-systems, just remove enum64 test case. Simple enums are covered and that should be sufficient.

Can confirm that selftests now compile without the issue.

Quoted 39 lines
Fixes 68cca81fd57 ("selftests/bpf: tests for __arg_untrusted void * global func params")
---
 .../selftests/bpf/progs/verifier_global_ptr_args.c        | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c +1 -8
index b346f669d159..181da86ba5f0 100644
@@ -275,11 +275,6 @@ __weak int subprog_enum_untrusted(enum bpf_attach_type *p __arg_untrusted)
        return *(int *)p;
 }
 
-__weak int subprog_enum64_untrusted(enum scx_public_consts *p __arg_untrusted)
-{
-       return *(int *)p;
-}
-
 SEC("tp_btf/sys_enter")
 __success
 __log_level(2)
@@ -306,10 +301,9 @@ int anything_to_untrusted_mem(void *ctx)
        subprog_void_untrusted((void *)mem + off);
        /* variable offset to untrusted mem (trusted) */
        subprog_void_untrusted(bpf_get_current_task_btf() + off);
-       /* variable offset to untrusted char/enum/enum64 (map) */
+       /* variable offset to untrusted char/enum (map) */
        subprog_char_untrusted(mem + off);
        subprog_enum_untrusted((void *)mem + off);
-       subprog_enum64_untrusted((void *)mem + off);
        return 0;
 }
 
--

2.47.1

#2 lore raw
In reply to Eduard Zingerman
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 8 lines · On Tue, 8 Jul 2025 15:08:56 -0700 you wrote:

The enum64 type used by verifier_global_ptr_args test case requires CONFIG_SCHED_CLASS_EXT. At the moment selftets do not depend on this option. There are just a few enum64 types in the kernel. Instead of tying selftests to implementation details of unrelated sub-systems, just remove enum64 test case. Simple enums are covered and that should be sufficient.

[...]

Here is the summary with links:
- [bpf-next,v1] selftests/bpf: remove enum64 case from __arg_untrusted test suite

    https://git.kernel.org/bpf/bpf-next/c/ad97cb2ed06a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html