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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 958A0C27C40 for ; Thu, 23 Nov 2023 01:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343554AbjKWBnP (ORCPT ); Wed, 22 Nov 2023 20:43:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232009AbjKWBnM (ORCPT ); Wed, 22 Nov 2023 20:43:12 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E221B3 for ; Wed, 22 Nov 2023 17:43:18 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 8AF5B3200A7A; Wed, 22 Nov 2023 20:43:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 22 Nov 2023 20:43:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1700703795; x=1700790195; bh=kpJ7rIIPVcAc8EF2r6PrWszTIVA9ySDoeaX MPqEdzug=; b=ZzsC+3OGyidfsO/VHJkNN2FTEhdzOA9eTqIDB55G4UkiL9Y74KI jYGrIWY+DaaOKg+Hb94tFvrmbOGNoIhsCmf2aNPNsKjhCCghs0Le6aOU9vy8x0Cs xURZU2iJ0Hs/kMcSmxBFFID/fValyshTyAjuUgZ/+8yEZNM9YGAZIqWEp8AFuYdT jXWfA+aOlfHWKcBJ2jDJHIVOP0tDi36FQ7IGyjrdlnpFnrtTNMCVUS7HpFz2Pd6C AeXVs1Jm2ibVM+mQF8i+2qxvFxtpQavFzJYVOWTPzVV1t92KqFAonlXuanT1pR+4 RKrKwPCGEywEoiuMivfx2Z0SIAedTUCENVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700703795; x=1700790195; bh=kpJ7rIIPVcAc8EF2r6PrWszTIVA9ySDoeaX MPqEdzug=; b=n27HfOH34aTHyuth9K0vSvjJvmr7LwpZprEIzwi8YpeW/dolen3 Tjr8kYJBHFPqScz2957PE0LpnfJ8b7RRAJYRvdybfJySYNPKeIFU76+Ur3HFgmiS lTqpC2PQbDCqyXZblc0fFuUAXGRtUjZYTc5K/2QpbUsYIDX5NkRA/3FC9FdHNhx6 JPvtt8rnotVq02S6TrREBXzqWsJ0hdtvbhbDVd0geGej2RaxOlWREbWwpTBgJGoy vl8EC2Ucn0KcFMgl7gC0PuGubh0zZLp5A9ClH0QwGeWsc3ZI8fcJGfz6xfXhXKXZ P2NyFYtZ1hJqJ+gwOwSoaxTGut8Dd20Xkcg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehvddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpeetieekgeeilefgtdfgteejhfevtdfgieekvdffjedvvedvveei veelfeeuhffhfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Nov 2023 20:43:11 -0500 (EST) Message-ID: Date: Wed, 22 Nov 2023 19:43:09 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 07/10] perf: RISC-V: Move T-Head PMU to CPU feature alternative framework Content-Language: en-US To: Conor Dooley , Yu-Chien Peter Lin Cc: mark.rutland@arm.com, heiko@sntech.de, atishp@atishpatra.org, conor.dooley@microchip.com, guoren@kernel.org, jszhang@kernel.org, linux-riscv@lists.infradead.org, will@kernel.org, anup@brainfault.org, dminus@andestech.com, dylan@andestech.com, ajones@ventanamicro.com, aou@eecs.berkeley.edu, prabhakar.mahadev-lad.rj@bp.renesas.com, locus84@andestech.com, tim609@andestech.com, paul.walmsley@sifive.com, linux-arm-kernel@lists.infradead.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, evan@rivosinc.com, palmer@dabbelt.com, Jernej Skrabec References: <20231019140119.3659651-1-peterlin@andestech.com> <20231019-predator-quartet-e56f43d5aa8d@spud> <20231020-snippet-diffusive-1a6052d52aae@spud> <20231023-impulse-quickness-4c7076e6eb58@spud> From: Samuel Holland In-Reply-To: <20231023-impulse-quickness-4c7076e6eb58@spud> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/23/23 03:26, Conor Dooley wrote: > On Sun, Oct 22, 2023 at 05:09:09PM +0800, Yu-Chien Peter Lin wrote: >> On Fri, Oct 20, 2023 at 10:05:20AM +0100, Conor Dooley wrote: >>> On Fri, Oct 20, 2023 at 04:54:58PM +0800, Yu-Chien Peter Lin wrote: >>>> On Thu, Oct 19, 2023 at 05:13:00PM +0100, Conor Dooley wrote: >>>>> On Thu, Oct 19, 2023 at 10:01:19PM +0800, Yu Chien Peter Lin wrote: >>>>> >>>>> $subject: perf: RISC-V: Move T-Head PMU to CPU feature alternative framework >>>>> >>>>> IMO, this should be "RISC-V, perf:" or just "RISC-V" as the changes >>>>> being made to the arch code are far more meaningful than those >>>>> elsewhere. >>>> >>>> OK will update the subject to "RISC-V:" >>>> >>>>>> The custom PMU extension was developed to support perf event sampling >>>>>> prior to the ratification of Sscofpmf. Instead of utilizing the standard >>>>>> bits and CSR of Sscofpmf, a set of custom CSRs is added. So we may >>>>>> consider it as a CPU feature rather than an erratum. >>>>>> >>>>>> T-Head cores need to append "xtheadpmu" to the riscv,isa-extensions >>>>>> for each cpu node in device tree, and enable CONFIG_THEAD_CUSTOM_PMU >>>>>> for proper functioning as of this commit. >>>>> >>>>> And in doing so, you regress break perf for existing DTs :( >>>>> You didn't add the property to existing DTS in-kernel either, so if this >>>>> series was applied, perf would just entirely stop working, no? >>>> >>>> Only `perf record/top` stop working I think. >>>> >>>> There are too many users out there, and don't have the boards to >>>> test, so leave those DTS unchanged, it would be great if T-Head >>>> community could help to check/update their DTS. >>> >>> So, there are too many users to add xtheadpmu to the devicetrees, but >>> not too many users to make changes that will cause a regression? >>> I'm not following the logic here, sorry. >> >> humm, I'll try. I assume that the sun20i-d1s.dtsi is all I need >> to update for T-Head PMU. > > I think you can actually add it to all users of T-Head CPUs currently in > mainline since all those cpus report the 0 mimpid and 0 marchid that is > being used as the detection method in the current code. > > That said, changing the in-kernel devicetrees doesn't solve the > regression problem. Not every dts lives in the linux codebase, for > example, and just because they don't, doesn't mean we can just not > care about them! > > As a result, I don't think that we can just do a conversion here from > one method to another like this, since it's likely to break things for > people. Certainly interested in hearing from those that support the > T-Head IP based SoCs about whether they'd be okay with something like > this. PMU support is not required to boot, and it didn't really work correctly anyway until OpenSBI commit c9a296d0edc9 ("platform: generic: allwinner: fix OF process for T-HEAD c9xx pmu"), which is still not in any released OpenSBI version. So I am fine with requiring a devicetree update for continued PMU support. Regards, Samuel