Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1089590lql; Tue, 12 Mar 2024 07:09:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMXfRcZjAZHAjp9p+rpb85qmcMlNVgkWZcBSI8ZYAh1c0R9+bifK2LtsHsEG0v3TrkiNCs7hl17JNR1EmpOrldHPqWmfhnGSMBgHq6wQ== X-Google-Smtp-Source: AGHT+IE2o2Kldnzx0P5QG4tNIfoF7nfUium72oCXsEoMI44bvtTHG9B+axloYErB3lbdSSK446qO X-Received: by 2002:a05:6a00:190f:b0:6e0:df2d:e7fe with SMTP id y15-20020a056a00190f00b006e0df2de7femr14117498pfi.11.1710252539970; Tue, 12 Mar 2024 07:08:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710252539; cv=pass; d=google.com; s=arc-20160816; b=ekjfIrskJFrGWggg+IXT42Hj/5jXf77Q+KgUDc9zdUfG1S1C5zpagrH6Rzmllhu9N8 b6lNIFwJhjguWIwZnzTkivY+NJyxG3lr3afipB0mfjkEFaGfHvsJijm2Hyq+35v+XNEf sdzPCCv/WCkipMJ2Fu8BuzyL3FA9wCZLSq67+Hb8fMqGag+XrpPNQO4OWGpXpwRXqX9J JQoksDD2lalXI5my9g+la28KtpKqb21DsnWYhTQb89iT8z4w5gpq50BoQG/zBef9zr0X +bDLNnUMZf4Lj7fZVETVJrZq7/fBZr+5+RzUCdqCW4Z2BwGilanfJ+13Wmr05D5l2L/I 30Dg== 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=VxlpGxDihZXj7jY5GEg/ShwUNDeC49+jqJqaSIfPhsY=; fh=wwCBgUkiKDKmMixVaWT/W/D+kwOqZNRYos7TemODlA8=; b=Lw9MW/8al1DkJ3qoG9vZIJnlnszGMMlnE45kqgFC1eX+JeCsyDGGxz61svVkjFDhja G0BmqJMLW107pLnB8oToaIgFjJAABycsYQpien3nCQCNZUcV0Cnw9XrS/PuzOqS/Pu2h SJwi65JTZPnGlGJbK3yNr2VmPpT98IvS9zG0aA2H942nSyzg2eARdYSJ4l4qqjPtPGZN 2h2r2ClInWavqL1/YBF80QQDBmz+r7AVDdS7K7ys4FflbuJXWOJbbeQxkT3jvjjv6b7d qUTYZz4wU7SAZvs1oIudp0BHzggsY/5ioBLHyWg96mAOCdFNKhwjrkX7KlrH2iNt0JoC fJKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i5Rje2GO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-100319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h3-20020a056a00218300b006e69296296fsi4118696pfi.400.2024.03.12.07.08.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i5Rje2GO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-100319-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100319-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0B98F2839A3 for ; Tue, 12 Mar 2024 14:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CFA67A72F; Tue, 12 Mar 2024 14:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="i5Rje2GO" 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 B589D78298 for ; Tue, 12 Mar 2024 14:07:37 +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=1710252457; cv=none; b=bkQmuWOfX8D4WEna6y9zS09bEbRDGXKDfRIRqXiE74cWs7Mb1PslPcNvH67ZPs7qhUI3WD8vn5o18oazN9UhBjtA++ww+pEtf9fFcM8CmyuS2ms07NJ8q5v0CcFHx8jo6FxuiMgd5/+T9vI7/Hii9a8T59tilFOYx8dS1U5n4bs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710252457; c=relaxed/simple; bh=VxlpGxDihZXj7jY5GEg/ShwUNDeC49+jqJqaSIfPhsY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uNKFhnlQ1XR22fhKe95I6xhaghP7tJ+6S3UUPzNi86aQwhzFGN4ImwMHOcbgqE046lYPTsAsstjEif1bEBetATU49Gv9BcijB5vfGdd0S8PkHLuRWAkxymZgFgsk50dbSZOxqUBoNHqi1loBZd0PSoezFrhgd2e0IV/LMxU5thI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i5Rje2GO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EAEEC433C7; Tue, 12 Mar 2024 14:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710252457; bh=VxlpGxDihZXj7jY5GEg/ShwUNDeC49+jqJqaSIfPhsY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i5Rje2GOhhmmf2q6wh8tnNGuD3tTEdAt2GDgKJqBRsX83vpcz+vGfagvrnOnCBkML jSth+OmJ0TmjvkKv/FHbMjGA9SKfvslDXJiOSsUgD/Qzf+nHqxX5fOv24mr0lK42ed MVPfgfPkavIORcva44kvaPz20jSzsV6BY3BETPNO2nkia7j0w9Qth401Nx1dWJOpDj 0sHQKRzLSyrUiHHiGbnhg45kuRXaRhBokjUDzKs7sXjTrWg6f4oDGiOIH7oUY9w0Z+ 6pzkeManYXfsh0kdOBXcQOWR6G0ULbZVy5Bh9UH5NVPMLppD3yUZZfadwNclBfbHhl r3oA8T0eYwlwg== Date: Tue, 12 Mar 2024 14:07:31 +0000 From: Conor Dooley To: Qingfang Deng Cc: Inochi Amaoto , 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: <20240312-evil-resource-66370b68b9b4@spud> References: <20240311063018.1886757-1-dqfext@gmail.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="Pq4l/U+EGNQPJ6t+" Content-Disposition: inline In-Reply-To: --Pq4l/U+EGNQPJ6t+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. 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. 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 that t= he 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@andes= tech.com/ Just without removing the archid =3D=3D impid =3D=3D 0x0 case from the erra= ta code. If you're lost after reading that, I can probably throw together some untested code for it. Thanks, Conor. --Pq4l/U+EGNQPJ6t+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZfBhowAKCRB4tDGHoIJi 0qpNAQDkCoYYNr9WEQUhd2aEI/zbE3vwTfDh+2GK9L7+lQaBUAD/Ub+ksm3LncKt mAWaii+Of3v6TKIm+8K1yjxEtDdKlQE= =5JMP -----END PGP SIGNATURE----- --Pq4l/U+EGNQPJ6t+--