Skip to content

Commit fd264b3

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64/perf: Replace '0xf' instances with ID_AA64DFR0_PMUVER_IMP_DEF
ID_AA64DFR0_PMUVER_IMP_DEF, indicating an "implementation defined" PMU, never actually gets used although there are '0xf' instances scattered all around. Use the symbolic name instead of the raw hex constant. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent ff11764 commit fd264b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ cpuid_feature_cap_perfmon_field(u64 features, int field, u64 cap)
552552
u64 mask = GENMASK_ULL(field + 3, field);
553553

554554
/* Treat IMPLEMENTATION DEFINED functionality as unimplemented */
555-
if (val == 0xf)
555+
if (val == ID_AA64DFR0_PMUVER_IMP_DEF)
556556
val = 0;
557557

558558
if (val > cap) {

arch/arm64/kernel/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ static void __armv8pmu_probe_pmu(void *info)
10551055
dfr0 = read_sysreg(id_aa64dfr0_el1);
10561056
pmuver = cpuid_feature_extract_unsigned_field(dfr0,
10571057
ID_AA64DFR0_PMUVER_SHIFT);
1058-
if (pmuver == 0xf || pmuver == 0)
1058+
if (pmuver == ID_AA64DFR0_PMUVER_IMP_DEF || pmuver == 0)
10591059
return;
10601060

10611061
cpu_pmu->pmuver = pmuver;

0 commit comments

Comments
 (0)