Re: [PATCH 2/5] s390/bpf: fix sign extension in branch_ku

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux