From patchwork Tue Jun 21 08:58:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Naveen N. Rao" X-Patchwork-Id: 638619 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rYkJb3p57z9sCp for ; Tue, 21 Jun 2016 20:20:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbcFUKUe (ORCPT ); Tue, 21 Jun 2016 06:20:34 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28489 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbcFUKU1 (ORCPT ); Tue, 21 Jun 2016 06:20:27 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5L8x34R147064 for ; Tue, 21 Jun 2016 04:59:26 -0400 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 23n2cr4ftf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 21 Jun 2016 04:59:26 -0400 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 Jun 2016 18:59:23 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 21 Jun 2016 18:59:21 +1000 X-IBM-Helo: d23dlp02.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 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id C25792BB0055; Tue, 21 Jun 2016 18:59:20 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5L8xKeA1376638; Tue, 21 Jun 2016 18:59:20 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5L8xJO3009426; Tue, 21 Jun 2016 18:59:20 +1000 Received: from naverao1-tp.localdomain (naverao1-tp.in.ibm.com [9.124.35.165]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5L8xEke009312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jun 2016 18:59:16 +1000 Date: Tue, 21 Jun 2016 14:28:07 +0530 From: "Naveen N. Rao" To: Thadeu Lima de Souza Cascardo , Michael Ellerman Cc: 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> <20160619174914.GC8886@naverao1-tp.localdomain> <20160620185620.GD3516@indiana.gru.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160620185620.GD3516@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: 16062108-1617-0000-0000-0000012FB68E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062108-1618-0000-0000-0000461E156B Message-Id: <20160621085807.GE8886@naverao1-tp.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-21_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=8 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606210108 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2016/06/20 03:56PM, Thadeu Lima de Souza Cascardo wrote: > On Sun, Jun 19, 2016 at 11:19:14PM +0530, Naveen N. Rao wrote: > > On 2016/06/17 10:00AM, Thadeu Lima de Souza Cascardo wrote: > > > > > > 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. > > Hi, Naveen. > > Any tips on how to exercise possible issues there? Or what changes you think > would be sufficient? The calling convention is different with ABIv2 and so we'll need changes in bpf_slow_path_common() and sk_negative_common(). However, rather than enabling classic JIT for ppc64le, are we better off just disabling it? Michael, Let me know your thoughts on whether you intend to take this patch or Cascardo's patch for -stable before the eBPF patches. I can redo my patches accordingly. - Naveen --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -128,7 +128,7 @@ config PPC select IRQ_FORCED_THREADING select HAVE_RCU_TABLE_FREE if SMP select HAVE_SYSCALL_TRACEPOINTS - select HAVE_CBPF_JIT + select HAVE_CBPF_JIT if CPU_BIG_ENDIAN select HAVE_ARCH_JUMP_LABEL select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAS_GCOV_PROFILE_ALL