From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbcFSRuf (ORCPT ); Sun, 19 Jun 2016 13:50:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14577 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbcFSRub (ORCPT ); Sun, 19 Jun 2016 13:50:31 -0400 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: naveen.n.rao@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;netdev@vger.kernel.org Date: Sun, 19 Jun 2016 23:19:14 +0530 From: "Naveen N. Rao" To: Thadeu Lima de Souza Cascardo Cc: Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, Matt Evans , Daniel Borkmann , Alexei Starovoitov , Denis Kirjanov , Paul Mackerras , "David S. Miller" , Ananth N Mavinakayanahalli Subject: Re: [PATCH] ppc: Fix BPF JIT for ABIv2 References: <908d3552b5eb240b28f70aee7c4c86e2b600aa02.1465304785.git.naveen.n.rao@linux.vnet.ibm.com> <3rWKtT2tSrz9t2G@ozlabs.org> <20160617130042.GO3516@indiana.gru.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160617130042.GO3516@indiana.gru.redhat.com> User-Agent: Mutt/1.6.0 (2016-04-01) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061917-0008-0000-0000-0000009AE046 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061917-0009-0000-0000-0000077EC7E6 Message-Id: <20160619174914.GC8886@naverao1-tp.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-19_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606190204 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/06/17 10:00AM, Thadeu Lima de Souza Cascardo wrote: > On Fri, Jun 17, 2016 at 10:53:21PM +1000, Michael Ellerman wrote: > > On Tue, 2016-07-06 at 13:32:23 UTC, "Naveen N. Rao" wrote: > > > diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c > > > new file mode 100644 > > > index 0000000..954ff53 > > > --- /dev/null > > > +++ b/arch/powerpc/net/bpf_jit_comp64.c > > > @@ -0,0 +1,956 @@ > > ... > > > + > > > +static void bpf_jit_fill_ill_insns(void *area, unsigned int size) > > > +{ > > > + int *p = area; > > > + > > > + /* Fill whole space with trap instructions */ > > > + while (p < (int *)((char *)area + size)) > > > + *p++ = BREAKPOINT_INSTRUCTION; > > > +} > > > > This breaks the build for some configs, presumably you're missing a header: > > > > arch/powerpc/net/bpf_jit_comp64.c:30:10: error: 'BREAKPOINT_INSTRUCTION' undeclared (first use in this function) > > > > http://kisskb.ellerman.id.au/kisskb/buildresult/12720611/ > > > > cheers > > Hi, Michael and Naveen. > > I noticed independently that there is a problem with BPF JIT and ABIv2, and > worked out the patch below before I noticed Naveen's patchset and the latest > changes in ppc tree for a better way to check for ABI versions. > > However, since the issue described below affect mainline and stable kernels, > would you consider applying it before merging your two patchsets, so that we can > more easily backport the fix? Hi Cascardo, Given that this has been broken on ABIv2 since forever, I didn't bother fixing it. But, I can see why this would be a good thing to have for -stable and existing distros. However, while your patch below may fix the crash you're seeing on ppc64le, it is not sufficient -- you'll need changes in bpf_jit_asm.S as well. Regards, Naveen