From: Puranjay Mohan <puranjay12@gmail•com>
To: Alexei Starovoitov <ast@kernel•org>,
Daniel Borkmann <daniel@iogearbox•net>,
Andrii Nakryiko <andrii@kernel•org>,
Martin KaFai Lau <martin.lau@linux•dev>,
Song Liu <song@kernel•org>,
Yonghong Song <yonghong.song@linux•dev>,
John Fastabend <john.fastabend@gmail•com>,
KP Singh <kpsingh@kernel•org>,
Stanislav Fomichev <sdf@google•com>, Hao Luo <haoluo@google•com>,
Jiri Olsa <jolsa@kernel•org>,
Shubham Bansal <illusionist.neo@gmail•com>,
Russell King <linux@armlinux•org.uk>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership•com>,
Helge Deller <deller@gmx•de>,
"Naveen N. Rao" <naveen.n.rao@linux•ibm.com>,
Michael Ellerman <mpe@ellerman•id.au>,
Nicholas Piggin <npiggin@gmail•com>,
Christophe Leroy <christophe.leroy@csgroup•eu>,
Luke Nelson <luke.r.nels@gmail•com>, Xi Wang <xi.wang@gmail•com>,
Paul Walmsley <paul.walmsley@sifive•com>,
Palmer Dabbelt <palmer@dabbelt•com>,
Albert Ou <aou@eecs•berkeley.edu>,
Wang YanQing <udknight@gmail•com>,
bpf@vger•kernel.org, linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, linux-parisc@vger•kernel.org,
linuxppc-dev@lists•ozlabs.org, linux-riscv@lists•infradead.org,
netdev@vger•kernel.org
Cc: puranjay12@gmail•com
Subject: [PATCH bpf-next 3/6] bpf, parisc32: Always zero extend for LDX with B/W/H
Date: Tue, 12 Sep 2023 22:46:51 +0000 [thread overview]
Message-ID: <20230912224654.6556-4-puranjay12@gmail.com> (raw)
In-Reply-To: <20230912224654.6556-1-puranjay12@gmail.com>
The JITs should not depend on the verifier for zero extending the upper
32 bits of the destination register when loading a byte, half-word, or
word.
A following patch will make the verifier stop patching zext instructions
after LDX.
Signed-off-by: Puranjay Mohan <puranjay12@gmail•com>
---
arch/parisc/net/bpf_jit_comp32.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/parisc/net/bpf_jit_comp32.c b/arch/parisc/net/bpf_jit_comp32.c
index 5ff0cf925fe9..cc3972d6c971 100644
--- a/arch/parisc/net/bpf_jit_comp32.c
+++ b/arch/parisc/net/bpf_jit_comp32.c
@@ -1026,18 +1026,15 @@ static int emit_load_r64(const s8 *dst, const s8 *src, s16 off,
switch (size) {
case BPF_B:
emit(hppa_ldb(off + 0, srcreg, lo(rd)), ctx);
- if (!ctx->prog->aux->verifier_zext)
- emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
+ emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
break;
case BPF_H:
emit(hppa_ldh(off + 0, srcreg, lo(rd)), ctx);
- if (!ctx->prog->aux->verifier_zext)
- emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
+ emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
break;
case BPF_W:
emit(hppa_ldw(off + 0, srcreg, lo(rd)), ctx);
- if (!ctx->prog->aux->verifier_zext)
- emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
+ emit_hppa_copy(HPPA_REG_ZERO, hi(rd), ctx);
break;
case BPF_DW:
emit(hppa_ldw(off + 0, srcreg, hi(rd)), ctx);
--
2.39.2
next prev parent reply other threads:[~2023-09-12 22:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 22:46 [PATCH bpf-next 0/6] bpf: verifier: stop emitting zext for LDX Puranjay Mohan
2023-09-12 22:46 ` [PATCH bpf-next 1/6] bpf, riscv32: Always zero extend for LDX with B/W/H Puranjay Mohan
2023-09-12 22:46 ` [PATCH bpf-next 2/6] bpf, x86-32: " Puranjay Mohan
2023-09-12 22:46 ` Puranjay Mohan [this message]
2023-09-12 22:46 ` [PATCH bpf-next 4/6] bpf, powerpc32: Always zero extend for LDX Puranjay Mohan
2023-09-12 22:46 ` [PATCH bpf-next 5/6] bpf, arm32: Always zero extend for LDX with B/H/W Puranjay Mohan
2023-09-12 23:03 ` Russell King (Oracle)
2023-09-12 23:16 ` Puranjay Mohan
2023-09-13 0:10 ` Alexei Starovoitov
2023-09-12 22:46 ` [PATCH bpf-next 6/6] bpf, verifier: always mark destination of LDX as 64-bit Puranjay Mohan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230912224654.6556-4-puranjay12@gmail.com \
--to=puranjay12@gmail$(echo .)com \
--cc=James.Bottomley@HansenPartnership$(echo .)com \
--cc=andrii@kernel$(echo .)org \
--cc=aou@eecs$(echo .)berkeley.edu \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=christophe.leroy@csgroup$(echo .)eu \
--cc=daniel@iogearbox$(echo .)net \
--cc=deller@gmx$(echo .)de \
--cc=haoluo@google$(echo .)com \
--cc=illusionist.neo@gmail$(echo .)com \
--cc=john.fastabend@gmail$(echo .)com \
--cc=jolsa@kernel$(echo .)org \
--cc=kpsingh@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=luke.r.nels@gmail$(echo .)com \
--cc=martin.lau@linux$(echo .)dev \
--cc=mpe@ellerman$(echo .)id.au \
--cc=naveen.n.rao@linux$(echo .)ibm.com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=npiggin@gmail$(echo .)com \
--cc=palmer@dabbelt$(echo .)com \
--cc=paul.walmsley@sifive$(echo .)com \
--cc=sdf@google$(echo .)com \
--cc=song@kernel$(echo .)org \
--cc=udknight@gmail$(echo .)com \
--cc=xi.wang@gmail$(echo .)com \
--cc=yonghong.song@linux$(echo .)dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox