Skip to content

Commit fa3550d

Browse files
puranjaymohanAlexei Starovoitov
authored andcommitted
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] kernel-patches/bpf#6622 Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20240322133552.70681-1-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent f7f5d18 commit fa3550d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/testing/selftests/bpf/progs/verifier_arena.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ struct {
1212
__uint(type, BPF_MAP_TYPE_ARENA);
1313
__uint(map_flags, BPF_F_MMAPABLE);
1414
__uint(max_entries, 2); /* arena of two pages close to 32-bit boundary*/
15-
__ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
15+
#ifdef __TARGET_ARCH_arm64
16+
__ulong(map_extra, (1ull << 32) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
17+
#else
18+
__ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
19+
#endif
1620
} arena SEC(".maps");
1721

1822
SEC("syscall")

0 commit comments

Comments
 (0)