Skip to content

Commit bb339db

Browse files
James-A-Clarkwilldeacon
authored andcommitted
arm: perf: Fix ARCH=arm build with GCC
LLVM ignores everything inside the if statement and doesn't generate errors, but GCC doesn't ignore it, resulting in the following error: drivers/perf/arm_pmuv3.c: In function ‘armv8pmu_write_evtype’: include/linux/bits.h:34:29: error: left shift count >= width of type [-Werror=shift-count-overflow] 34 | (((~UL(0)) - (UL(1) << (l)) + 1) & \ Fix it by using GENMASK_ULL which doesn't overflow on arm32 (even though the value is never used there). Fixes: 3115ee0 ("arm64: perf: Include threshold control fields in PMEVTYPER mask") Reported-by: Uwe Kleine-König <[email protected]> Closes: https://lore.kernel.org/linux-arm-kernel/[email protected]/ Signed-off-by: James Clark <[email protected]> Acked-by: Mark Rutland <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent f56bb3d commit bb339db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/perf/arm_pmuv3.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@
234234
* PMXEVTYPER: Event selection reg
235235
*/
236236
#define ARMV8_PMU_EVTYPE_EVENT GENMASK(15, 0) /* Mask for EVENT bits */
237-
#define ARMV8_PMU_EVTYPE_TH GENMASK(43, 32)
238-
#define ARMV8_PMU_EVTYPE_TC GENMASK(63, 61)
237+
#define ARMV8_PMU_EVTYPE_TH GENMASK_ULL(43, 32) /* arm64 only */
238+
#define ARMV8_PMU_EVTYPE_TC GENMASK_ULL(63, 61) /* arm64 only */
239239

240240
/*
241241
* Event filters for PMUv3

0 commit comments

Comments
 (0)