mirror_ubuntu-kernels/arch/powerpc/net
Naveen N Rao 9670f6d209 powerpc64/bpf: Fold bpf_jit_emit_func_call_hlp() into bpf_jit_emit_func_call_rel()
Commit 61688a82e0 ("powerpc/bpf: enable kfunc call") enhanced
bpf_jit_emit_func_call_hlp() to handle calls out to module region, where
bpf progs are generated. The only difference now between
bpf_jit_emit_func_call_hlp() and bpf_jit_emit_func_call_rel() is in
handling of the initial pass where target function address is not known.
Fold that logic into bpf_jit_emit_func_call_hlp() and rename it to
bpf_jit_emit_func_call_rel() to simplify bpf function call JIT code.

We don't actually need to load/restore TOC across a call out to a
different kernel helper or to a different bpf program since they all
work with the kernel TOC. We only need to do it if we have to call out
to a module function. So, guard TOC load/restore with appropriate
conditions.

Signed-off-by: Naveen N Rao <naveen@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20241030070850.1361304-10-hbathini@linux.ibm.com
2024-10-31 11:00:54 +11:00
..
bpf_jit_comp32.c powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH 2024-05-29 22:12:42 +10:00
bpf_jit_comp64.c powerpc64/bpf: Fold bpf_jit_emit_func_call_hlp() into bpf_jit_emit_func_call_rel() 2024-10-31 11:00:54 +11:00
bpf_jit_comp.c bpf: remove unused parameter in bpf_jit_binary_pack_finalize 2024-06-20 19:50:26 -07:00
bpf_jit.h powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] 2023-10-23 20:33:19 +11:00
Makefile powerpc/bpf: Implement extended BPF on PPC32 2021-04-03 21:22:21 +11:00