From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Holzheu Subject: Re: [PATCH bpf-next 07/13] bpf, s390x: remove obsolete exception handling from div/mod Date: Mon, 29 Jan 2018 15:33:57 +0100 Message-ID: <20180129153357.7e2cc0c8@TP-holzheu> References: <20180126223348.11250-1-daniel@iogearbox.net> <20180126223348.11250-8-daniel@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ast@kernel.org, netdev@vger.kernel.org To: Daniel Borkmann Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47652 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751337AbeA2Oeb (ORCPT ); Mon, 29 Jan 2018 09:34:31 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0TEYTQd094762 for ; Mon, 29 Jan 2018 09:34:30 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ft3g4dw8u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2018 09:34:25 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jan 2018 14:33:58 -0000 In-Reply-To: <20180126223348.11250-8-daniel@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: Am Fri, 26 Jan 2018 23:33:42 +0100 schrieb Daniel Borkmann : > Since we've changed div/mod exception handling for src_reg in > eBPF verifier itself, Maybe add the commit that introduced that to the patch description? > remove the leftovers from s390x JIT. > > Signed-off-by: Daniel Borkmann > Cc: Michael Holzheu > --- > arch/s390/net/bpf_jit_comp.c | 10 ---------- > 1 file changed, 10 deletions(-) > > diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c > index e501887..78a19c9 100644 > --- a/arch/s390/net/bpf_jit_comp.c > +++ b/arch/s390/net/bpf_jit_comp.c > @@ -610,11 +610,6 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i > { > int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0; > > - jit->seen |= SEEN_RET0; > - /* ltr %src,%src (if src == 0 goto fail) */ > - EMIT2(0x1200, src_reg, src_reg); > - /* jz */ > - EMIT4_PCREL(0xa7840000, jit->ret0_ip - jit->prg); > /* lhi %w0,0 */ > EMIT4_IMM(0xa7080000, REG_W0, 0); > /* lr %w1,%dst */ > @@ -630,11 +625,6 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i > { > int rc_reg = BPF_OP(insn->code) == BPF_DIV ? REG_W1 : REG_W0; > > - jit->seen |= SEEN_RET0; > - /* ltgr %src,%src (if src == 0 goto fail) */ > - EMIT4(0xb9020000, src_reg, src_reg); > - /* jz */ > - EMIT4_PCREL(0xa7840000, jit->ret0_ip - jit->prg); > /* lghi %w0,0 */ > EMIT4_IMM(0xa7090000, REG_W0, 0); > /* lgr %w1,%dst */ If the check is done in the verifier now, this looks good to me. Reviewed-by: Michael Holzheu