* drivers/hv/mshv_root_main.c:1341:14: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2025-12-14 5:57 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-14 5:57 UTC (permalink / raw)
To: Nuno Das Neves
Cc: oe-kbuild-all, linux-kernel, Wei Liu, Anirudh Rayabharam,
Jinank Jain, Mukesh Rathor, Muminul Islam, Praveen K Paladugu,
Stanislav Kinsburskii, Roman Kisel
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, ®ion,
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(®ion->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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-14 5:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-14 5:57 drivers/hv/mshv_root_main.c:1341:14: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
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®