Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64: cpufeature: Use pmuv3_implemented() function

Other places that are doing this version comparison are already using
pmuv3_implemented(), so might as well use it here too for consistency.

Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Colton Lewis <coltonlewis@google.com>
Signed-off-by: Will Deacon <will@kernel.org>

authored by

James Clark and committed by
Will Deacon
15ed3fa2 d1dcc20b

+9 -10
+7
arch/arm/include/asm/arm_pmuv3.h
··· 238 238 239 239 static inline bool pmuv3_implemented(int pmuver) 240 240 { 241 + /* 242 + * PMUVer follows the standard ID scheme for an unsigned field with the 243 + * exception of 0xF (IMP_DEF) which is treated specially and implies 244 + * FEAT_PMUv3 is not implemented. 245 + * 246 + * See DDI0487L.a D24.1.3.2 for more details. 247 + */ 241 248 return !(pmuver == ARMV8_PMU_DFR_VER_IMP_DEF || 242 249 pmuver == ARMV8_PMU_DFR_VER_NI); 243 250 }
+2 -10
arch/arm64/kernel/cpufeature.c
··· 77 77 #include <linux/percpu.h> 78 78 #include <linux/sched/isolation.h> 79 79 80 + #include <asm/arm_pmuv3.h> 80 81 #include <asm/cpu.h> 81 82 #include <asm/cpufeature.h> 82 83 #include <asm/cpu_ops.h> ··· 1928 1927 u64 dfr0 = read_sanitised_ftr_reg(SYS_ID_AA64DFR0_EL1); 1929 1928 unsigned int pmuver; 1930 1929 1931 - /* 1932 - * PMUVer follows the standard ID scheme for an unsigned field with the 1933 - * exception of 0xF (IMP_DEF) which is treated specially and implies 1934 - * FEAT_PMUv3 is not implemented. 1935 - * 1936 - * See DDI0487L.a D24.1.3.2 for more details. 1937 - */ 1938 1930 pmuver = cpuid_feature_extract_unsigned_field(dfr0, 1939 1931 ID_AA64DFR0_EL1_PMUVer_SHIFT); 1940 - if (pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF) 1941 - return false; 1942 1932 1943 - return pmuver >= ID_AA64DFR0_EL1_PMUVer_IMP; 1933 + return pmuv3_implemented(pmuver); 1944 1934 } 1945 1935 #endif 1946 1936