OpenCloudOS-Kernel/arch/powerpc/net
Christophe Leroy ee7c3ec3b4 powerpc/ebpf32: Use standard function call for functions within 32M distance
If the target of a function call is within 32 Mbytes distance, use a
standard function call with 'bl' instead of the 'lis/ori/mtlr/blrl'
sequence.

In the first pass, no memory has been allocated yet and the code
position is not known yet (image pointer is NULL). This pass is there
to calculate the amount of memory to allocate for the EBPF code, so
assume the 4 instructions sequence is required, so that enough memory
is allocated.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/74944a1e3e5cfecc141e440a6ccd37920e186b70.1618227846.git.christophe.leroy@csgroup.eu
2021-04-21 22:52:33 +10:00
..
Makefile powerpc/bpf: Implement extended BPF on PPC32 2021-04-03 21:22:21 +11:00
bpf_jit.h powerpc/ebpf32: Use standard function call for functions within 32M distance 2021-04-21 22:52:33 +10:00
bpf_jit64.h powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32 2021-04-03 21:22:21 +11:00
bpf_jit_comp.c powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32 2021-04-03 21:22:21 +11:00
bpf_jit_comp32.c powerpc/ebpf32: Use standard function call for functions within 32M distance 2021-04-21 22:52:33 +10:00
bpf_jit_comp64.c powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32 2021-04-03 21:22:21 +11:00