Skip to content

Commit 58f8fc5

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
drivers: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally
Currently the PMUv3 driver only reads PMMIR_EL1 if the PMU implements FEAT_PMUv3p4 and the STALL_SLOT event, but the check for STALL_SLOT event isn't necessary and can be removed. The check for STALL_SLOT event was introduced with the read of PMMIR_EL1 in commit f5be3a6 ("arm64: perf: Add support caps under sysfs") When this logic was written, the ARM ARM said: | If STALL_SLOT is not implemented, it is IMPLEMENTATION DEFINED whether | the PMMIR System registers are implemented. ... and thus the driver had to check for STALL_SLOT event to verify that PMMIR_EL1 was implemented and accesses to PMMIR_EL1 would not be UNDEFINED. Subsequently, the architecture was retrospectively tightened to require that any FEAT_PMUv3p4 implementation implements PMMIR_EL1. Since the G.b release of the ARM ARM, the wording regarding STALL_SLOT event has been removed, and the description of PMMIR_EL1 says: | This register is present only when FEAT_PMUv3p4 is implemented. Drop the unnecessary check for STALL_SLOT event when reading PMMIR_EL1. Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: James Clark <[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 50b5607 commit 58f8fc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/perf/arm_pmuv3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ static void __armv8pmu_probe_pmu(void *info)
11261126
pmceid, ARMV8_PMUV3_MAX_COMMON_EVENTS);
11271127

11281128
/* store PMMIR register for sysfs */
1129-
if (is_pmuv3p4(pmuver) && (pmceid_raw[1] & BIT(31)))
1129+
if (is_pmuv3p4(pmuver))
11301130
cpu_pmu->reg_pmmir = read_pmmir();
11311131
else
11321132
cpu_pmu->reg_pmmir = 0;

0 commit comments

Comments
 (0)