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]
Message-ID: <202007130001.YwRogR7e%lkp@intel.com>
Date:   Mon, 13 Jul 2020 00:22:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/pci/switch/switchtec.c:1075:33: 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:   0aea6d5c5be33ce94c16f9ab2f64de1f481f424b
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   3 weeks ago
config: alpha-randconfig-s032-20200712 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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.2-37-gc9676a3b-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


sparse warnings: (new ones prefixed by >>)

   drivers/pci/switch/switchtec.c:943:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected unsigned int [noderef] [usertype] __iomem * @@     got void * @@
   drivers/pci/switch/switchtec.c:943:31: sparse:     expected unsigned int [noderef] [usertype] __iomem *
   drivers/pci/switch/switchtec.c:943:31: sparse:     got void *
   drivers/pci/switch/switchtec.c:951:39: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected unsigned int [noderef] [usertype] __iomem * @@     got void * @@
   drivers/pci/switch/switchtec.c:951:39: sparse:     expected unsigned int [noderef] [usertype] __iomem *
   drivers/pci/switch/switchtec.c:951:39: sparse:     got void *
   drivers/pci/switch/switchtec.c:954:39: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected unsigned int [noderef] [usertype] __iomem * @@     got void * @@
   drivers/pci/switch/switchtec.c:954:39: sparse:     expected unsigned int [noderef] [usertype] __iomem *
   drivers/pci/switch/switchtec.c:954:39: sparse:     got void *
   drivers/pci/switch/switchtec.c:1067:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got struct switchtec_ioctl_pff_port *up @@
   drivers/pci/switch/switchtec.c:1067:32: sparse:     expected void const [noderef] __user *from
   drivers/pci/switch/switchtec.c:1067:32: sparse:     got struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1072:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct part_cfg_regs *pcfg @@     got struct part_cfg_regs [noderef] __iomem * @@
   drivers/pci/switch/switchtec.c:1072:22: sparse:     expected struct part_cfg_regs *pcfg
   drivers/pci/switch/switchtec.c:1072:22: sparse:     got struct part_cfg_regs [noderef] __iomem *
>> drivers/pci/switch/switchtec.c:1075:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
>> drivers/pci/switch/switchtec.c:1075:33: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1075:33: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1081:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1081:33: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1081:33: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1088:62: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1088:62: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1088:62: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1100:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct switchtec_ioctl_pff_port *up @@
   drivers/pci/switch/switchtec.c:1100:26: sparse:     expected void [noderef] __user *to
   drivers/pci/switch/switchtec.c:1100:26: sparse:     got struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1112:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got struct switchtec_ioctl_pff_port *up @@
   drivers/pci/switch/switchtec.c:1112:32: sparse:     expected void const [noderef] __user *from
   drivers/pci/switch/switchtec.c:1112:32: sparse:     got struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1116:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct part_cfg_regs *pcfg @@     got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg @@
   drivers/pci/switch/switchtec.c:1116:22: sparse:     expected struct part_cfg_regs *pcfg
   drivers/pci/switch/switchtec.c:1116:22: sparse:     got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg
   drivers/pci/switch/switchtec.c:1118:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct part_cfg_regs *pcfg @@     got struct part_cfg_regs [noderef] __iomem * @@
   drivers/pci/switch/switchtec.c:1118:22: sparse:     expected struct part_cfg_regs *pcfg
   drivers/pci/switch/switchtec.c:1118:22: sparse:     got struct part_cfg_regs [noderef] __iomem *
   drivers/pci/switch/switchtec.c:1124:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1124:35: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1124:35: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1127:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1127:35: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1127:35: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1134:56: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1134:56: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1134:56: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1138:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct switchtec_ioctl_pff_port *up @@
   drivers/pci/switch/switchtec.c:1138:26: sparse:     expected void [noderef] __user *to
   drivers/pci/switch/switchtec.c:1138:26: sparse:     got struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1171:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct switchtec_ioctl_pff_port *up @@     got void [noderef] __user *argp @@
   drivers/pci/switch/switchtec.c:1171:47: sparse:     expected struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1171:47: sparse:     got void [noderef] __user *argp
   drivers/pci/switch/switchtec.c:1174:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct switchtec_ioctl_pff_port *up @@     got void [noderef] __user *argp @@
   drivers/pci/switch/switchtec.c:1174:47: sparse:     expected struct switchtec_ioctl_pff_port *up
   drivers/pci/switch/switchtec.c:1174:47: sparse:     got void [noderef] __user *argp
   drivers/pci/switch/switchtec.c:1487:43: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct part_cfg_regs *pcfg @@     got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg @@
   drivers/pci/switch/switchtec.c:1487:43: sparse:     expected struct part_cfg_regs *pcfg
   drivers/pci/switch/switchtec.c:1487:43: sparse:     got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg
   drivers/pci/switch/switchtec.c:1497:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1497:25: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1497:25: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1501:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1501:25: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1501:25: sparse:     got unsigned int *
   drivers/pci/switch/switchtec.c:1506:54: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int * @@
   drivers/pci/switch/switchtec.c:1506:54: sparse:     expected void [noderef] __iomem *addr
   drivers/pci/switch/switchtec.c:1506:54: sparse:     got unsigned int *
--
   drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *[assigned] addr @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse:     expected void *[assigned] addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *[assigned] addr @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse:     expected void *[assigned] addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *virtual @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse:     got void *virtual
>> drivers/gpu/drm/ttm/ttm_bo_util.c:256:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int [usertype] * @@
>> drivers/gpu/drm/ttm/ttm_bo_util.c:256:40: sparse:     expected void [noderef] __iomem *addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:256:40: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/ttm/ttm_bo_util.c:256:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void [noderef] __iomem *addr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:256:49: sparse:     expected void [noderef] __iomem *addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:256:49: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/ttm/ttm_bo_util.c:275:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const volatile [noderef] __iomem * @@     got void *[assigned] src @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:275:28: sparse:     expected void const volatile [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:275:28: sparse:     got void *[assigned] src
   drivers/gpu/drm/ttm/ttm_bo_util.c:297:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem * @@     got void *[assigned] dst @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:297:21: sparse:     expected void volatile [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:297:21: sparse:     got void *[assigned] dst
   drivers/gpu/drm/ttm/ttm_bo_util.c:344:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *[addressable] new_iomap @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:344:27: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:344:27: sparse:     got void *[addressable] new_iomap
   drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *virtual @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse:     expected void *virtual
   drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *virtual @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse:     expected void *virtual
   drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *virtual @@
   drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse:     got void *virtual

vim +1075 drivers/pci/switch/switchtec.c

52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1058  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1059  static int ioctl_pff_to_port(struct switchtec_dev *stdev,
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1060  			     struct switchtec_ioctl_pff_port *up)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1061  {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1062  	int i, part;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1063  	u32 reg;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1064  	struct part_cfg_regs *pcfg;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1065  	struct switchtec_ioctl_pff_port p;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1066  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1067  	if (copy_from_user(&p, up, sizeof(p)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1068  		return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1069  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1070  	p.port = -1;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1071  	for (part = 0; part < stdev->partition_count; part++) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1072  		pcfg = &stdev->mmio_part_cfg_all[part];
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1073  		p.partition = part;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1074  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 @1075  		reg = ioread32(&pcfg->usp_pff_inst_id);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1076  		if (reg == p.pff) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1077  			p.port = 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1078  			break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1079  		}
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1080  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1081  		reg = ioread32(&pcfg->vep_pff_inst_id);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1082  		if (reg == p.pff) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1083  			p.port = SWITCHTEC_IOCTL_PFF_VEP;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1084  			break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1085  		}
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1086  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1087  		for (i = 0; i < ARRAY_SIZE(pcfg->dsp_pff_inst_id); i++) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1088  			reg = ioread32(&pcfg->dsp_pff_inst_id[i]);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1089  			if (reg != p.pff)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1090  				continue;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1091  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1092  			p.port = i + 1;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1093  			break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1094  		}
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1095  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1096  		if (p.port != -1)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1097  			break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1098  	}
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1099  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1100  	if (copy_to_user(up, &p, sizeof(p)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1101  		return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1102  
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1103  	return 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1104  }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02  1105  

:::::: The code at line 1075 was first introduced by commit
:::::: 52eabba5bcdb2853dec6ef007ba427b092034738 switchtec: Add IOCTLs to the Switchtec driver

:::::: TO: Logan Gunthorpe <logang@...tatee.com>
:::::: CC: Bjorn Helgaas <bhelgaas@...gle.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (28371 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ