[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQJspryT=Dvkh3vyyPv1air+Gfk61=uwWwgtD1sZb5PdnA@mail.gmail.com>
Date: Fri, 31 May 2019 17:09:39 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Palmer Dabbelt <palmer@...ive.com>
Cc: luke.r.nels@...il.com, Xi Wang <xi.wang@...il.com>,
Björn Töpel <bjorn.topel@...il.com>,
aou@...s.berkeley.edu, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Network Development <netdev@...r.kernel.org>,
linux-riscv@...ts.infradead.org, bpf <bpf@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf v2] bpf, riscv: clear high 32 bits for ALU32 add/sub/neg/lsh/rsh/arsh
On Fri, May 31, 2019 at 1:40 PM Palmer Dabbelt <palmer@...ive.com> wrote:
>
> On Thu, 30 May 2019 15:29:22 PDT (-0700), luke.r.nels@...il.com wrote:
> > In BPF, 32-bit ALU operations should zero-extend their results into
> > the 64-bit registers.
> >
> > The current BPF JIT on RISC-V emits incorrect instructions that perform
> > sign extension only (e.g., addw, subw) on 32-bit add, sub, lsh, rsh,
> > arsh, and neg. This behavior diverges from the interpreter and JITs
> > for other architectures.
> >
> > This patch fixes the bugs by performing zero extension on the destination
> > register of 32-bit ALU operations.
> >
> > Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G")
> > Cc: Xi Wang <xi.wang@...il.com>
> > Signed-off-by: Luke Nelson <luke.r.nels@...il.com>
>
> Reviewed-by: Palmer Dabbelt <palmer@...ive.com>
>
> Thanks! I'm assuming this is going in through a BPF tree and not the RISC-V
> tree, but LMK if that's not the case.
Applied to bpf tree. Thanks
Powered by blists - more mailing lists