Skip to content

Commit

Permalink
selftests/bpf: verifier_arena: fix mmap address for arm64
Browse files Browse the repository at this point in the history
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] #6622

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
  • Loading branch information
puranjaymohan authored and Kernel Patches Daemon committed Mar 22, 2024
1 parent 8a57d6b commit 5e05d1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/testing/selftests/bpf/progs/verifier_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5e05d1d

Please sign in to comment.