Skip to content

Commit 0331365

Browse files
mrutland-armwildea01
authored andcommitted
arm64: perf: correct PMUVer probing
The ID_AA64DFR0_EL1.PMUVer field doesn't follow the usual ID registers scheme. While value 0xf indicates a non-architected PMU is implemented, values 0x1 to 0xe indicate an increasingly featureful architected PMU, as if the field were unsigned. For more details, see ARM DDI 0487C.a, D10.1.4, "Alternative ID scheme used for the Performance Monitors Extension version". Currently, we treat the field as signed, and erroneously bail out for values 0x8 to 0xe. Let's correct that. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 167e614 commit 0331365

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/kernel/perf_event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,9 @@ static void __armv8pmu_probe_pmu(void *info)
908908
int pmuver;
909909

910910
dfr0 = read_sysreg(id_aa64dfr0_el1);
911-
pmuver = cpuid_feature_extract_signed_field(dfr0,
911+
pmuver = cpuid_feature_extract_unsigned_field(dfr0,
912912
ID_AA64DFR0_PMUVER_SHIFT);
913-
if (pmuver < 1)
913+
if (pmuver == 0xf || pmuver == 0)
914914
return;
915915

916916
probe->present = true;

0 commit comments

Comments
 (0)