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 82776C43334 for ; Thu, 9 Jun 2022 10:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242636AbiFIKC6 (ORCPT ); Thu, 9 Jun 2022 06:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232691AbiFIKCz (ORCPT ); Thu, 9 Jun 2022 06:02:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C77BF6F; Thu, 9 Jun 2022 03:02:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A445561D18; Thu, 9 Jun 2022 10:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C715FC34114; Thu, 9 Jun 2022 10:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654768974; bh=fy3sOySJYMqPfYsXKFz0lzwOIVOW00fot8ATyI+aFKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7NAOLOMyNEMKzhUAG39/2KJRmzAenVdUfRcoNkvJLwRmDgK0oSRozlHKQKJVxLfH BjxbJ1/nI0+tTnmwNFKk1BN4ghei6IQ9HYFL5zIiPeB5bCOR6Zabd3ty0JFRSvsKxs AHsyhvhhhBY2IjQqc3wgeTWxVAtvDK6ibpElPPIfJb4lbH8GRNjqwaCYmiO9v9dfYc s5vJSAZ89CQTmo4WqSSDdfCzXXAPffcS9YjDf11xeRiQpyVg7KLHqD7rqZQds8oVga olqTGldbPuyIhpPSVUlnGMFD5KRNXkd4916syxyeGO0cr75fU1UGVf49uL/J3OoAOm csoBUD6dQxBOA== Date: Thu, 9 Jun 2022 11:02:47 +0100 From: Will Deacon To: Srinivasarao Pathipati Cc: mark.rutland@arm.com, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V5] arm64: perf: Make exporting of pmu events configurable Message-ID: <20220609100247.GA2187@willie-the-truck> References: <1653306574-20946-1-git-send-email-quic_c_spathi@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1653306574-20946-1-git-send-email-quic_c_spathi@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2022 at 05:19:34PM +0530, Srinivasarao Pathipati wrote: > The PMU export bit (PMCR_EL0.X) is getting reset during pmu reset, > Make is configurable using sysctls to enable/disable at runtime. > It can also be enabled at early bootup with kernel arguments. > > Signed-off-by: Srinivasarao Pathipati > --- > Changes since V4: > - Registering sysctls dynamically for only arm64 as suggested by Will > - Not removed the code to configure with kernel parameters > as the sysctl's kernel parameter(sysctl.kernel.export_pmu_events) > is not working at early bootup. pmu_reset() getting called before > sysctl's kernel parameter is set. Why do you need this during early bootup? Perf won't program any events until much later and if somebody else is configuring the PMU before entering Linux then they can also set that X bit in the PMCR. Will 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 CED24C43334 for ; Thu, 9 Jun 2022 10:04:01 +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-Transfer-Encoding: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-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wT1wl3HoSySvipMJf4v4WJt0Ir4uGxjhOBHncGSqnRw=; b=Bdh4hd9/THRYE4 BD3CtACr+L2+4enzskP2MAHlZly/VHYILHVKDYidAeyK/u8zsqqGAXrmojHxw0MGzuzZvO1yc52pV P0Zeq9Qlrpsu/3U5pBJimn63qNAM9I8f5hiIq8GJh+1FCImCMMA/u/39PRU/x0yBZir2d3D9uQCxH hp+gZU0uOBETH82HZjz06GWKUi/ucIS4+G+ZOiirte3lefqMAp9mjzqttxrEoDOTIcTaH8AIRkjKn fnrqAK5vBQSN1fHMu1IWP1LPzPIOLgJtWiGLn6m8RNifAl8QcVpfDlA0a7pd8wYDs9s7IHU8R58b2 +bWnoNrgQlFN5ASM//RQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzF0F-000qc1-2W; Thu, 09 Jun 2022 10:02:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzF0B-000qax-QI for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 10:02:57 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9AD5061D11; Thu, 9 Jun 2022 10:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C715FC34114; Thu, 9 Jun 2022 10:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654768974; bh=fy3sOySJYMqPfYsXKFz0lzwOIVOW00fot8ATyI+aFKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d7NAOLOMyNEMKzhUAG39/2KJRmzAenVdUfRcoNkvJLwRmDgK0oSRozlHKQKJVxLfH BjxbJ1/nI0+tTnmwNFKk1BN4ghei6IQ9HYFL5zIiPeB5bCOR6Zabd3ty0JFRSvsKxs AHsyhvhhhBY2IjQqc3wgeTWxVAtvDK6ibpElPPIfJb4lbH8GRNjqwaCYmiO9v9dfYc s5vJSAZ89CQTmo4WqSSDdfCzXXAPffcS9YjDf11xeRiQpyVg7KLHqD7rqZQds8oVga olqTGldbPuyIhpPSVUlnGMFD5KRNXkd4916syxyeGO0cr75fU1UGVf49uL/J3OoAOm csoBUD6dQxBOA== Date: Thu, 9 Jun 2022 11:02:47 +0100 From: Will Deacon To: Srinivasarao Pathipati Cc: mark.rutland@arm.com, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V5] arm64: perf: Make exporting of pmu events configurable Message-ID: <20220609100247.GA2187@willie-the-truck> References: <1653306574-20946-1-git-send-email-quic_c_spathi@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1653306574-20946-1-git-send-email-quic_c_spathi@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_030255_925039_0972AD1C X-CRM114-Status: GOOD ( 14.24 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 23, 2022 at 05:19:34PM +0530, Srinivasarao Pathipati wrote: > The PMU export bit (PMCR_EL0.X) is getting reset during pmu reset, > Make is configurable using sysctls to enable/disable at runtime. > It can also be enabled at early bootup with kernel arguments. > > Signed-off-by: Srinivasarao Pathipati > --- > Changes since V4: > - Registering sysctls dynamically for only arm64 as suggested by Will > - Not removed the code to configure with kernel parameters > as the sysctl's kernel parameter(sysctl.kernel.export_pmu_events) > is not working at early bootup. pmu_reset() getting called before > sysctl's kernel parameter is set. Why do you need this during early bootup? Perf won't program any events until much later and if somebody else is configuring the PMU before entering Linux then they can also set that X bit in the PMCR. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel