[PATCH v3 1/1] perf: arm_pmuv3: Don't use PMCCNTR_EL0 on SMT cores
Yicong Yang
yangyccccc at gmail.com
Thu Nov 6 07:16:52 PST 2025
On 2025/11/6 22:33, Mark Brown wrote:
> On Mon, Sep 22, 2025 at 11:30:10AM +0800, Yicong Yang wrote:
>
>> index d72d6e5aa200..daa1af2e8204 100644
>> --- a/include/linux/arch_topology.h
>> +++ b/include/linux/arch_topology.h
>> @@ -89,6 +89,17 @@ void remove_cpu_topology(unsigned int cpuid);
>> void reset_cpu_topology(void);
>> int parse_acpi_topology(void);
>> void freq_inv_set_max_ratio(int cpu, u64 max_rate);
>> +
>> +/*
>> + * Architectures like ARM64 don't have reliable architectural way to get SMT
>> + * information and depend on the firmware (ACPI/OF) report. Non-SMT core won't
>> + * initialize thread_id so we can use this to detect the SMT implementation.
>> + */
>> +static inline bool topology_core_has_smt(int cpu)
>> +{
>> + return cpu_topology[cpu].thread_id != -1;
>> +}
> I'm seeing build failures in -next on arm v5 and v6:
>
> /build/stage/linux/drivers/perf/arm_pmu.c: In function ‘armpmu_register’:
> /build/stage/linux/drivers/perf/arm_pmu.c:935:24: error: implicit declaration of
> function ‘topology_core_has_smt’; did you mean ‘topology_core_cpumask’? [-Wimpl
> icit-function-declaration]
> 935 | pmu->has_smt = topology_core_has_smt(cpumask_first(&pmu->support
> ed_cpus));
> | ^~~~~~~~~~~~~~~~~~~~~
> | topology_core_cpumask
> make[5]: *** [/build/stage/linux/scripts/Makefile.build:287: drivers/perf/arm_pm
> u.o] Error 1
>
> The above function is inside a CONFIG_GENERIC_ARCH_TOPOLOGY guard, we
> need a stub definition for architectures which don't have topology
> support or for the users to have guards.
already sent a fix out [1]. sorry for didn't notice this :(
[1] https://lore.kernel.org/all/20251105103849.4093-1-yangyccccc@gmail.com/
More information about the linux-arm-kernel
mailing list