bpf, arm64: use bpf_prog_pack for memory management
authorPuranjay Mohan <puranjay12@gmail.com>
Wed, 28 Feb 2024 14:18:24 +0000 (14:18 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 28 Feb 2024 21:44:47 +0000 (13:44 -0800)
commit1dad391daef129e01e28206b8d586608ff026548
tree5811a3a6deb3825618a7d1a0577df5170871de2a
parent451c3cab9a65e656c3b3d106831fc02d56b8c34a
bpf, arm64: use bpf_prog_pack for memory management

Use bpf_jit_binary_pack_alloc for memory management of JIT binaries in
ARM64 BPF JIT. The bpf_jit_binary_pack_alloc creates a pair of RW and RX
buffers. The JIT writes the program into the RW buffer. When the JIT is
done, the program is copied to the final RX buffer
with bpf_jit_binary_pack_finalize.

Implement bpf_arch_text_copy() and bpf_arch_text_invalidate() for ARM64
JIT as these functions are required by bpf_jit_binary_pack allocator.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20240228141824.119877-3-puranjay12@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/arm64/net/bpf_jit_comp.c