[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211172243.5jMXgQuu-lkp@intel.com>
Date: Thu, 17 Nov 2022 22:25:47 +0800
From: kernel test robot <lkp@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type
in argument 1 (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: cc675d22e422442f6d230654a55a5fc5682ea018
commit: f3c0eba287049237b23d1300376768293eb89e69 perf: Add a few assertions
date: 2 months ago
config: loongarch-randconfig-s052-20221117
compiler: loongarch64-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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f3c0eba287049237b23d1300376768293eb89e69
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout f3c0eba287049237b23d1300376768293eb89e69
# 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=loongarch SHELL=/bin/bash drivers/perf/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got int [noderef] __percpu *
>> drivers/perf/thunderx2_pmu.c:556:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/thunderx2_pmu.c:556:9: sparse: expected void *ptr
drivers/perf/thunderx2_pmu.c:556:9: sparse: got int [noderef] __percpu *
--
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm-cmn.c:1471:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm-cmn.c:1471:9: sparse: expected void *ptr
drivers/perf/arm-cmn.c:1471:9: sparse: got int [noderef] __percpu *
drivers/perf/arm-cmn.c: note: in included file (through arch/loongarch/include/asm/io.h, arch/loongarch/include/asm/pgtable.h, arch/loongarch/include/asm/uaccess.h, ...):
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:389:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] value @@ got restricted __le64 [usertype] @@
include/asm-generic/io.h:389:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:389:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:379:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:335:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:379:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:379:22: sparse: expected unsigned int [usertype] value
vim +556 drivers/perf/thunderx2_pmu.c
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 539
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 540 /*
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 541 * Make sure the group of events can be scheduled at once
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 542 * on the PMU.
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 543 */
5e2c27e833bb92 Ganapatrao Prabhakerrao Kulkarni 2019-10-16 544 static bool tx2_uncore_validate_event_group(struct perf_event *event,
5e2c27e833bb92 Ganapatrao Prabhakerrao Kulkarni 2019-10-16 545 int max_counters)
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 546 {
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 547 struct perf_event *sibling, *leader = event->group_leader;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 548 int counters = 0;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 549
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 550 if (event->group_leader == event)
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 551 return true;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 552
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 553 if (!tx2_uncore_validate_event(event->pmu, leader, &counters))
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 554 return false;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 555
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 @556 for_each_sibling_event(sibling, leader) {
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 557 if (!tx2_uncore_validate_event(event->pmu, sibling, &counters))
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 558 return false;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 559 }
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 560
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 561 if (!tx2_uncore_validate_event(event->pmu, event, &counters))
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 562 return false;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 563
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 564 /*
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 565 * If the group requires more counters than the HW has,
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 566 * it cannot ever be scheduled.
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 567 */
5e2c27e833bb92 Ganapatrao Prabhakerrao Kulkarni 2019-10-16 568 return counters <= max_counters;
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 569 }
69c32972d59388 Kulkarni, Ganapatrao 2018-12-06 570
:::::: The code at line 556 was first introduced by commit
:::::: 69c32972d59388c041268e8206e8eb1acff29b9a drivers/perf: Add Cavium ThunderX2 SoC UNCORE PMU driver
:::::: TO: Kulkarni, Ganapatrao <Ganapatrao.Kulkarni@...ium.com>
:::::: CC: Will Deacon <will.deacon@....com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (166886 bytes)
Powered by blists - more mailing lists