Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH V1] arm64: perf: Change PMCR write to read-modify-write
@ 2022-04-27  9:51 Srinivasarao Pathipati
  2022-04-27 10:16 ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Srinivasarao Pathipati @ 2022-04-27  9:51 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 bitfields of PMCR_EL0 during PMU reset.
Reset routine should set only PMCR.C, PMCR.P and PMCR.LC fields only
to reset the counters. Other fields should not be changed
as they could be set before PMU initialization and their value must
be preserved even after reset.

Signed-off-by: Srinivasarao Pathipati <quic_spathi@quicinc.com>
---
 arch/arm64/kernel/perf_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index cb69ff1..9e22326 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1047,7 +1047,7 @@ static void armv8pmu_reset(void *info)
 	if (armv8pmu_has_long_event(cpu_pmu))
 		pmcr |= ARMV8_PMU_PMCR_LP;
 
-	armv8pmu_pmcr_write(pmcr);
+	armv8pmu_pmcr_write(armv8pmu_pmcr_read() | pmcr);
 }
 
 static int __armv8_pmuv3_map_event(struct perf_event *event,
-- 
2.7.4


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

end of thread, other threads:[~2022-04-27 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-27  9:51 [PATCH V1] arm64: perf: Change PMCR write to read-modify-write Srinivasarao Pathipati
2022-04-27 10:16 ` Robin Murphy
2022-04-27 11:09   ` Srinivasarao Pathipati (Consultant)
2022-04-27 11:49     ` Robin Murphy

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