On Fri, Jul 17, 2020 at 06:53:23PM +0200, Ilya Leoshkevich wrote: > Both signed and unsigned variants of BPF_JMP | BPF_K require > sign-extending the immediate. JIT emits cgfi for the signed case, > which is correct, and clgfi for the unsigned case, which is not > correct: clgfi zero-extends the immediate. > > s390 does not provide an instruction that does sign-extension and > unsigned comparison at the same time. Therefore, fix by first loading > the sign-extended immediate into work register REG_1 and proceeding > as if it's BPF_X. > > Fixes: 4e9b4a6883dd ("s390/bpf: Use relative long branches") > Reported-by: Seth Forshee <seth.forshee@xxxxxxxxxxxxx> > Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx> This fixes the failing tests I was seeing. Thanks! Tested-by: Seth Forshee <seth.forshee@xxxxxxxxxxxxx>