From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Jiong Wang <jiong.wang@netronome.com>
Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org,
oss-drivers@netronome.com,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: [PATH bpf-next 09/13] s390: bpf: implement jitting of JMP32
Date: Thu, 20 Dec 2018 07:47:56 +0100 [thread overview]
Message-ID: <20181220074756.10b7634d@mschwideX1> (raw)
In-Reply-To: <1545259460-13376-10-git-send-email-jiong.wang@netronome.com>
On Wed, 19 Dec 2018 17:44:16 -0500
Jiong Wang <jiong.wang@netronome.com> wrote:
> This patch implements code-gen for new JMP32 instructions on s390.
>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
> ---
> arch/s390/net/bpf_jit_comp.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
> index 3ff758e..c7101e5 100644
> --- a/arch/s390/net/bpf_jit_comp.c
> +++ b/arch/s390/net/bpf_jit_comp.c
> @@ -1186,21 +1186,25 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
> /* lgfi %w1,imm (load sign extend imm) */
> EMIT6_IMM(0xc0010000, REG_W1, imm);
> /* cgrj %dst,%w1,mask,off */
Please correct the comment about the instruction as well. Dependent on the
BPF_JMP_SUBOP_32BIT in src_reg the instruction is either cgrj or crj.
> - EMIT6_PCREL(0xec000000, 0x0064, dst_reg, REG_W1, i, off, mask);
> + EMIT6_PCREL(0xec000000, src_reg ? 0x0076 : 0x0064,
> + dst_reg, REG_W1, i, off, mask);
> break;
> branch_ku:
> /* lgfi %w1,imm (load sign extend imm) */
> EMIT6_IMM(0xc0010000, REG_W1, imm);
> /* clgrj %dst,%w1,mask,off */
Same here, dependent on src_reg either clgrj or clrj.
> - EMIT6_PCREL(0xec000000, 0x0065, dst_reg, REG_W1, i, off, mask);
> + EMIT6_PCREL(0xec000000, src_reg ? 0x0077 : 0x0065,
> + dst_reg, REG_W1, i, off, mask);
> break;
> branch_xs:
> /* cgrj %dst,%src,mask,off */
Same same, dependent on imm either cgrj or crj.
> - EMIT6_PCREL(0xec000000, 0x0064, dst_reg, src_reg, i, off, mask);
> + EMIT6_PCREL(0xec000000, imm ? 0x0076 : 0x0064,
> + dst_reg, src_reg, i, off, mask);
> break;
> branch_xu:
> /* clgrj %dst,%src,mask,off */
And again, dependent on imm either clgrj or clrj.
> - EMIT6_PCREL(0xec000000, 0x0065, dst_reg, src_reg, i, off, mask);
> + EMIT6_PCREL(0xec000000, imm ? 0x0077 : 0x0065,
> + dst_reg, src_reg, i, off, mask);
> break;
> branch_oc:
> /* brc mask,jmp_off (branch instruction needs 4 bytes) */
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2018-12-20 6:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 22:44 [PATH bpf-next 00/13] bpf: propose new jmp32 instructions Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 01/13] bpf: encoding description and macros for JMP32 Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 02/13] bpf: interpreter support " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 03/13] bpf: JIT blinds support JMP32 Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 04/13] x86_64: bpf: implement jitting of JMP32 Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 05/13] x32: " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 06/13] arm64: " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 07/13] arm: " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 08/13] ppc: " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 09/13] s390: " Jiong Wang
2018-12-20 6:47 ` Martin Schwidefsky [this message]
2018-12-19 22:44 ` [PATH bpf-next 10/13] nfp: " Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 11/13] bpf: verifier support JMP32 Jiong Wang
2018-12-19 23:54 ` Jakub Kicinski
2019-01-08 15:23 ` Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 12/13] bpf: unit tests for JMP32 Jiong Wang
2018-12-19 22:44 ` [PATH bpf-next 13/13] selftests: bpf: makefile support sub-register code-gen test mode Jiong Wang
2018-12-20 3:08 ` [PATH bpf-next 00/13] bpf: propose new jmp32 instructions Alexei Starovoitov
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=20181220074756.10b7634d@mschwideX1 \
--to=schwidefsky@de.ibm.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=heiko.carstens@de.ibm.com \
--cc=jiong.wang@netronome.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.