Commit 1280f12f authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

drivers/perf: arm_pmu: Handle 47 bit counters



The current ARM PMU framework can only deal with 32 or 64bit counters.
Teach it about a 47bit flavour.

Yes, this is odd.

Reviewed-by: default avatarHector Martin <marcan@marcan.st>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 47804aab
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ static inline u64 arm_pmu_event_max_period(struct perf_event *event)
{
	if (event->hw.flags & ARMPMU_EVT_64BIT)
		return GENMASK_ULL(63, 0);
	else if (event->hw.flags & ARMPMU_EVT_47BIT)
		return GENMASK_ULL(46, 0);
	else
		return GENMASK_ULL(31, 0);
}
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
 */
/* Event uses a 64bit counter */
#define ARMPMU_EVT_64BIT		1
/* Event uses a 47bit counter */
#define ARMPMU_EVT_47BIT		2

#define HW_OP_UNSUPPORTED		0xFFFF
#define C(_x)				PERF_COUNT_HW_CACHE_##_x