Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf: arm-spe: set the correct interval for PMSIRR_EL1
@ 2025-10-27  2:24 Huang Shijie
  2025-10-27  9:02 ` Shijie Huang
  0 siblings, 1 reply; 2+ messages in thread
From: Huang Shijie @ 2025-10-27  2:24 UTC (permalink / raw)
  To: will, mark.rutland
  Cc: patches, cl, Shubhang, linux-arm-kernel, linux-perf-users,
	linux-kernel, Huang Shijie

From the spec, the "interval" value for PMSIRR_EL1 is in the [31, 8] bits.
Current code does not set it correctly.

This patch fixes it.

Fixes: d5d9696b03808 ("drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension")
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
---
 drivers/perf/arm_spe_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c
index fa50645fedda..d424721b79ee 100644
--- a/drivers/perf/arm_spe_pmu.c
+++ b/drivers/perf/arm_spe_pmu.c
@@ -400,7 +400,7 @@ static u64 arm_spe_event_to_pmsirr(struct perf_event *event)
 	arm_spe_event_sanitise_period(event);
 
 	reg |= FIELD_PREP(PMSIRR_EL1_RND, ATTR_CFG_GET_FLD(attr, jitter));
-	reg |= event->hw.sample_period;
+	reg |= FIELD_PREP(PMSIRR_EL1_INTERVAL, event->hw.sample_period);
 
 	return reg;
 }
-- 
2.40.1


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

end of thread, other threads:[~2025-10-27  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27  2:24 [PATCH] perf: arm-spe: set the correct interval for PMSIRR_EL1 Huang Shijie
2025-10-27  9:02 ` Shijie Huang

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