[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210191652.YnuY6Chw-lkp@intel.com>
Date: Wed, 19 Oct 2022 17:07:26 +0800
From: kernel test robot <lkp@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/perf/arm_smmuv3_pmu.c:403: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: aae703b02f92bde9264366c545e87cec451de471
commit: f3c0eba287049237b23d1300376768293eb89e69 perf: Add a few assertions
date: 6 weeks ago
config: loongarch-randconfig-s043-20221018
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/gpu/drm/tiny/ drivers/leds/flash/ 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/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: expected void *ptr
drivers/perf/arm_smmuv3_pmu.c:403:9: sparse: got int [noderef] __percpu *
drivers/perf/arm_smmuv3_pmu.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:239:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:239:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290:22: sparse: got restricted __le64 [usertype]
include/asm-generic/io.h:239:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:290: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:290:22: sparse: expected unsigned long long [usertype] value
include/asm-generic/io.h:290: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: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: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:348:15: sparse: sparse: cast to restricted __le64
include/asm-generic/io.h:348:15: sparse: sparse: cast to restricted __le64
--
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_dmc620_pmu.c:524:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: expected void *ptr
drivers/perf/arm_dmc620_pmu.c:524:9: sparse: got int [noderef] __percpu *
--
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got int [noderef] __percpu *
>> drivers/perf/xgene_pmu.c:935:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/xgene_pmu.c:935:9: sparse: expected void *ptr
drivers/perf/xgene_pmu.c:935:9: sparse: got int [noderef] __percpu *
vim +403 drivers/perf/arm_smmuv3_pmu.c
3c9347351a6ea1 Robin Murphy 2019-08-01 358
7d839b4b9e0064 Neil Leeder 2019-03-26 359 /*
7d839b4b9e0064 Neil Leeder 2019-03-26 360 * Implementation of abstract pmu functionality required by
7d839b4b9e0064 Neil Leeder 2019-03-26 361 * the core perf events code.
7d839b4b9e0064 Neil Leeder 2019-03-26 362 */
7d839b4b9e0064 Neil Leeder 2019-03-26 363
7d839b4b9e0064 Neil Leeder 2019-03-26 364 static int smmu_pmu_event_init(struct perf_event *event)
7d839b4b9e0064 Neil Leeder 2019-03-26 365 {
7d839b4b9e0064 Neil Leeder 2019-03-26 366 struct hw_perf_event *hwc = &event->hw;
7d839b4b9e0064 Neil Leeder 2019-03-26 367 struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
7d839b4b9e0064 Neil Leeder 2019-03-26 368 struct device *dev = smmu_pmu->dev;
7d839b4b9e0064 Neil Leeder 2019-03-26 369 struct perf_event *sibling;
33e84ea4330da8 Robin Murphy 2019-08-01 370 int group_num_events = 1;
7d839b4b9e0064 Neil Leeder 2019-03-26 371 u16 event_id;
7d839b4b9e0064 Neil Leeder 2019-03-26 372
7d839b4b9e0064 Neil Leeder 2019-03-26 373 if (event->attr.type != event->pmu->type)
7d839b4b9e0064 Neil Leeder 2019-03-26 374 return -ENOENT;
7d839b4b9e0064 Neil Leeder 2019-03-26 375
7d839b4b9e0064 Neil Leeder 2019-03-26 376 if (hwc->sample_period) {
7d839b4b9e0064 Neil Leeder 2019-03-26 377 dev_dbg(dev, "Sampling not supported\n");
7d839b4b9e0064 Neil Leeder 2019-03-26 378 return -EOPNOTSUPP;
7d839b4b9e0064 Neil Leeder 2019-03-26 379 }
7d839b4b9e0064 Neil Leeder 2019-03-26 380
7d839b4b9e0064 Neil Leeder 2019-03-26 381 if (event->cpu < 0) {
7d839b4b9e0064 Neil Leeder 2019-03-26 382 dev_dbg(dev, "Per-task mode not supported\n");
7d839b4b9e0064 Neil Leeder 2019-03-26 383 return -EOPNOTSUPP;
7d839b4b9e0064 Neil Leeder 2019-03-26 384 }
7d839b4b9e0064 Neil Leeder 2019-03-26 385
7d839b4b9e0064 Neil Leeder 2019-03-26 386 /* Verify specified event is supported on this PMU */
7d839b4b9e0064 Neil Leeder 2019-03-26 387 event_id = get_event(event);
7d839b4b9e0064 Neil Leeder 2019-03-26 388 if (event_id < SMMU_PMCG_ARCH_MAX_EVENTS &&
7d839b4b9e0064 Neil Leeder 2019-03-26 389 (!test_bit(event_id, smmu_pmu->supported_events))) {
7d839b4b9e0064 Neil Leeder 2019-03-26 390 dev_dbg(dev, "Invalid event %d for this PMU\n", event_id);
7d839b4b9e0064 Neil Leeder 2019-03-26 391 return -EINVAL;
7d839b4b9e0064 Neil Leeder 2019-03-26 392 }
7d839b4b9e0064 Neil Leeder 2019-03-26 393
7d839b4b9e0064 Neil Leeder 2019-03-26 394 /* Don't allow groups with mixed PMUs, except for s/w events */
33e84ea4330da8 Robin Murphy 2019-08-01 395 if (!is_software_event(event->group_leader)) {
3c9347351a6ea1 Robin Murphy 2019-08-01 396 if (!smmu_pmu_events_compatible(event->group_leader, event))
33e84ea4330da8 Robin Murphy 2019-08-01 397 return -EINVAL;
33e84ea4330da8 Robin Murphy 2019-08-01 398
33e84ea4330da8 Robin Murphy 2019-08-01 399 if (++group_num_events > smmu_pmu->num_counters)
7d839b4b9e0064 Neil Leeder 2019-03-26 400 return -EINVAL;
7d839b4b9e0064 Neil Leeder 2019-03-26 401 }
7d839b4b9e0064 Neil Leeder 2019-03-26 402
7d839b4b9e0064 Neil Leeder 2019-03-26 @403 for_each_sibling_event(sibling, event->group_leader) {
33e84ea4330da8 Robin Murphy 2019-08-01 404 if (is_software_event(sibling))
33e84ea4330da8 Robin Murphy 2019-08-01 405 continue;
33e84ea4330da8 Robin Murphy 2019-08-01 406
3c9347351a6ea1 Robin Murphy 2019-08-01 407 if (!smmu_pmu_events_compatible(sibling, event))
33e84ea4330da8 Robin Murphy 2019-08-01 408 return -EINVAL;
33e84ea4330da8 Robin Murphy 2019-08-01 409
33e84ea4330da8 Robin Murphy 2019-08-01 410 if (++group_num_events > smmu_pmu->num_counters)
7d839b4b9e0064 Neil Leeder 2019-03-26 411 return -EINVAL;
7d839b4b9e0064 Neil Leeder 2019-03-26 412 }
7d839b4b9e0064 Neil Leeder 2019-03-26 413
7d839b4b9e0064 Neil Leeder 2019-03-26 414 hwc->idx = -1;
7d839b4b9e0064 Neil Leeder 2019-03-26 415
7d839b4b9e0064 Neil Leeder 2019-03-26 416 /*
7d839b4b9e0064 Neil Leeder 2019-03-26 417 * Ensure all events are on the same cpu so all events are in the
7d839b4b9e0064 Neil Leeder 2019-03-26 418 * same cpu context, to avoid races on pmu_enable etc.
7d839b4b9e0064 Neil Leeder 2019-03-26 419 */
7d839b4b9e0064 Neil Leeder 2019-03-26 420 event->cpu = smmu_pmu->on_cpu;
7d839b4b9e0064 Neil Leeder 2019-03-26 421
7d839b4b9e0064 Neil Leeder 2019-03-26 422 return 0;
7d839b4b9e0064 Neil Leeder 2019-03-26 423 }
7d839b4b9e0064 Neil Leeder 2019-03-26 424
:::::: The code at line 403 was first introduced by commit
:::::: 7d839b4b9e00645e49345d6ce5dfa8edf53c1a21 perf/smmuv3: Add arm64 smmuv3 pmu driver
:::::: TO: Neil Leeder <nleeder@...eaurora.org>
:::::: CC: Will Deacon <will.deacon@....com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (192162 bytes)
Powered by blists - more mailing lists