]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arch_topology: Provide a stub topology_core_has_smt() for !CONFIG_GENERIC_ARCH_TOPOLOGY
authorYicong Yang <yangyccccc@gmail.com>
Wed, 5 Nov 2025 10:38:49 +0000 (18:38 +0800)
committerWill Deacon <will@kernel.org>
Fri, 7 Nov 2025 13:45:02 +0000 (13:45 +0000)
The arm_pmu driver is using topology_core_has_smt() for retrieving
the SMT implementation which depends on CONFIG_GENERIC_ARCH_TOPOLOGY.
The config is optional on arm platforms so provide a
!CONFIG_GENERIC_ARCH_TOPOLOGY stub for topology_core_has_smt().

Fixes: c3d78c34ad00 ("perf: arm_pmuv3: Don't use PMCCNTR_EL0 on SMT cores")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511041757.vuCGOmFc-lkp@intel.com/
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Yicong Yang <yangyccccc@gmail.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/arch_topology.h

index daa1af2e8204bea0a3e992188e0ae5635af28c3f..0c2a8b846c20cb7ff02b631ae5f4078858536497 100644 (file)
@@ -100,6 +100,10 @@ static inline bool topology_core_has_smt(int cpu)
        return cpu_topology[cpu].thread_id != -1;
 }
 
-#endif
+#else
+
+static inline bool topology_core_has_smt(int cpu) { return false; }
+
+#endif /* CONFIG_GENERIC_ARCH_TOPOLOGY */
 
 #endif /* _LINUX_ARCH_TOPOLOGY_H_ */