Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3261385lqo; Wed, 15 May 2024 04:51:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWU5XRB8Kx151L1oVGGrKjBeTJBuHyfTV7ISrfdukkh2ykkega7+6wH2fykJGpj1x71pCJYYdYBAvOx3BC62SGA8mDKG0fdp87d6podw== X-Google-Smtp-Source: AGHT+IGFDSpzA+wETQ1Q0r382dTKcG1CJMVfioHj3TdXDpiGwM9oNbOSDxq1H6RtvbEgy32Slqlt X-Received: by 2002:a05:6358:70c1:b0:192:a213:e26 with SMTP id e5c5f4694b2df-193bcfffe3dmr1730601955d.21.1715773918737; Wed, 15 May 2024 04:51:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715773918; cv=pass; d=google.com; s=arc-20160816; b=hkMHemVgmsb+tZYlAIUzc8+LvXcGc+j+3XITPMTe41RNDX8wKzIODW6oZwntN8GGIE SLt386QJDb1M8BtPtpWDHNlFMVF7EiUoJiqNCXoWvo795RRbQU0Bc6qPk71DuP8ghK2F 3si5+KSjPYBTR0lULkfGdYpGoLt5Ls+xQrqFOAd+LP4I+zHmCWptusib9O38em69r4jf ZPKKjZB1Zot+uBGyh4LWdUzF2rAc8vAh2sl2lx7O3rrBhYwklFkUt0OfwcAbqX676QwN cFLHiMAeLIfS9eCFiTL6dmgu1zilRbi9Uv+eHZmZiKGPaSQ7NZ6EVGD4CeoAmRbH/GPB DIzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GdvQ3kH47JlZhzV5G7bHu6bKjpEJvCPgt4JPEYVNd3A=; fh=pJni3W5bSfBX4JrrV56/EkymOsx/pk/TyaniliP5T9Q=; b=UfOJ6160xK+mq6d4i24Nk6vmYAk0b6Ti9u7LlpzFBJujh/7+TN4d0SkDzmon58Lv7/ i3ixQnjCVSERhuAtrgZJyL3xwPLZfmRxgUVX6aHtQAtSIp8VJmqZf/UqX+BDJJ1jiOn5 jkaEaefObFjipgsZKJLiPl9/Xos85dY1L79eBVrZSSBrLLRg+HxOxCrBt2TnGhDCVsL5 HNOIdtUDXK5SXtxPIuDjvoHWkP/EwCkkR65oNj5aMikfnlrotgrVGAM6hyc0NU4wNYnc L3vcVoXXzk1epJKYPfa/6bcaZMjUaYhgs+0WA1reSPMdIqXjzf814DmWpOWqAbhcqg6u cMxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=kwyUd6Y3; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-179820-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63414050322si13740526a12.891.2024.05.15.04.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 04:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179820-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=kwyUd6Y3; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-179820-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 85738B22E1A for ; Wed, 15 May 2024 11:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CE3F74407; Wed, 15 May 2024 11:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="kwyUd6Y3" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 007AC5A0F5; Wed, 15 May 2024 11:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715773904; cv=none; b=j4IL3j4FUJG59XWFhCy3MOgLjH25/GQI1Z+1mhuBRP9LzIvj+gHTx++U7DEzriyiObjCdaMmDfgEhGJQ4ZsR9MnJrJPGB8sm4jEM9PaCnCqr0Jm/xBDwbU3TBdv5e3IgcVNbisE9eT7x2nYDNWCf90W/uqNo0JfnrRrDdBX/N4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715773904; c=relaxed/simple; bh=GdvQ3kH47JlZhzV5G7bHu6bKjpEJvCPgt4JPEYVNd3A=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IcF5wCBA+LFs3YMbkEy2oamGlc6ofK6TvCh3JUKG7/c3Ta6/K2VDAjIXaAc6aVMDS/A+Q25HlgLBEN/hsqnIZmTk7xn9FNh5HzIgFu+uv9ucpCrCGbdz94ylsu1mz7iiM8HzoRqDrw9p1LLVZ0qu1CQM4s4VwuoxHIjJW5yTdj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=kwyUd6Y3; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715773901; x=1747309901; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GdvQ3kH47JlZhzV5G7bHu6bKjpEJvCPgt4JPEYVNd3A=; b=kwyUd6Y3O87zVnp6ORJIAFBHpJIfjn8wPpBTNaiulqBl0Rf2K3M870fx Y2PVKr3Zak1z9/lZRMdVbh1IDT5Hw+B7g1kMh7U4daeD/Y2pFuvhKEbS4 4or6D77ONCMk1X64o8Lb7AsZMQhJuoRdcqdxz4VnoAsvgi2vHOUawFsKO diG13Bs4U1vmV2yvXQvucsHysEQm7KKiGIm764xglPuNZYM8DupefFdc6 I1tI0J6dcZXr0mYEARHe9lszzB1P5WgrebSX1G5X6YvDBdA22IYWsONNF j+nDF+ZesHKY5+AQU/fvbYauZ+3vMTU9hz/rMvp/7UDUew/FP0N/hC9WN w==; X-CSE-ConnectionGUID: ud8/5qnhRsubTfo6bloRBg== X-CSE-MsgGUID: YPeKYJfeQtqP+N3X1UJ6iw== X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; d="asc'?scan'208";a="192175672" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 May 2024 04:51:39 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 15 May 2024 04:51:23 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 15 May 2024 04:51:19 -0700 Date: Wed, 15 May 2024 12:51:04 +0100 From: Conor Dooley To: "Wang, Xiao W" CC: Andrew Jones , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" , "luke.r.nels@gmail.com" , "xi.wang@gmail.com" , "bjorn@kernel.org" , "ast@kernel.org" , "daniel@iogearbox.net" , "andrii@kernel.org" , "martin.lau@linux.dev" , "eddyz87@gmail.com" , "song@kernel.org" , "yonghong.song@linux.dev" , "john.fastabend@gmail.com" , "kpsingh@kernel.org" , "sdf@google.com" , "haoluo@google.com" , "jolsa@kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "bpf@vger.kernel.org" , "pulehui@huawei.com" , "Li, Haicheng" , "conor@kernel.org" , Ben Dooks Subject: Re: [PATCH v2] riscv, bpf: Optimize zextw insn with Zba extension Message-ID: <20240515-wobble-stack-5b9264c12f37@wendy> References: <20240511023436.3282285-1-xiao.w.wang@intel.com> <20240513-5c6f04fb4a29963c63d09aa2@orel> <20240514-944dec90b2c531d8b6c783f7@orel> <20240515-cone-getting-d17037b51e97@wendy> <20240515-jogger-pummel-19fe4e9e8314@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="maladpWpE2+wJpPh" Content-Disposition: inline In-Reply-To: --maladpWpE2+wJpPh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 11:31:43AM +0000, Wang, Xiao W wrote: > > From: Conor Dooley > > > > My preferences is to remove as much of the TOOLCHAIN_HAS_ stuff as > > > > possible. We should audit the extensions which have them to see if > > > > they're really necessary. > > > > > > While I think it is reasonable to allow the "RISCV_ISA_ZBB" option to > > > control whether or not bpf is allowed to use it for optimisations, on= ly > > > allowing bpf to do that if there's toolchain support feels odd to me.. > > > Maybe we need to sorta steal from Charlie's patchset and introduce > > > some hidden options that have the toolchain dep that are used by the > > > alternative macros etc? > > > > > > I'll have a poke at how bad that looks I think. > >=20 > > I don't love this, in particular my option naming, but it would allow > > the Zbb optimisations in the kernel to not depend on toolchain support > > while not muddying the Kconfig waters for users: > > https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/= ?h=3Dri > > scv-zbb_split >=20 > In that patch, I think the bpt jit part should check IS_ENABLED(CONFIG_RI= SCV_ISA_ZBB) > rather than IS_ENABLED(CONFIG_RISCV_ISA_ZBB_ALT). D'oh, you're right. The bpf code being different was meant to be the whole point of the change... > > A similar model could be followed if there were to be some > > optimisations for Zba in the future that do require toolchain support: >=20 > Though this model introduces extra hidden Kconfig option, it does provide= finer=20 > config granularity. This should be a separate patch in the future, we can= discuss about > the option naming there. Yeah, not expecting you to do this as part of this patch. Thanks, Conor. --maladpWpE2+wJpPh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZkShnwAKCRB4tDGHoIJi 0sTgAPwICMKtZQim3Vt/IyQaj7mA09XXCNeqaMmOhqqrqRhmcAD+JuScaCRXPxMN fi/Dv2IKekKAVwvT3aEZbt7ZJnLMjg4= =znv+ -----END PGP SIGNATURE----- --maladpWpE2+wJpPh--