All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 483/5236] drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2024-12-31  8:49 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-31  8:49 UTC (permalink / raw)
  To: Lizhi Hou; +Cc: oe-kbuild-all, Jeffrey Hugo, Min Ma

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
commit: 850d71f6bf4c2010efae845f9ff841cce902f22c [483/5236] accel/amdxdna: Add query functions
config: x86_64-randconfig-122-20241231 (https://download.01.org/0day-ci/archive/20241231/202412311655.YBvq2wJb-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241231/202412311655.YBvq2wJb-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412311655.YBvq2wJb-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/accel/amdxdna/aie2_pci.c:27:5: sparse: sparse: symbol 'aie2_max_col' was not declared. Should it be static?
   drivers/accel/amdxdna/aie2_pci.c:311:34: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/accel/amdxdna/aie2_pci.c:313:31: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected char *buf @@     got void [noderef] __user * @@
   drivers/accel/amdxdna/aie2_pci.c:549:39: sparse:     expected char *buf
   drivers/accel/amdxdna/aie2_pci.c:549:39: sparse:     got void [noderef] __user *

vim +549 drivers/accel/amdxdna/aie2_pci.c

   528	
   529	static int aie2_get_aie_status(struct amdxdna_client *client,
   530				       struct amdxdna_drm_get_info *args)
   531	{
   532		struct amdxdna_drm_query_aie_status status;
   533		struct amdxdna_dev *xdna = client->xdna;
   534		struct amdxdna_dev_hdl *ndev;
   535		int ret;
   536	
   537		ndev = xdna->dev_handle;
   538		if (copy_from_user(&status, u64_to_user_ptr(args->buffer), sizeof(status))) {
   539			XDNA_ERR(xdna, "Failed to copy AIE request into kernel");
   540			return -EFAULT;
   541		}
   542	
   543		if (ndev->metadata.cols * ndev->metadata.size < status.buffer_size) {
   544			XDNA_ERR(xdna, "Invalid buffer size. Given Size: %u. Need Size: %u.",
   545				 status.buffer_size, ndev->metadata.cols * ndev->metadata.size);
   546			return -EINVAL;
   547		}
   548	
 > 549		ret = aie2_query_status(ndev, u64_to_user_ptr(status.buffer),
   550					status.buffer_size, &status.cols_filled);
   551		if (ret) {
   552			XDNA_ERR(xdna, "Failed to get AIE status info. Ret: %d", ret);
   553			return ret;
   554		}
   555	
   556		if (copy_to_user(u64_to_user_ptr(args->buffer), &status, sizeof(status))) {
   557			XDNA_ERR(xdna, "Failed to copy AIE request info to user space");
   558			return -EFAULT;
   559		}
   560	
   561		return 0;
   562	}
   563	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [linux-next:master 483/5236] drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2025-01-03 17:26 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-03 17:26 UTC (permalink / raw)
  To: Lizhi Hou; +Cc: oe-kbuild-all, Jeffrey Hugo, Min Ma

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
commit: 850d71f6bf4c2010efae845f9ff841cce902f22c [483/5236] accel/amdxdna: Add query functions
config: x86_64-randconfig-122-20241231 (https://download.01.org/0day-ci/archive/20250104/202501040135.plFlC72Z-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250104/202501040135.plFlC72Z-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501040135.plFlC72Z-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/accel/amdxdna/aie2_pci.c:27:5: sparse: sparse: symbol 'aie2_max_col' was not declared. Should it be static?
   drivers/accel/amdxdna/aie2_pci.c:311:34: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/accel/amdxdna/aie2_pci.c:313:31: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected char *buf @@     got void [noderef] __user * @@
   drivers/accel/amdxdna/aie2_pci.c:549:39: sparse:     expected char *buf
   drivers/accel/amdxdna/aie2_pci.c:549:39: sparse:     got void [noderef] __user *

vim +549 drivers/accel/amdxdna/aie2_pci.c

   528	
   529	static int aie2_get_aie_status(struct amdxdna_client *client,
   530				       struct amdxdna_drm_get_info *args)
   531	{
   532		struct amdxdna_drm_query_aie_status status;
   533		struct amdxdna_dev *xdna = client->xdna;
   534		struct amdxdna_dev_hdl *ndev;
   535		int ret;
   536	
   537		ndev = xdna->dev_handle;
   538		if (copy_from_user(&status, u64_to_user_ptr(args->buffer), sizeof(status))) {
   539			XDNA_ERR(xdna, "Failed to copy AIE request into kernel");
   540			return -EFAULT;
   541		}
   542	
   543		if (ndev->metadata.cols * ndev->metadata.size < status.buffer_size) {
   544			XDNA_ERR(xdna, "Invalid buffer size. Given Size: %u. Need Size: %u.",
   545				 status.buffer_size, ndev->metadata.cols * ndev->metadata.size);
   546			return -EINVAL;
   547		}
   548	
 > 549		ret = aie2_query_status(ndev, u64_to_user_ptr(status.buffer),
   550					status.buffer_size, &status.cols_filled);
   551		if (ret) {
   552			XDNA_ERR(xdna, "Failed to get AIE status info. Ret: %d", ret);
   553			return ret;
   554		}
   555	
   556		if (copy_to_user(u64_to_user_ptr(args->buffer), &status, sizeof(status))) {
   557			XDNA_ERR(xdna, "Failed to copy AIE request info to user space");
   558			return -EFAULT;
   559		}
   560	
   561		return 0;
   562	}
   563	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-03 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 17:26 [linux-next:master 483/5236] drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-12-31  8:49 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.