lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 25 Sep 2022 09:10:45 +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,
        x86@...nel.org
Subject: [tip:perf/core 43/54] 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/tip/tip.git perf/core
head:   dca6344d7a77dd0501a73745f4a9fb1ee2bc9d7c
commit: f3c0eba287049237b23d1300376768293eb89e69 [43/54] perf: Add a few assertions
config: loongarch-randconfig-s052-20220925
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/tip/tip.git/commit/?id=f3c0eba287049237b23d1300376768293eb89e69
        git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
        git fetch --no-tags tip perf/core
        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/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 *

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" (138106 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ