Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset
@ 2022-04-29 11:29 Srinivasarao Pathipati
  2022-05-06 14:12 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivasarao Pathipati @ 2022-04-29 11:29 UTC (permalink / raw)
  To: will, mark.rutland, peterz, mingo, acme, alexander.shishkin,
	jolsa, namhyung, catalin.marinas, linux-arm-kernel,
	linux-perf-users, linux-kernel
  Cc: Srinivasarao Pathipati

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 <quic_c_spathi@quicinc.com>
---
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-09 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29 11:29 [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset Srinivasarao Pathipati
2022-05-06 14:12 ` Will Deacon
2022-05-09 13:21   ` Srinivasarao Pathipati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox