]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/ebpf32: Use standard function call for functions within 32M distance
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 12 Apr 2021 11:44:18 +0000 (11:44 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Apr 2021 12:52:33 +0000 (22:52 +1000)
commit348ea6c52ebf73a7578ecf02e36dc3b2f5d7bdb5
tree72a9efd7823aadd137fa1934927e2d0c2e29d203
parent089dcb298c6e45d13ff15ca55c967b66a711abb2
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
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp32.c