s390/bpf: Use relative long branches
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 18 Nov 2019 18:03:35 +0000 (19:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 19 Nov 2019 03:51:16 +0000 (19:51 -0800)
commit4e9b4a6883dd97aff53ae3b08eb900716a5469dc
treea84b391c76e15be3a752b9fcde7b55fc4e1cd651
parenta25ecd9d1e60241df905b29fb84765eb74545c4f
s390/bpf: Use relative long branches

Currently maximum JITed code size is limited to 64k, because JIT can
emit only relative short branches, whose range is limited by 64k in both
directions.

Teach JIT to use relative long branches. There are no compare+branch
relative long instructions, so using relative long branches consumes
more space due to having to having to emit an explicit comparison
instruction. Therefore do this only when relative short branch is not
enough.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191118180340.68373-2-iii@linux.ibm.com
arch/s390/net/bpf_jit_comp.c