New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf, arm64: use BPF prog pack allocator in BPF JIT #5165
Conversation
Upstream branch: d4ae3e5 |
cf7cb90
to
8f61f5b
Compare
Upstream branch: 7793fc3 |
66f8bac
to
a66e5fa
Compare
8f61f5b
to
559ddcd
Compare
Upstream branch: 4114866 |
a66e5fa
to
12aafeb
Compare
559ddcd
to
31a077e
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=753950 expired. Closing PR. |
Upstream branch: aa7881f |
12aafeb
to
efe6c49
Compare
af29f6b
to
084d713
Compare
Upstream branch: 67faabb |
The bpf_prog_pack allocator currently uses module_alloc() and module_memfree() to allocate and free memory. This is not portable because different architectures use different methods for allocating memory for BPF programs. Like ARM64 uses vmalloc()/vfree(). Use bpf_jit_alloc_exec() and bpf_jit_free_exec() for memory management in bpf_prog_pack allocator. Other architectures can override these with their implementation and will be able to use bpf_prog_pack directly. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Acked-by: Song Liu <song@kernel.org>
This will be used by BPF JIT compiler to dump JITed binary to a RX huge page, and thus allow multiple BPF programs sharing the a huge (2MB) page. The bpf_prog_pack allocator that implements the above feature allocates a RX/RW buffer pair. The JITed code is written to the RW buffer and then this function will be used to copy the code from RW to RX buffer. Signed-off-by: Puranjay Mohan <puranjay12@gmail.com> Acked-by: Song Liu <song@kernel.org>
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>
efe6c49
to
06573bf
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=754798 expired. Closing PR. |
Pull request for series with
subject: bpf, arm64: use BPF prog pack allocator in BPF JIT
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=753950