From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F810C4345F for ; Wed, 1 May 2024 10:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QIVRA3/RgtuNaMFZLs2xO504TgFqHerWaYHZsFYJ3/Y=; b=Sze+RvEXmkIt3Z/0J/1rr69zZW AM23s+YgVRjQISO91ecTGqgQzYhVs+57Trul3OSdiFyx4d/ckdVJ0jDfbNqjTz0UFoMqJTKP8mEjj TTxEEPD/3jIPaBd8wn4ynBvivpUP72/fmhQq8HH8/0kMTLpawF+KjQVvgFMNBLo9DJFwycFN/3/8y SyXy/2lF2dQdqlD7scVpS8eiQ/wiF5KQoNUlau5UvaSTyR2i4RYn1VeL3kDR1/i2sACMm3IHt9SbK fj7nFgVTd3g8N1KFZHQeacIhKT4Meq5WFJY6m8Fh35OTNUum7OPM0S47M6gbo81c7hXGcKuIqm2vU iBUUQxmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s27Tj-000000097qS-15Z0; Wed, 01 May 2024 10:46:23 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s27Te-000000097oN-27UU; Wed, 01 May 2024 10:46:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 56E68CE1287; Wed, 1 May 2024 10:46:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D304BC113CC; Wed, 1 May 2024 10:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714560374; bh=bX0yFlagqPxL0dHVhtKj3sAKB8RRba8ErDXH4L/dIlM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TOQlLWewBQhULLcVzVr3hASRrCE4wgGiJ7futMijuDRrO24JY+JBhielx22xMrfiM CXxWH8VktaCHkkyQgueekYdahaGDIr0L80H30Vt+7pU7vIRz5inSaRuaiDeZsgE8Ik OfVh2Bsf/0eH4c2Fr5PFjPe4IW0+r3+YG0a97ectlPzyVsDTzMoMDq1nZVQXWL0Y3O BCvWFWfZGIjFVI1u9XGgt1QQKEEAN+KkH6V3zaG6Wf/khOzkt0V8HcwdVQ/CW+9lRn qXhbbK8qmKKaOG7Iw+pIqQXv3c0JBG5JvPpPhm2ZTVHRTsURmoQ4aSYFh9Jr0xfeOZ sjzdEnGxpkUrg== Date: Wed, 1 May 2024 11:46:07 +0100 From: Conor Dooley To: Charlie Jenkins Cc: Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Evan Green , =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Jonathan Corbet , Shuah Khan , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 05/16] riscv: Extend cpufeature.c to detect vendor extensions Message-ID: <20240501-chastise-gecko-342f2c35cfc1@spud> References: <20240426-dev-charlie-support_thead_vector_6_9-v4-0-b692f3c516ec@rivosinc.com> <20240426-dev-charlie-support_thead_vector_6_9-v4-5-b692f3c516ec@rivosinc.com> MIME-Version: 1.0 In-Reply-To: <20240426-dev-charlie-support_thead_vector_6_9-v4-5-b692f3c516ec@rivosinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_034620_339518_8A54815A X-CRM114-Status: GOOD ( 21.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6333807013100400151==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6333807013100400151== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IU1h/zA/fxPmJmrU" Content-Disposition: inline --IU1h/zA/fxPmJmrU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2024 at 02:29:19PM -0700, Charlie Jenkins wrote: > Separate vendor extensions out into one struct per vendor > instead of adding vendor extensions onto riscv_isa_ext. >=20 > Add a hidden config RISCV_ISA_VENDOR_EXT to conditionally include this > code. >=20 > The xtheadvector vendor extension is added using these changes. This mostly looks good to me, thanks for the updates. There's one thing that I think is wrong, but I need to test and will get back to you on... > Signed-off-by: Charlie Jenkins > --- > arch/riscv/Kconfig | 2 + > arch/riscv/Kconfig.vendor | 19 ++++++ > arch/riscv/include/asm/cpufeature.h | 18 ++++++ > arch/riscv/include/asm/vendor_extensions.h | 26 ++++++++ > arch/riscv/include/asm/vendor_extensions/thead.h | 19 ++++++ > arch/riscv/kernel/Makefile | 2 + > arch/riscv/kernel/cpufeature.c | 77 ++++++++++++++++++= ------ > arch/riscv/kernel/vendor_extensions.c | 18 ++++++ > arch/riscv/kernel/vendor_extensions/Makefile | 3 + > arch/riscv/kernel/vendor_extensions/thead.c | 36 +++++++++++ > 10 files changed, 200 insertions(+), 20 deletions(-) >=20 > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index be09c8836d56..fec86fba3acd 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -759,6 +759,8 @@ config RISCV_EFFICIENT_UNALIGNED_ACCESS > =20 > endchoice > =20 > +source "arch/riscv/Kconfig.vendor" > + > endmenu # "Platform type" > =20 > menu "Kernel features" > diff --git a/arch/riscv/Kconfig.vendor b/arch/riscv/Kconfig.vendor > new file mode 100644 > index 000000000000..4fc86810af1d > --- /dev/null > +++ b/arch/riscv/Kconfig.vendor > @@ -0,0 +1,19 @@ > +menu "Vendor extensions" > + > +config RISCV_ISA_VENDOR_EXT > + bool > + > +menu "T-Head" > +config RISCV_ISA_VENDOR_EXT_THEAD > + bool "T-Head vendor extension support" > + select RISCV_ISA_VENDOR_EXT > + default y > + help > + Say N here if you want to disable all T-Head vendor extension > + support. This will cause any T-Head vendor extensions that are > + requested to be ignored. What does "requested to be ignored" mean to a punter configuring a kernel? I'd expect this to be something like: "Say N here to disable detection of and support for all T-Head vendor extensions. Without this option enabled, T-Head vendor extensions will not be detected at boot and their presence not reported to userspace." In general, I'd expect something that needs some support in the kernel (like vector) to function to have a dedicated option, but the likes of their Zba variant could be detected and reported via hwprobe et al once RISCV_ISA_VENDOR_EXT_THEAD is enabled. Cheers, Conor. --IU1h/zA/fxPmJmrU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZjIdbwAKCRB4tDGHoIJi 0h/4AQDbSwC+zSd2L4oMXZ62nZMJrbPWx5JE9S7nb98blCe6XwEAgXMzwjjp4Aq0 0/Nm2H/CfihseOibQXFgeXh59NryOgo= =g7p2 -----END PGP SIGNATURE----- --IU1h/zA/fxPmJmrU-- --===============6333807013100400151== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6333807013100400151==--