tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: df4c334beecb4cf58e4e8d63b491aa5ac0a84f46 commit: 5cbf647edcff3d5cda5cb172c6bf0e4c1b6e8ec6 [1474/1474] x86/perf: Add uncore performance events support for Zhaoxin CPU config: x86_64-randconfig-123-20241118 (https://download.01.org/0day-ci/archive/20241201/202412010208.hwdQ3YqT-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241201/202412010208.hwdQ3YqT-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202412010208.hwdQ3YqT-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
arch/x86/events/zhaoxin/uncore.c:255:1: sparse: sparse: symbol '__pcpu_scope_zx_package_id' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:256:1: sparse: sparse: symbol '__pcpu_scope_zx_subnode_id' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:257:1: sparse: sparse: symbol '__pcpu_scope_zx_cluster_id' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:312:1: sparse: sparse: symbol '__pcpu_scope_zx_cluster_core_bits' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:313:1: sparse: sparse: symbol '__pcpu_scope_zx_subnode_core_bits' was not declared. Should it be static?
arch/x86/events/zhaoxin/uncore.c:1788:28: sparse: sparse: symbol 'uncore_msr_cluster_uncores' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:1793:28: sparse: sparse: symbol 'uncore_msr_subnode_uncores' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c:1799:28: sparse: sparse: symbol 'uncore_pci_subnode_uncores' was not declared. Should it be static? arch/x86/events/zhaoxin/uncore.c: note: in included file (through arch/x86/include/asm/cpuid.h, arch/x86/include/asm/processor.h, arch/x86/include/asm/cpu_device_id.h):
arch/x86/include/asm/paravirt.h:229:9: sparse: sparse: cast truncates bits from constant value (10000000f becomes f)
vim +/__pcpu_scope_zx_package_id +255 arch/x86/events/zhaoxin/uncore.c
254
255 DEFINE_PER_CPU(int, zx_package_id); 256 DEFINE_PER_CPU(int, zx_subnode_id); 257 DEFINE_PER_CPU(int, zx_cluster_id);
258 259 static void get_topology_info(void) 260 { 261 int cpu; 262 int cluster_id; 263 int socket_id; 264 int die_id; 265 int subnode_id; 266 267 int die_info; 268 int subnode_info; 269 int cluster_info; 270 271 u64 config; 272 273 for_each_present_cpu(cpu) { 274 smp_call_function_single(cpu, get_global_status_msr, &config, 1); 275 socket_id = (int)((config >> 3) & 0x1); 276 per_cpu(zx_package_id, cpu) = socket_id; 277 278 /* only yongfeng needs cluster and subnode info */ 279 if (boot_cpu_data.x86_model != ZHAOXIN_FAM7_YONGFENG) 280 continue; 281 282 smp_call_function_single(cpu, get_hdw_config_msr, &config, 1); 283 284 die_info = (int)((config >> 21) & 0x3); 285 die_id = socket_id * dies_per_socket + die_info; 286 287 subnode_info = (int)((config >> 20) & 0x1); 288 subnode_id = die_id * subnodes_per_die + subnode_info; 289 per_cpu(zx_subnode_id, cpu) = subnode_id; 290 291 cluster_info = (int)((config >> 18) & 0x3); 292 cluster_id = subnode_id * clusters_per_subnode + cluster_info; 293 per_cpu(zx_cluster_id, cpu) = cluster_id; 294 } 295 } 296 297 static int zx_topology_cluster_id(int cpu) 298 { 299 return per_cpu(zx_cluster_id, cpu); 300 } 301 302 static int zx_topology_subnode_id(int cpu) 303 { 304 return per_cpu(zx_subnode_id, cpu); 305 } 306 307 static int zx_topology_package_id(int cpu) 308 { 309 return per_cpu(zx_package_id, cpu); 310 } 311
312 DEFINE_PER_CPU(cpumask_t, zx_cluster_core_bits); 313 DEFINE_PER_CPU(cpumask_t, zx_subnode_core_bits);
314