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 0916DC433EF for ; Fri, 29 Apr 2022 11:30:45 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zxhdOY9EsUFPg4bnCEu3kFpXCKXhdp4/jPkGIIZufdQ=; b=EKTUYofquuYAzQ t1YoW57rzU1H1VYwVJKEZWgdpcTsBN4bJcXOhDnyMGO4jHgC9MbVlCDX5ZUonAcHFWMIKxkJcw1cX whfMEvFG4gfUoW9G4iCGPrZ5KurkJhyirE59OK6w+C6HG2foP56kU/2J7H7DWhid+cdkMCw1l7H2P W2oeQf3J/NwA/APnjGNMl1BsDKtPzd7dUJoWLMKBpV3cPnu9jkJnWltCQLqbvba6SWEGGlKxIAlHI mL9w2TBzyADGi+K4quJNXCiBj2xilpsg+FCZj565OrToGHrgPdXZ1xE9e8ZE3vELQNl+REtzM4C5K R7uHOkWUnb2CpSsfd+uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkOod-00AxLW-Md; Fri, 29 Apr 2022 11:29:39 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkOob-00AxL1-Kr for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 11:29:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651231777; x=1682767777; h=from:to:cc:subject:date:message-id; bh=MRz2KIgkT3b8vdFbnYzQ1LYA5GdfN15EjaWWPV4+cIs=; b=cSkHBuMK70MDIHUc7OPOmKL58NPBeaFyqVKsUHP58gI1VNAZTa6rE0Ks jhIUpCMYjr/fbUAmVpF17ehFCuvwc3X35OflcdQXmv0Wm037X5kuaKIA9 lEp5HT552+ctP5DUEL1xXqmIuzFyUCCmVwrY1yQTkcBCre9MF5/KQpyAw I=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 29 Apr 2022 04:29:33 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 29 Apr 2022 04:29:32 -0700 X-QCInternal: smtphost Received: from hu-c-spathi-hyd.qualcomm.com (HELO hu-sgudaval-hyd.qualcomm.com) ([10.213.108.59]) by ironmsg01-blr.qualcomm.com with ESMTP; 29 Apr 2022 16:59:16 +0530 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 212714) id DA5B03784; Fri, 29 Apr 2022 16:59:14 +0530 (+0530) From: Srinivasarao Pathipati To: will@kernel.org, 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 Cc: Srinivasarao Pathipati Subject: [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset Date: Fri, 29 Apr 2022 16:59:09 +0530 Message-Id: <1651231749-19565-1-git-send-email-quic_c_spathi@quicinc.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_042937_753083_4F251FFC X-CRM114-Status: UNSURE ( 8.12 ) X-CRM114-Notice: Please train this message. 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: , MIME-Version: 1.0 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 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); + armv8pmu_pmcr_write(pmcr); } -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel