bpf: Add arm64 JIT support for bpf_addr_space_cast instruction.
authorPuranjay Mohan <puranjay12@gmail.com>
Mon, 25 Mar 2024 15:07:16 +0000 (15:07 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 3 Apr 2024 02:45:50 +0000 (19:45 -0700)
commit4dd31243e30843d5f63bccfb0369146e4de1a130
treea4016b11eba0c4d9f47f5ad4e3a0c327a50d0b66
parent339af577ec05c8fc0b96f23579614ae853d913ab
bpf: Add arm64 JIT support for bpf_addr_space_cast instruction.

LLVM generates bpf_addr_space_cast instruction while translating
pointers between native (zero) address space and
__attribute__((address_space(N))). The addr_space=0 is reserved as
bpf_arena address space.

rY = addr_space_cast(rX, 0, 1) is processed by the verifier and
converted to normal 32-bit move: wX = wY.

rY = addr_space_cast(rX, 1, 0) : used to convert a bpf arena pointer to
a pointer in the userspace vma. This has to be converted by the JIT.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Link: https://lore.kernel.org/r/20240325150716.4387-3-puranjay12@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/arm64/net/bpf_jit_comp.c
tools/testing/selftests/bpf/DENYLIST.aarch64