lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Dec 2018 07:47:56 +0100
From:   Martin Schwidefsky <schwidefsky@...ibm.com>
To:     Jiong Wang <jiong.wang@...ronome.com>
Cc:     ast@...nel.org, daniel@...earbox.net, netdev@...r.kernel.org,
        oss-drivers@...ronome.com,
        Heiko Carstens <heiko.carstens@...ibm.com>
Subject: Re: [PATH bpf-next 09/13] s390: bpf: implement jitting of JMP32

On Wed, 19 Dec 2018 17:44:16 -0500
Jiong Wang <jiong.wang@...ronome.com> wrote:

> This patch implements code-gen for new JMP32 instructions on s390.
> 
> Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
> Cc: Heiko Carstens <heiko.carstens@...ibm.com>
> Signed-off-by: Jiong Wang <jiong.wang@...ronome.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ