Hi! On Tue, Aug 4, 2020 at 10:44 PM Ilya Leoshkevich <iii@xxxxxxxxxxxxx> wrote: > > On Tue, 2020-08-04 at 20:40 +0300, Yauheni Kaliuta wrote: > > Hi! > > > > I have a failure (crash) of selftests/bpf/test_kmod.sh on s390. > > > > The problem comes with loading with > > > > sysctl -w net.core.bpf_jit_harden=2 > > > > In that case the program (lib/test_bpf.c): > > > > static int bpf_fill_maxinsns1(struct bpf_test *self) > > { > > unsigned int len = BPF_MAXINSNS; > > struct sock_filter *insn; > > __u32 k = ~0; > > int i; > > > > insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL); > > if (!insn) > > return -ENOMEM; > > > > for (i = 0; i < len; i++, k--) > > insn[i] = __BPF_STMT(BPF_RET | BPF_K, k); > > > > self->u.ptr.insns = insn; > > self->u.ptr.len = len; > > > > return 0; > > } > > > > after blinding and jiting is 98362 bytes for me and it does not fit > > 16bit offset for BRC 15,.. command where BPF_EXIT | BPF_JMP is > > translated. > > > > What is the easiest way to use BRCL for large offset here? > > > > Thanks! > > Hi Yauheni! > > Did you try bpf-next, specifically with commit 5fa6974471c5 ("s390/bpf: > Use brcl for jumping to exit_ip if necessary")? This was supposed to > fix this problem. Ah, thanks a lot! I missed it. -- WBR, Yauheni