[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202212021146.2ifkDRPC-lkp@intel.com>
Date: Fri, 2 Dec 2022 11:48:00 +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/arm_dmc620_pmu.c:524: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: a4412fdd49dc011bcc2c0d81ac4cab7457092650
commit: f3c0eba287049237b23d1300376768293eb89e69 perf: Add a few assertions
date: 3 months ago
config: loongarch-randconfig-s031-20221201
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/ mm/
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_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/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
vim +524 drivers/perf/arm_dmc620_pmu.c
53c218da220c36 Tuan Phan 2020-11-04 482
53c218da220c36 Tuan Phan 2020-11-04 483 static int dmc620_pmu_event_init(struct perf_event *event)
53c218da220c36 Tuan Phan 2020-11-04 484 {
53c218da220c36 Tuan Phan 2020-11-04 485 struct dmc620_pmu *dmc620_pmu = to_dmc620_pmu(event->pmu);
53c218da220c36 Tuan Phan 2020-11-04 486 struct hw_perf_event *hwc = &event->hw;
53c218da220c36 Tuan Phan 2020-11-04 487 struct perf_event *sibling;
53c218da220c36 Tuan Phan 2020-11-04 488
53c218da220c36 Tuan Phan 2020-11-04 489 if (event->attr.type != event->pmu->type)
53c218da220c36 Tuan Phan 2020-11-04 490 return -ENOENT;
53c218da220c36 Tuan Phan 2020-11-04 491
53c218da220c36 Tuan Phan 2020-11-04 492 /*
53c218da220c36 Tuan Phan 2020-11-04 493 * DMC 620 PMUs are shared across all cpus and cannot
53c218da220c36 Tuan Phan 2020-11-04 494 * support task bound and sampling events.
53c218da220c36 Tuan Phan 2020-11-04 495 */
53c218da220c36 Tuan Phan 2020-11-04 496 if (is_sampling_event(event) ||
53c218da220c36 Tuan Phan 2020-11-04 497 event->attach_state & PERF_ATTACH_TASK) {
53c218da220c36 Tuan Phan 2020-11-04 498 dev_dbg(dmc620_pmu->pmu.dev,
53c218da220c36 Tuan Phan 2020-11-04 499 "Can't support per-task counters\n");
53c218da220c36 Tuan Phan 2020-11-04 500 return -EOPNOTSUPP;
53c218da220c36 Tuan Phan 2020-11-04 501 }
53c218da220c36 Tuan Phan 2020-11-04 502
53c218da220c36 Tuan Phan 2020-11-04 503 /*
53c218da220c36 Tuan Phan 2020-11-04 504 * Many perf core operations (eg. events rotation) operate on a
53c218da220c36 Tuan Phan 2020-11-04 505 * single CPU context. This is obvious for CPU PMUs, where one
53c218da220c36 Tuan Phan 2020-11-04 506 * expects the same sets of events being observed on all CPUs,
53c218da220c36 Tuan Phan 2020-11-04 507 * but can lead to issues for off-core PMUs, where each
53c218da220c36 Tuan Phan 2020-11-04 508 * event could be theoretically assigned to a different CPU. To
53c218da220c36 Tuan Phan 2020-11-04 509 * mitigate this, we enforce CPU assignment to one, selected
53c218da220c36 Tuan Phan 2020-11-04 510 * processor.
53c218da220c36 Tuan Phan 2020-11-04 511 */
53c218da220c36 Tuan Phan 2020-11-04 512 event->cpu = dmc620_pmu->irq->cpu;
53c218da220c36 Tuan Phan 2020-11-04 513 if (event->cpu < 0)
53c218da220c36 Tuan Phan 2020-11-04 514 return -EINVAL;
53c218da220c36 Tuan Phan 2020-11-04 515
53c218da220c36 Tuan Phan 2020-11-04 516 /*
53c218da220c36 Tuan Phan 2020-11-04 517 * We can't atomically disable all HW counters so only one event allowed,
53c218da220c36 Tuan Phan 2020-11-04 518 * although software events are acceptable.
53c218da220c36 Tuan Phan 2020-11-04 519 */
53c218da220c36 Tuan Phan 2020-11-04 520 if (event->group_leader != event &&
53c218da220c36 Tuan Phan 2020-11-04 521 !is_software_event(event->group_leader))
53c218da220c36 Tuan Phan 2020-11-04 522 return -EINVAL;
53c218da220c36 Tuan Phan 2020-11-04 523
53c218da220c36 Tuan Phan 2020-11-04 @524 for_each_sibling_event(sibling, event->group_leader) {
53c218da220c36 Tuan Phan 2020-11-04 525 if (sibling != event &&
53c218da220c36 Tuan Phan 2020-11-04 526 !is_software_event(sibling))
53c218da220c36 Tuan Phan 2020-11-04 527 return -EINVAL;
53c218da220c36 Tuan Phan 2020-11-04 528 }
53c218da220c36 Tuan Phan 2020-11-04 529
53c218da220c36 Tuan Phan 2020-11-04 530 hwc->idx = -1;
53c218da220c36 Tuan Phan 2020-11-04 531 return 0;
53c218da220c36 Tuan Phan 2020-11-04 532 }
53c218da220c36 Tuan Phan 2020-11-04 533
:::::: The code at line 524 was first introduced by commit
:::::: 53c218da220c3619b5befec4674ffa35d590092a driver/perf: Add PMU driver for the ARM DMC-620 memory controller
:::::: TO: Tuan Phan <tuanphan@...amperecomputing.com>
:::::: CC: Will Deacon <will@...nel.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (170407 bytes)
Powered by blists - more mailing lists