]> git.itanic.dy.fi Git - linux-stable/commit
powerpc/bpf: Perform complete extra passes to update addresses
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 1 Feb 2023 10:04:27 +0000 (11:04 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 10 Feb 2023 11:17:35 +0000 (22:17 +1100)
commit85e031154c7c14edee0705532a9ffc8a2fe591d0
treee272b859a301bf07f7bb5dd33057f1bc0bcc25af
parent7dd0e2848764306d7a70943b97584ffdc7754708
powerpc/bpf: Perform complete extra passes to update addresses

BPF core calls the jit compiler again for an extra pass in order
to properly set subprog addresses.

Unlike other architectures, powerpc only updates the addresses
during that extra pass. It means that holes must have been left
in the code in order to enable the maximum possible instruction
size.

In order to avoid waste of space, and waste of CPU time on powerpc
processors on which the NOP instruction is not 0-cycle, perform
two real additional passes.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/d484a4ac95949ff55fc4344b674e7c0d3ddbfcd5.1675245773.git.christophe.leroy@csgroup.eu
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp.c
arch/powerpc/net/bpf_jit_comp32.c
arch/powerpc/net/bpf_jit_comp64.c