Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp752145lqo; Fri, 10 May 2024 13:56:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7Uli3GOYDKwsKn8MtUcSq8CFjNoxSyHoC5Y7ZN6Ar9bSAO4YA0dtOAb/bNrQllyrVd+kd5ErAYizD/gjQ6z7RXWuv7kX8gcibBef6LA== X-Google-Smtp-Source: AGHT+IHWctEPcVgrn9hZjtfz2+upQy6x145tn00mMn2HesrgTUYjIMk3tCx0mchLx7AaepGiTYOC X-Received: by 2002:a17:907:7893:b0:a59:bf43:4e43 with SMTP id a640c23a62f3a-a5a2d58a672mr211733666b.31.1715374583397; Fri, 10 May 2024 13:56:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715374583; cv=pass; d=google.com; s=arc-20160816; b=KvHxSskcWIywQrq6LbrWeAg0gtrTW7jEbrfD4rBhY+iWWevnZTqaJvain+yYP+GihP DIBjnA64jjbn9bTHYM1sfpqqRbhPkINVeCfkOUJxomAWjRH/4AkwXHmiJaH/l/Qoss6t t1LzipDRnHu7H+Ws0IxtK1vj8sWE4pHP8TGGtQpCDuqybfEeUKMPDIgGMcqYMkh12la3 2bZcmX9zv2w/GjLRbmcptUNb7kSks6z2j1vByrxPsO3j+GjFF6L2WIzOLnNdlimgAL07 wn3u3Y8vZbNNC9K95voYcWwRlUUAiCA29WGhxFJfO24tMerXwDK9kKvsWOZuxiuyA3GX YIvg== 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=i5ddHyY5At6+XqduankGcdUWo6YBN/M2x0UJqR4aGB0=; fh=pg7SZfJx6qRwiBp1hCcNm/54lt+Lw0JmCgK3Ecng1HE=; b=YPqjFInMB9kd9s7xao/kA0ytF4Epn45ay8kKxsemHn2cxRiw9Bx0FifgIezQVEhc4o hQ/DnwkepanCc6zV85Fk0Fxs+Cr+THznnxpC1tQHZ380Vf44IB5GCMohLivwjkP4w3B8 0ekNSa1SyrGfvXTAnihXjWVeOMCrh+hDniKEoJx1dQkgFTu3EDAXLhmGjfWA/8D/uO8q n1ya9KxyO0CqSSKDwLl+sWcVZeHn11uZ9Af4Vb1SK7wPOQoj+lsYFobcXY3X4dM/bkNZ 7KqLUzQpXeAm7MT+sOSl65N0BSB7tJwkF8WBl/o+TyZM4aTNPs0JK3cpAbrwoQVSoYiM ebvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hcX1OJQm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c899si265075966b.1033.2024.05.10.13.56.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 13:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hcX1OJQm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 24A8B1F261D7 for ; Fri, 10 May 2024 20:56:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBB2C13B58F; Fri, 10 May 2024 20:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hcX1OJQm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DA44913AD29; Fri, 10 May 2024 20:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715374575; cv=none; b=CiGLdS7Mf6iVaOVG/t/5Xx+YcDi1UHwNrln6VsR6iGNzvDbeLHKTEW1XNpGJ0uqdiYlJIxtUiTEaejPIrY+R3ObrhOj30X5upKhpNZhCL7yVxUNRnesjIqTavGu/CoaM7L+aJfoW9yCzhStXRt2+ZWHQncrQzp5bQNXgpUKIvlE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715374575; c=relaxed/simple; bh=cByeZ/lC6AB3uZmC/kZETxlLuSZiIR/cTU3FsQbCfIs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sZ329cx4jtynigcSS+hN/+8tHmq5HHniSP2l4sPSEaPQhnxwSrsyJLHOeI/zYBvOrMi3yEqFn/2BSE4957bESFDv+5iohMYednhmkFYg2ibfd5LMzjUStAOf1tVy06wesfHpxqyQdqD8B8nQkxChQviO5F6PAaAd04XzdjNydmE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hcX1OJQm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFF9BC113CC; Fri, 10 May 2024 20:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715374574; bh=cByeZ/lC6AB3uZmC/kZETxlLuSZiIR/cTU3FsQbCfIs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hcX1OJQmLlYLWY4DVkqGz99mxPY7Md3b6PeC4zeEj3znodufL9/snjgAXDo74z6Nh QBcLqcOUTIjNUn03dWuJtdPlU6Edy7WtXcaDdiJFAjyO8PubOS/n4GKlkLRY/GomP2 E401y5gPBQ5wM0cY4NVwWYsZW/tqifWQVavW7TRLvxdq5KK0rQ0nFsFszL/Hpv85Zi UrNGc5lHz/7erFAkz6nSz/HH1vWWpwgM+q/73U8kdiSIHG7n5CyXcrm6SLpOxt3KTW AENf5HG+0MeICek8ytlk1KaL+0pOiYikl1bfs//wxis1KVvwKijPTwvanB8hkfY255 ekmW3goYlpWiw== Date: Fri, 10 May 2024 21:56:07 +0100 From: Conor Dooley To: Xiao Wang Cc: 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, haicheng.li@intel.com Subject: Re: [PATCH] riscv, bpf: Optimize zextw insn with Zba extension Message-ID: <20240510-essay-subwoofer-e055375ff1cb@spud> References: <20240507104528.435980-1-xiao.w.wang@intel.com> 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="jtU1AroXrzjM0WOG" Content-Disposition: inline In-Reply-To: <20240507104528.435980-1-xiao.w.wang@intel.com> --jtU1AroXrzjM0WOG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 07, 2024 at 06:45:28PM +0800, Xiao Wang wrote: > The Zba extension provides add.uw insn which can be used to implement > zext.w with rs2 set as ZERO. >=20 > Signed-off-by: Xiao Wang > --- > arch/riscv/Kconfig | 19 +++++++++++++++++++ > arch/riscv/net/bpf_jit.h | 18 ++++++++++++++++++ > 2 files changed, 37 insertions(+) >=20 > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 6bec1bce6586..0679127cc0ea 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -586,6 +586,14 @@ config RISCV_ISA_V_PREEMPTIVE > preemption. Enabling this config will result in higher memory > consumption due to the allocation of per-task's kernel Vector context. > =20 > +config TOOLCHAIN_HAS_ZBA > + bool > + default y > + depends on !64BIT || $(cc-option,-mabi=3Dlp64 -march=3Drv64ima_zba) > + depends on !32BIT || $(cc-option,-mabi=3Dilp32 -march=3Drv32ima_zba) > + depends on LLD_VERSION >=3D 150000 || LD_VERSION >=3D 23900 > + depends on AS_HAS_OPTION_ARCH > + > config TOOLCHAIN_HAS_ZBB > bool > default y > @@ -601,6 +609,17 @@ config TOOLCHAIN_HAS_VECTOR_CRYPTO > def_bool $(as-instr, .option arch$(comma) +v$(comma) +zvkb) > depends on AS_HAS_OPTION_ARCH > =20 > +config RISCV_ISA_ZBA > + bool "Zba extension support for bit manipulation instructions" > + depends on TOOLCHAIN_HAS_ZBA > + depends on RISCV_ALTERNATIVE > + default y > + help > + Adds support to dynamically detect the presence of the ZBA > + extension (address generation acceleration) and enable its usage. Recently I sent some patches to reword other extensions' help text, because the "add support to dynamically detect" had confused people a bit. Dynamic detection is done regardless of config options for Zba. The wording I went with in my patch for Zbb was: Add support for enabling optimisations in the kernel when the Zbb extension is detected at boot. Could you use something similar here in the opening sentence please? Thanks, Conor. --jtU1AroXrzjM0WOG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZj6J5wAKCRB4tDGHoIJi 0hI6AQCwdFRVZ6kbYjLkxwS53moo/SJNNSnkuYEOouupqPCGPwD/XT7r7ko4jzGW TgQCNlEOK7C1NRhLOBJ754MCcA84/wM= =wgKo -----END PGP SIGNATURE----- --jtU1AroXrzjM0WOG--