Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp46950rdh; Wed, 22 Nov 2023 17:43:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSgeJld7ymCGfkz0q1Zv+/zvTgiK/onDxkEJM+LdU1QpJXp/F54XJW6WWBcUvovxqX2oAw X-Received: by 2002:a05:6a00:158c:b0:6cb:a60c:1d with SMTP id u12-20020a056a00158c00b006cba60c001dmr4501329pfk.17.1700703814464; Wed, 22 Nov 2023 17:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700703814; cv=none; d=google.com; s=arc-20160816; b=II3y2dK8+F2ZN8Y5eAuHCY/p+nAHwJ2R6NzCU59D6/ttxPn8LpAkdTJNApFDZahou8 sO8ZY0Owq+rnvudQXM3yf+XOgiCCvqPpf4NPLhUobI49N8yV0wmXXNI4m/coBg2tyhr0 1MaBH5pkZH+KMX8+bACWAMNGDHKc3zV3AUDKQfw/w9gXo8o/WR/mx4b0tAMvXeUBtkCz LLs2COam79BgIJyrqBlOxzYN0o4v4+zoRzhc7uPOwYDIcPGZEpydTj0CGFpPEGcHilO9 ZnSNmPJTPq6dTfdZ/+FI7OPcEFQ4BIJ/6h7JcMHUgrH2RKl0tE6uowguPWJVpR4WtUHI BTqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:feedback-id:dkim-signature:dkim-signature; bh=kpJ7rIIPVcAc8EF2r6PrWszTIVA9ySDoeaXMPqEdzug=; fh=tzhnxDiWgk2/cgYuw5lKgtv3JkuzMks2U5x3ggca4kI=; b=nuOR5Y+9eqCqkXb4Jy7rpLu9u4/9JsakwkyTDVcDMtDyPjD2mYMDck5eSTHGLl/xWK uWM4nl0jBpwwNDZTb/4Zj+vnXP/D/w7BJeOT4uenexFJSdmG1XDJLDSqobC7aBc2zC6I QRHazL0aosKw1RvHfF/5xico2vxGEuM+CubcUYmttHnuDLmrwA7O1qAwzSjOmAS6BGsc zEwOQ2xpVyDR3l7BB19Svh+/p6isbgq/bDb+2CuV/i+Wlz8Yc80h56wEmHS73JhnvYVn aoRI9ttLpzfKRHWzNXW8NP+NWS1UcKQGP+sk8p0+FC5EnBxDskqkacYOwHRZZ6hdBMlR 8gSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=ZzsC+3OG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=n27HfOH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q21-20020a056a00085500b006cb8a0c292esi274549pfk.95.2023.11.22.17.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 17:43:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=ZzsC+3OG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=n27HfOH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D2ED883A9FBC; Wed, 22 Nov 2023 17:43:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbjKWBnN (ORCPT + 99 others); Wed, 22 Nov 2023 20:43:13 -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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 17:43:32 -0800 (PST) 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