]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:39 +0000 (14:20 +0100)
commita073dc137589854c7e7828af5b69b0a310dce376
treeca6e6effa3e5dc76918e39c6a40f350d6a84b672
parent30f2350920aeef3a3b7c049cfbcb0ba98aa5b81b
bpf: powerpc64: pad function address loads with NOPs

BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit 4ea69b2fd623dee2bbc77d3b6b7d8c0924e2026a ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/powerpc/net/bpf_jit_comp64.c