Skip to contentSkip to conversation

selftests/bpf: verifier_arena: fix mmap address for arm64

PATCH Applied Puranjay Mohan 2 participants 2 messages Mar 22, 2024 – Mar 23, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: verifier_arena: fix mmap address for arm64

The arena_list selftest uses (1ull << 32) in the mmap address computation for arm64. Use the same in the verifier_arena selftest.

This makes the selftest pass for arm64 on the CI[1].

[1] https://github.com/kernel-patches/bpf/pull/6622

---
 tools/testing/selftests/bpf/progs/verifier_arena.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/verifier_arena.c +5 -1
index 5540b05ff9ee..91818a84e86d 100644
@@ -12,7 +12,11 @@ struct {
 	__uint(type, BPF_MAP_TYPE_ARENA);
 	__uint(map_flags, BPF_F_MMAPABLE);
 	__uint(max_entries, 2); /* arena of two pages close to 32-bit boundary*/
-	__ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
+#ifdef __TARGET_ARCH_arm64
+        __ulong(map_extra, (1ull << 32) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
+#else
+        __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
+#endif
 } arena SEC(".maps");
 
 SEC("syscall")
Signature · 1 line
2.40.1
#1 lore raw
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

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

Quoted 8 lines · On Fri, 22 Mar 2024 13:35:52 +0000 you wrote:

The arena_list selftest uses (1ull << 32) in the mmap address computation for arm64. Use the same in the verifier_arena selftest.

This makes the selftest pass for arm64 on the CI[1].

[1] https://github.com/kernel-patches/bpf/pull/6622

[...]

Here is the summary with links:
- [bpf] selftests/bpf: verifier_arena: fix mmap address for arm64

    https://git.kernel.org/bpf/bpf/c/fa3550dca8f0

You are awesome, thank you!

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