Skip to contentSkip to conversation

drivers/accel/amdxdna/aie2_pci.c:549:39: sparse: sparse: incorrect type in argument 2 (different address spaces)

PATCH kernel test robot 1 participant 1 message Dec 31, 2024

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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

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