All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lizhi Hou <lizhi.hou@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [linux-next:master 2683/4234] drivers/accel/amdxdna/aie2_pci.c:794:13: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sat, 23 Aug 2025 09:02:18 +0800	[thread overview]
Message-ID: <202508230855.0b9efFl6-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-08-23  1:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202508230855.0b9efFl6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=lizhi.hou@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.