mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Wei Liu <wei.liu@kernel.org>,
	Anirudh Rayabharam <anrayabh@linux.microsoft.com>,
	Jinank Jain <jinankjain@microsoft.com>,
	Mukesh Rathor <mrathor@linux.microsoft.com>,
	Muminul Islam <muislam@microsoft.com>,
	Praveen K Paladugu <prapal@linux.microsoft.com>,
	Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>,
	Roman Kisel <romank@linux.microsoft.com>
Subject: drivers/hv/mshv_root_main.c:1341:14: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Sun, 14 Dec 2025 13:57:07 +0800	[thread overview]
Message-ID: <202512141339.791TCKnB-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8f0b4cce4481fb22653697cced8d0d04027cb1e8
commit: 621191d709b14882270dfd8ea5d7d6cdfebe2c35 Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs
date:   9 months ago
config: x86_64-randconfig-r121-20251214 (https://download.01.org/0day-ci/archive/20251214/202512141339.791TCKnB-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251214/202512141339.791TCKnB-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/202512141339.791TCKnB-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/hv/mshv_root_main.c:1341:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __user *ptr @@     got void const * @@
   drivers/hv/mshv_root_main.c:1341:14: sparse:     expected void const [noderef] __user *ptr
   drivers/hv/mshv_root_main.c:1341:14: sparse:     got void const *
>> drivers/hv/mshv_root_main.c:2192:23: sparse: sparse: symbol 'mshv_reboot_nb' was not declared. Should it be static?
--
>> drivers/hv/mshv_eventfd.c:493:16: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int events @@     got restricted __poll_t @@
   drivers/hv/mshv_eventfd.c:493:16: sparse:     expected unsigned int events
   drivers/hv/mshv_eventfd.c:493:16: sparse:     got restricted __poll_t

vim +1341 drivers/hv/mshv_root_main.c

  1317	
  1318	/*
  1319	 * This maps two things: guest RAM and for pci passthru mmio space.
  1320	 *
  1321	 * mmio:
  1322	 *  - vfio overloads vm_pgoff to store the mmio start pfn/spa.
  1323	 *  - Two things need to happen for mapping mmio range:
  1324	 *	1. mapped in the uaddr so VMM can access it.
  1325	 *	2. mapped in the hwpt (gfn <-> mmio phys addr) so guest can access it.
  1326	 *
  1327	 *   This function takes care of the second. The first one is managed by vfio,
  1328	 *   and hence is taken care of via vfio_pci_mmap_fault().
  1329	 */
  1330	static long
  1331	mshv_map_user_memory(struct mshv_partition *partition,
  1332			     struct mshv_user_mem_region mem)
  1333	{
  1334		struct mshv_mem_region *region;
  1335		struct vm_area_struct *vma;
  1336		bool is_mmio;
  1337		ulong mmio_pfn;
  1338		long ret;
  1339	
  1340		if (mem.flags & BIT(MSHV_SET_MEM_BIT_UNMAP) ||
> 1341		    !access_ok((const void *)mem.userspace_addr, mem.size))
  1342			return -EINVAL;
  1343	
  1344		mmap_read_lock(current->mm);
  1345		vma = vma_lookup(current->mm, mem.userspace_addr);
  1346		is_mmio = vma ? !!(vma->vm_flags & (VM_IO | VM_PFNMAP)) : 0;
  1347		mmio_pfn = is_mmio ? vma->vm_pgoff : 0;
  1348		mmap_read_unlock(current->mm);
  1349	
  1350		if (!vma)
  1351			return -EINVAL;
  1352	
  1353		ret = mshv_partition_create_region(partition, &mem, &region,
  1354						   is_mmio);
  1355		if (ret)
  1356			return ret;
  1357	
  1358		if (is_mmio)
  1359			ret = hv_call_map_mmio_pages(partition->pt_id, mem.guest_pfn,
  1360						     mmio_pfn, HVPFN_DOWN(mem.size));
  1361		else
  1362			ret = mshv_partition_mem_region_map(region);
  1363	
  1364		if (ret)
  1365			goto errout;
  1366	
  1367		/* Install the new region */
  1368		hlist_add_head(&region->hnode, &partition->pt_mem_regions);
  1369	
  1370		return 0;
  1371	
  1372	errout:
  1373		vfree(region);
  1374		return ret;
  1375	}
  1376	

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

                 reply	other threads:[~2025-12-14  5:57 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=202512141339.791TCKnB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anrayabh@linux.microsoft.com \
    --cc=jinankjain@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrathor@linux.microsoft.com \
    --cc=muislam@microsoft.com \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=prapal@linux.microsoft.com \
    --cc=romank@linux.microsoft.com \
    --cc=skinsburskii@linux.microsoft.com \
    --cc=wei.liu@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®