diff options
author | Song Liu <songliubraving@fb.com> | 2022-02-04 10:57:41 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-02-07 18:13:01 -0800 |
commit | 33c9805860e584b194199cab1a1e81f4e6395408 (patch) | |
tree | 935536b12d08e7b5c1a1ad132e5b141e72492652 /kernel/bpf/cgroup.c | |
parent | 57631054fae6dcc9c892ae6310b58bbb6f6e5048 (diff) |
bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]
This is the jit binary allocator built on top of bpf_prog_pack.
bpf_prog_pack allocates RO memory, which cannot be used directly by the
JIT engine. Therefore, a temporary rw buffer is allocated for the JIT
engine. Once JIT is done, bpf_jit_binary_pack_finalize is used to copy
the program to the RO memory.
bpf_jit_binary_pack_alloc reserves 16 bytes of extra space for illegal
instructions, which is small than the 128 bytes space reserved by
bpf_jit_binary_alloc. This change is necessary for bpf_jit_binary_hdr
to find the correct header. Also, flag use_bpf_prog_pack is added to
differentiate a program allocated by bpf_jit_binary_pack_alloc.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220204185742.271030-9-song@kernel.org
Diffstat (limited to 'kernel/bpf/cgroup.c')
0 files changed, 0 insertions, 0 deletions