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 112ACC54E60 for ; Thu, 14 Mar 2024 20:41:39 +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=6KZu/1qvdw2Fog0TB7neV6KDabUpGUOcgabdyQcQ7aY=; b=D9UmgIJmCpDzES4UGOtF2gRYzQ E9/Bg8/aW7s4zPg69GpbNDIKvqYmn9Lejbd40wdLTOFwuoMnemeXNwaDoDgqXk/zIvNAoUtY50Mpm IAkBKYy1MhysL50/qCFiqhxfhiL9Xt4eoYCX7yuq4N4QNCNPZf0ZOKiIk+aYFJ3a7bGCl5H+a2+nL 7sDsaebTUE6e9pL5mZupBB/bEETDg6tKb0q0sAAUHzNLfl8zaQXbiKqaFfiWjhQegvJ09E8eDBff9 4Vk5sdj8AVoeGQHktGqaIxrAm6lSxXeSmYrKw7FQzXU3r6dMPxJaN6JowV6P6pP0XEDq5Nd9cfgQD B/J216pA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkrtG-0000000Fdxx-1ksO; Thu, 14 Mar 2024 20:41:26 +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 1rkrtD-0000000FdxS-0KhQ; Thu, 14 Mar 2024 20:41:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3FF0BCE1E3F; Thu, 14 Mar 2024 20:41:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 652ACC433F1; Thu, 14 Mar 2024 20:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710448880; bh=D8dmCbnX6rijB2nPz1wQDTif25zMAHPrUq0OSfJuNeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r5j0NKIgtC9wYzEQDR7OqXRqnqwvYIK6xaMMZELt10g+TDIYs2sG/ZzPOC0RfzHLr 3d6iDw4Vn4IP8s8zK97INEis4zXyGyisQKNUnbfFoQh/eNtf9IkXAQCdn859mbKGNY m2tHSJI4S/X1A/bxniT3FSCKD5w6I/0z6Yh0StWCLl8D/+4ojCS3V2fOEAAw4ICCim LzOplpM0A0NYvBM+dbgg0f+rOd0AE8Bo2vZdBB90d5o0trWYOj5i+VgoE/uBiCbfup SDpJkdBDWtb1TyvT08xT+mOwXXLKda6UdycdcRGdiFYXWrR9jRuxjg5iLObCjSZ48b NSq7SnRX42hug== Date: Thu, 14 Mar 2024 20:41:15 +0000 From: Conor Dooley To: Inochi Amaoto Cc: Qingfang Deng , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland , Andrew Jones , Conor Dooley , Heiko Stuebner , Guo Ren , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] perf: RISC-V: fix IRQ detection on T-Head C908 Message-ID: <20240314-pep-announcer-2d7f10ff8b65@spud> References: <20240311063018.1886757-1-dqfext@gmail.com> <20240312-evil-resource-66370b68b9b4@spud> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240314_134123_509863_72B4FBDD X-CRM114-Status: GOOD ( 47.41 ) 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="===============0541156388039161657==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0541156388039161657== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7VnajYQ5dXc+P0Cg" Content-Disposition: inline --7VnajYQ5dXc+P0Cg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 13, 2024 at 09:31:26AM +0800, Inochi Amaoto wrote: > On Tue, Mar 12, 2024 at 02:07:31PM +0000, Conor Dooley wrote: > > On Mon, Mar 11, 2024 at 03:56:29PM +0800, Qingfang Deng wrote: > > > Hi Inochi, > > >=20 > > > On Mon, Mar 11, 2024 at 3:13=E2=80=AFPM Inochi Amaoto wrote: > > > > > > > > On Mon, Mar 11, 2024 at 02:30:18PM +0800, Qingfang Deng wrote: > > > > > T-Head C908 has the same IRQ num and CSR as previous C9xx cores, = but > > > > > reports non-zero marchid and mimpid. Remove the ID checks. > > > > > > > > > > > > > Hi, Qingfang, > > > > > > > > IIRC, the existed C908 SoC (such as K230) have an early version > > > > of C908 core. But C908 core itself may support Sscofpmf. > > > > So I do not think removing the ID checks is a good idea. Instead, > > > > I suggest adding CPUID of your SoC to this check. > > >=20 > > > As of Feb 2024, the latest C908 revision does not support Sscofpmf. > > > You may Google "C908R1S0" to see its user manual. > > > But I think you're right. Even though C908 does not have Sscofpmf, > > > T-Head may release new SoCs which do have Sscofpmf, and the check will > > > break. I will submit a new patch with your suggested changes. > >=20 > > If on an SoC where they have updated vector to 1.0 and implemented both > > Zicbom and Svpbmt instead of their custom stuff they did not implement > > Sscofpmf I think we can expect they won't move away from their custom > > implementation soon. > > I do agree that we should not remove the ID checks entirely, but I also > > do not want to be adding an ID for every SoC that needs this. I think we > > should be getting this information from DT going forward. > > The DT parsing is done prior to the application of boot time > > alternatives, so I think we could apply the "erratum" based on the DT. > >=20 > > I'm also pretty sure that we can also modify the existing code for the > > archid =3D=3D impid =3D=3D 0x0 case to set a pseudo isa extension so th= at the > > perf driver could do call riscv_isa_eextension_available() and not worry > > about the specfic conditions in which that is true. It'd be something > > like this patch: > > https://lore.kernel.org/linux-riscv/20240110073917.2398826-8-peterlin@a= ndestech.com/ > > Just without removing the archid =3D=3D impid =3D=3D 0x0 case from the = errata > > code. If you're lost after reading that, I can probably throw together > > some untested code for it. >=20 > I agree to use something to replace the existing check, but using a pseudo > isa extension is not a good idea. There are two reasons:=20 >=20 > 1. Pseudo isa is misleading. As it is not the real isa, setting this in i= sa > list may make userspace think errata a feather. If we wanted to suppress sharing this information to userspace we could, but I don't even see what the harm is in userspace knowing. I also disagree with this even really being an erratum in the first place as they implemented something before a spec was created. It's not an implementation of Sscofpmf with a bug. I don't think that calling it a "real" vendor extension is problematic either, just I am the one calling it that, not T-Head themselves. > 2. Using pseudo isa is more like an abuse of reserved isa bits, which mea= ns > kernel may need infinite bits to handle the errata. What makes it an abuse of a "reserved" bit? There's no rule on disallowing something vendor-specific there. Given the amount of standard ISA extensions that are being created compared to CPU errata, I don't think that I'm particularly worried about vendor specific stuff being the reason for infinite bits being needed either. If there do come to be issues with the number of extensions we care about, we could split things per vendor I suppose. > IMHO, it may be better to use a new DT property like "riscv,cpu-errata" or > ",cpu-errata". It can achieve almost everything like using pseudo > isa. And the only cost I think is a small amount code to parse this. I suppose we could do that, but accounting for vendor specifics was one of the goals for the property I only just added and that I am suggesting to use here. --7VnajYQ5dXc+P0Cg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZfNg6wAKCRB4tDGHoIJi 0pvxAP9f5n67FdcXaDeJLe8wvqIkMnLvLHJt1Uimlhexcor/lgEAkHeDx1gCVOz4 gSFJsa/+ha0YnGA/h8Ili4wHIx6rhA0= =9+If -----END PGP SIGNATURE----- --7VnajYQ5dXc+P0Cg-- --===============0541156388039161657== 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 --===============0541156388039161657==--