* [linux-next:master 2683/4234] drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2025-08-23 1:02 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-23 1:02 UTC (permalink / raw)
To: Lizhi Hou; +Cc: oe-kbuild-all, Mario Limonciello
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 0f4c93f7eb861acab537dbe94441817a270537bf
commit: c8cea4371e5eca30cda8660aabb337747dabc51d [2683/4234] accel/amdxdna: Add a function to walk hardware contexts
config: x86_64-randconfig-122-20250823 (https://download.01.org/0day-ci/archive/20250823/202508230855.0b9efFl6-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250823/202508230855.0b9efFl6-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/202508230855.0b9efFl6-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct amdxdna_drm_query_hwctx [noderef] __user *tmp @@ got void *[assigned] _res @@
drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: expected struct amdxdna_drm_query_hwctx [noderef] __user *tmp
drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: got void *[assigned] _res
>> drivers/accel/amdxdna/aie2_pci.c:807:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got struct amdxdna_drm_query_hwctx [noderef] __user *tmp @@
drivers/accel/amdxdna/aie2_pci.c:807:31: sparse: expected void const *from
drivers/accel/amdxdna/aie2_pci.c:807:31: sparse: got struct amdxdna_drm_query_hwctx [noderef] __user *tmp
>> drivers/accel/amdxdna/aie2_pci.c:798:9: sparse: sparse: dereference of noderef expression
drivers/accel/amdxdna/aie2_pci.c:799:9: sparse: sparse: dereference of noderef expression
drivers/accel/amdxdna/aie2_pci.c:800:9: sparse: sparse: dereference of noderef expression
drivers/accel/amdxdna/aie2_pci.c:801:9: sparse: sparse: dereference of noderef expression
drivers/accel/amdxdna/aie2_pci.c:802:9: sparse: sparse: dereference of noderef expression
drivers/accel/amdxdna/aie2_pci.c:803:9: sparse: sparse: dereference of noderef expression
vim +794 drivers/accel/amdxdna/aie2_pci.c
850d71f6bf4c20 Lizhi Hou 2024-11-18 785
c8cea4371e5eca Lizhi Hou 2025-08-15 786 static int aie2_hwctx_status_cb(struct amdxdna_hwctx *hwctx, void *arg)
850d71f6bf4c20 Lizhi Hou 2024-11-18 787 {
c8cea4371e5eca Lizhi Hou 2025-08-15 788 struct amdxdna_drm_query_hwctx __user *buf, *tmp __free(kfree) = NULL;
c8cea4371e5eca Lizhi Hou 2025-08-15 789 struct amdxdna_drm_get_info *get_info_args = arg;
850d71f6bf4c20 Lizhi Hou 2024-11-18 790
c8cea4371e5eca Lizhi Hou 2025-08-15 791 if (get_info_args->buffer_size < sizeof(*tmp))
c8cea4371e5eca Lizhi Hou 2025-08-15 792 return -EINVAL;
850d71f6bf4c20 Lizhi Hou 2024-11-18 793
850d71f6bf4c20 Lizhi Hou 2024-11-18 @794 tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
850d71f6bf4c20 Lizhi Hou 2024-11-18 795 if (!tmp)
850d71f6bf4c20 Lizhi Hou 2024-11-18 796 return -ENOMEM;
850d71f6bf4c20 Lizhi Hou 2024-11-18 797
c8cea4371e5eca Lizhi Hou 2025-08-15 @798 tmp->pid = hwctx->client->pid;
850d71f6bf4c20 Lizhi Hou 2024-11-18 799 tmp->context_id = hwctx->id;
850d71f6bf4c20 Lizhi Hou 2024-11-18 800 tmp->start_col = hwctx->start_col;
850d71f6bf4c20 Lizhi Hou 2024-11-18 801 tmp->num_col = hwctx->num_col;
850d71f6bf4c20 Lizhi Hou 2024-11-18 802 tmp->command_submissions = hwctx->priv->seq;
850d71f6bf4c20 Lizhi Hou 2024-11-18 803 tmp->command_completions = hwctx->priv->completed;
850d71f6bf4c20 Lizhi Hou 2024-11-18 804
c8cea4371e5eca Lizhi Hou 2025-08-15 805 buf = u64_to_user_ptr(get_info_args->buffer);
c8cea4371e5eca Lizhi Hou 2025-08-15 806
c8cea4371e5eca Lizhi Hou 2025-08-15 @807 if (copy_to_user(buf, tmp, sizeof(*tmp)))
c8cea4371e5eca Lizhi Hou 2025-08-15 808 return -EFAULT;
c8cea4371e5eca Lizhi Hou 2025-08-15 809
c8cea4371e5eca Lizhi Hou 2025-08-15 810 get_info_args->buffer += sizeof(*tmp);
c8cea4371e5eca Lizhi Hou 2025-08-15 811 get_info_args->buffer_size -= sizeof(*tmp);
c8cea4371e5eca Lizhi Hou 2025-08-15 812
c8cea4371e5eca Lizhi Hou 2025-08-15 813 return 0;
850d71f6bf4c20 Lizhi Hou 2024-11-18 814 }
850d71f6bf4c20 Lizhi Hou 2024-11-18 815
:::::: The code at line 794 was first introduced by commit
:::::: 850d71f6bf4c2010efae845f9ff841cce902f22c accel/amdxdna: Add query functions
:::::: TO: Lizhi Hou <lizhi.hou@amd.com>
:::::: CC: Jeffrey Hugo <quic_jhugo@quicinc.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-23 1:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 1:02 [linux-next:master 2683/4234] drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces) 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.