]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: powerpc64: pad function address loads with NOPs
authorSandipan Das <sandipan@linux.vnet.ibm.com>
Thu, 24 May 2018 06:56:46 +0000 (12:26 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 May 2018 07:20:48 +0000 (09:20 +0200)
commitf2f01eeb2bc1228616f222e30e77bff7460fa528
tree3f65586a10e872c08a2978c026579ea6fe432c64
parent180739248f0de97cea896c1f52acf9625f3dab08
bpf: powerpc64: pad function address loads with NOPs

For multi-function programs, loading the address of a callee
function to a register requires emitting instructions whose
count varies from one to five depending on the nature of the
address.

Since we come to know of the callee's address only before the
extra pass, the number of instructions required to load this
address may vary from what was previously generated. This can
make the JITed image grow or shrink.

To avoid this, we should generate a constant five-instruction
when loading function addresses by padding the optimized load
sequence with NOPs.

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
arch/powerpc/net/bpf_jit_comp64.c