Skip to content

Commit 1280f12

Browse files
Marc Zyngierwilldeacon
authored andcommitted
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: Hector Martin <marcan@marcan.st> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 47804aa commit 1280f12

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/perf/arm_pmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ static inline u64 arm_pmu_event_max_period(struct perf_event *event)
109109
{
110110
if (event->hw.flags & ARMPMU_EVT_64BIT)
111111
return GENMASK_ULL(63, 0);
112+
else if (event->hw.flags & ARMPMU_EVT_47BIT)
113+
return GENMASK_ULL(46, 0);
112114
else
113115
return GENMASK_ULL(31, 0);
114116
}

include/linux/perf/arm_pmu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*/
2727
/* Event uses a 64bit counter */
2828
#define ARMPMU_EVT_64BIT 1
29+
/* Event uses a 47bit counter */
30+
#define ARMPMU_EVT_47BIT 2
2931

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

0 commit comments

Comments
 (0)