drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
From: kernel test robot
Date: Wed Nov 15 2023 - 07:11:28 EST
Hi Robin,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c
commit: f9bd34e3753ea8f1433a3ba70f03a165a1416f98 perf/arm_cspmu: Clean up ACPI dependency
date: 5 months ago
config: loongarch-randconfig-r133-20231107 (https://download.01.org/0day-ci/archive/20231115/202311151948.RANfH9T9-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231115/202311151948.RANfH9T9-lkp@xxxxxxxxx/reproduce)
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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311151948.RANfH9T9-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got unsigned int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got int [noderef] __percpu *
>> drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: expected void *ptr
drivers/perf/arm_cspmu/arm_cspmu.c:627:9: sparse: got int [noderef] __percpu *
vim +627 drivers/perf/arm_cspmu/arm_cspmu.c
e37dfd65731dc4 Besar Wicaksono 2022-11-11 609
e37dfd65731dc4 Besar Wicaksono 2022-11-11 610 /*
e37dfd65731dc4 Besar Wicaksono 2022-11-11 611 * Make sure the group of events can be scheduled at once
e37dfd65731dc4 Besar Wicaksono 2022-11-11 612 * on the PMU.
e37dfd65731dc4 Besar Wicaksono 2022-11-11 613 */
e37dfd65731dc4 Besar Wicaksono 2022-11-11 614 static bool arm_cspmu_validate_group(struct perf_event *event)
e37dfd65731dc4 Besar Wicaksono 2022-11-11 615 {
e37dfd65731dc4 Besar Wicaksono 2022-11-11 616 struct perf_event *sibling, *leader = event->group_leader;
e37dfd65731dc4 Besar Wicaksono 2022-11-11 617 struct arm_cspmu_hw_events fake_hw_events;
e37dfd65731dc4 Besar Wicaksono 2022-11-11 618
e37dfd65731dc4 Besar Wicaksono 2022-11-11 619 if (event->group_leader == event)
e37dfd65731dc4 Besar Wicaksono 2022-11-11 620 return true;
e37dfd65731dc4 Besar Wicaksono 2022-11-11 621
e37dfd65731dc4 Besar Wicaksono 2022-11-11 622 memset(&fake_hw_events, 0, sizeof(fake_hw_events));
e37dfd65731dc4 Besar Wicaksono 2022-11-11 623
e37dfd65731dc4 Besar Wicaksono 2022-11-11 624 if (!arm_cspmu_validate_event(event->pmu, &fake_hw_events, leader))
e37dfd65731dc4 Besar Wicaksono 2022-11-11 625 return false;
e37dfd65731dc4 Besar Wicaksono 2022-11-11 626
e37dfd65731dc4 Besar Wicaksono 2022-11-11 @627 for_each_sibling_event(sibling, leader) {
e37dfd65731dc4 Besar Wicaksono 2022-11-11 628 if (!arm_cspmu_validate_event(event->pmu, &fake_hw_events,
e37dfd65731dc4 Besar Wicaksono 2022-11-11 629 sibling))
e37dfd65731dc4 Besar Wicaksono 2022-11-11 630 return false;
e37dfd65731dc4 Besar Wicaksono 2022-11-11 631 }
e37dfd65731dc4 Besar Wicaksono 2022-11-11 632
e37dfd65731dc4 Besar Wicaksono 2022-11-11 633 return arm_cspmu_validate_event(event->pmu, &fake_hw_events, event);
e37dfd65731dc4 Besar Wicaksono 2022-11-11 634 }
e37dfd65731dc4 Besar Wicaksono 2022-11-11 635
:::::: The code at line 627 was first introduced by commit
:::::: e37dfd65731dc4f001fa7dfa7f705e6840017d5a perf: arm_cspmu: Add support for ARM CoreSight PMU driver
:::::: TO: Besar Wicaksono <bwicaksono@xxxxxxxxxx>
:::::: CC: Will Deacon <will@xxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki