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 7839DC433EF for ; Fri, 6 May 2022 14:13: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-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=dvCl1nOGzi/H25WS1VhR4GeSZiBaLTSnFgfjLGQWEnY=; b=rEikdJmWbkKGcw hl8H9cS9D+IPbqKegStUp5OVtE3ox54m2yjrmeJIAzl8t3rD0p3JEzqR7XeoQBKXH1v2Dn+3HMu1t tGEmnKkgoFC1IbRw5v1FRZLwXWL1VfsksgKmHXWUx+vk3Pnt1GTtjVRN6KBdPszcnMyo7f9y1iuQH zxbsZlp6geJMcdSQvZjUxVoKkRf+EXWF5RkkjGb//chv7T+ZXYKzkYZ/6iWrdSNJKotJPdy6vLLfO Feu6K+3+oUuL41+jZi6RRIyP5msIZW2CbbH6sr7vSkW1lLKI3HhYlFx1byQhjUC5w7rnWdLPSxCO/ eZBdGCtX+eVGW8DJUp5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmyh0-003huk-2O; Fri, 06 May 2022 14:12:26 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmygw-003hst-Pz for linux-arm-kernel@lists.infradead.org; Fri, 06 May 2022 14:12:24 +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 ams.source.kernel.org (Postfix) with ESMTPS id 6258AB835AA; Fri, 6 May 2022 14:12:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF88CC385A9; Fri, 6 May 2022 14:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651846340; bh=Sc+wfLcWGfJ4RZMc7taxXvG8soVS9Rxm976jpP4IOpU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=luMA3Sbi2UnRW0GqSVRQt3AxZhoxfkQkT/EbFF8XXw6n5ZRdbbsIJ9jI+b1nuQWbj EcAhZG4zfkiL67+iGSDhHRdl3MQ6ntxOAHVWpxk1rAM34+zWz8WE5F/wd0YT4NUTRG MtwoVFnp0jA0Z0MFX1bfUoJZ22K40vbroYISSTQgD9gBmktOLkyCG+NBl1BnHXqsSt iwNbeRYjctvSdr6WFqBgaYHUKlG33BbWyJO9+pl0CMVxOlec26uI8/zM8jB8OVIaSk i8lpuyH5mgY+J0q8Sjp9rGXuTq7Q7ubkwYxQ7lyPyJ+PoJE7abRI6pmy4x6HOhXm5/ tJCcKygDDL6pQ== Date: Fri, 6 May 2022 15:12:14 +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 V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset Message-ID: <20220506141213.GA23485@willie-the-truck> References: <1651231749-19565-1-git-send-email-quic_c_spathi@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1651231749-19565-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-20220506_071223_062887_D52A6A10 X-CRM114-Status: GOOD ( 17.04 ) 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 Fri, Apr 29, 2022 at 04:59:09PM +0530, Srinivasarao Pathipati wrote: > Preserve the bit PMCR.X of PMCR_EL0 during PMU reset to export > PMU events. as it could be set before PMU initialization. > > Signed-off-by: Srinivasarao Pathipati > --- > Changes since V1: > - Preserving only PMCR_X bit as per Robin Murphy's comment > --- > arch/arm64/kernel/perf_event.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > index cb69ff1..532a417 100644 > --- a/arch/arm64/kernel/perf_event.c > +++ b/arch/arm64/kernel/perf_event.c > @@ -1047,6 +1047,9 @@ static void armv8pmu_reset(void *info) > if (armv8pmu_has_long_event(cpu_pmu)) > pmcr |= ARMV8_PMU_PMCR_LP; > > + /* Preserve PMCR_X to export PMU events */ > + pmcr |= (armv8pmu_pmcr_read() & ARMV8_PMU_PMCR_X); I don't think this should be unconditional. Exporting events could easily result in additional power consumption, and potentially even hardware lockups. Please stick this behind something like a sysctl toggle or sysfs control, with documentation about what it does. It should default to disabled. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel