:::::: :::::: Manual check reason: "low confidence static check warning: drivers/perf/riscv_pmu_sbi.c:474:59: sparse: sparse: shift too big (32) for type long" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: Atish Patra TO: Atish Patra tree: https://github.com/atishp04/linux kvm_perf_snapshot_rfc head: 5ae7188de04f861c3f4026005a0ace2cf2575bde commit: 49f64ef2ce6b12fd54fc64df1ec2a0d28663b6cb [3/7] drivers/pmu: sbi: Read upper bits of a firmware counter :::::: branch date: 7 days ago :::::: commit date: 12 days ago config: riscv-randconfig-s051-20230515 compiler: riscv32-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/atishp04/linux/commit/49f64ef2ce6b12fd54fc64df1ec2a0d28663b6cb git remote add atishp04 https://github.com/atishp04/linux git fetch --no-tags atishp04 kvm_perf_snapshot_rfc git checkout 49f64ef2ce6b12fd54fc64df1ec2a0d28663b6cb # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/perf/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/r/202305160845.eO2MgH7R-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) WARNING: invalid argument to '-march': '_zihintpause' >> drivers/perf/riscv_pmu_sbi.c:474:59: sparse: sparse: shift too big (32) for type long vim +474 drivers/perf/riscv_pmu_sbi.c e9991434596f53 Atish Patra 2022-02-18 455 e9991434596f53 Atish Patra 2022-02-18 456 static u64 pmu_sbi_ctr_read(struct perf_event *event) e9991434596f53 Atish Patra 2022-02-18 457 { e9991434596f53 Atish Patra 2022-02-18 458 struct hw_perf_event *hwc = &event->hw; e9991434596f53 Atish Patra 2022-02-18 459 int idx = hwc->idx; e9991434596f53 Atish Patra 2022-02-18 460 struct sbiret ret; e9991434596f53 Atish Patra 2022-02-18 461 u64 val = 0; 49f64ef2ce6b12 Atish Patra 2023-05-03 462 union sbi_pmu_ctr_info info = pmu_ctr_list[idx]; e9991434596f53 Atish Patra 2022-02-18 463 e9991434596f53 Atish Patra 2022-02-18 464 if (pmu_sbi_is_fw_event(event)) { e9991434596f53 Atish Patra 2022-02-18 465 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_FW_READ, e9991434596f53 Atish Patra 2022-02-18 466 hwc->idx, 0, 0, 0, 0, 0); e9991434596f53 Atish Patra 2022-02-18 467 if (!ret.error) e9991434596f53 Atish Patra 2022-02-18 468 val = ret.value; 49f64ef2ce6b12 Atish Patra 2023-05-03 469 #if defined(CONFIG_32BIT) 49f64ef2ce6b12 Atish Patra 2023-05-03 470 if (sbi_v2_available && info.width >= 32) 49f64ef2ce6b12 Atish Patra 2023-05-03 471 ret = sbi_ecall(SBI_EXT_PMU, SBI_EXT_PMU_COUNTER_FW_READ_HI, 49f64ef2ce6b12 Atish Patra 2023-05-03 472 hwc->idx, 0, 0, 0, 0, 0); 49f64ef2ce6b12 Atish Patra 2023-05-03 473 if (!ret.error) 49f64ef2ce6b12 Atish Patra 2023-05-03 @474 val = val | (ret.value << 32); 49f64ef2ce6b12 Atish Patra 2023-05-03 475 #endif e9991434596f53 Atish Patra 2022-02-18 476 } else { e9991434596f53 Atish Patra 2022-02-18 477 val = riscv_pmu_ctr_read_csr(info.csr); e9991434596f53 Atish Patra 2022-02-18 478 if (IS_ENABLED(CONFIG_32BIT)) e9991434596f53 Atish Patra 2022-02-18 479 val = ((u64)riscv_pmu_ctr_read_csr(info.csr + 0x80)) << 31 | val; e9991434596f53 Atish Patra 2022-02-18 480 } e9991434596f53 Atish Patra 2022-02-18 481 e9991434596f53 Atish Patra 2022-02-18 482 return val; e9991434596f53 Atish Patra 2022-02-18 483 } e9991434596f53 Atish Patra 2022-02-18 484 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests