Skip to content
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

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d4ae3e5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=753950
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 7793fc3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=753950
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4114866
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=753950
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=753950 expired. Closing PR.

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: aa7881f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=754798
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 67faabb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=754798
version: 2

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>
@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=754798 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant