Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [awilliam-vfio:for-linus 3/4] drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2026-05-14 16:39 kernel test robot
  2026-05-14 17:17 ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2026-05-14 16:39 UTC (permalink / raw)
  To: Matt Evans; +Cc: oe-kbuild-all, kvm, Alex Williamson

tree:   https://github.com/awilliam/linux-vfio.git for-linus
head:   a8a3ce989a94db08f77968a4e75b34eaa6d40c9a
commit: a975fd177726e110f30b561dd0707b78f21ffe66 [3/4] vfio/pci: Set up BAR resources and maps in vfio_pci_core_enable()
config: parisc-randconfig-r134-20260514 (https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-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/202605150023.lXFibOM0-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/vfio/pci/vfio_pci_core.c:274:33: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:274:41: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:278:25: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:278:43: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:278:56: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:278:65: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:283:25: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:283:44: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:283:57: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:283:66: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:291:39: sparse: sparse: restricted pci_power_t degrades to integer
   drivers/vfio/pci/vfio_pci_core.c:291:58: sparse: sparse: restricted pci_power_t degrades to integer
>> drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
   drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     expected void [noderef] __iomem *
   drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     got void *
   drivers/vfio/pci/vfio_pci_core.c:506:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
   drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     expected void [noderef] __iomem *
   drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     got void *
   drivers/vfio/pci/vfio_pci_core.c:514:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
   drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     expected void [noderef] __iomem *
   drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     got void *
   drivers/vfio/pci/vfio_pci_core.c:1736:9: sparse: sparse: cast from restricted vm_fault_t

vim +499 drivers/vfio/pci/vfio_pci_core.c

   484	
   485	/*
   486	 * Eager-request BAR resources, and iomap them.  Soft failures are
   487	 * allowed, and consumers must check the barmap before use in order to
   488	 * give compatible user-visible behaviour with the previous on-demand
   489	 * allocation method.
   490	 */
   491	static void vfio_pci_core_map_bars(struct vfio_pci_core_device *vdev)
   492	{
   493		struct pci_dev *pdev = vdev->pdev;
   494		int i;
   495	
   496		for (i = 0; i < PCI_STD_NUM_BARS; i++) {
   497			int bar = i + PCI_STD_RESOURCES;
   498	
 > 499			vdev->barmap[bar] = ERR_PTR(-ENODEV);
   500	
   501			if (!pci_resource_len(pdev, i))
   502				continue;
   503	
   504			if (pci_request_selected_regions(pdev, 1 << bar, "vfio")) {
   505				pci_dbg(pdev, "Failed to reserve region %d\n", bar);
   506				vdev->barmap[bar] = ERR_PTR(-EBUSY);
   507				continue;
   508			}
   509	
   510			vdev->barmap[bar] = pci_iomap(pdev, bar, 0);
   511			if (!vdev->barmap[bar]) {
   512				pci_dbg(pdev, "Failed to iomap region %d\n", bar);
   513				pci_release_selected_regions(pdev, 1 << bar);
   514				vdev->barmap[bar] = ERR_PTR(-ENOMEM);
   515			}
   516		}
   517	}
   518	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [awilliam-vfio:for-linus 3/4] drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces)
  2026-05-14 16:39 [awilliam-vfio:for-linus 3/4] drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot
@ 2026-05-14 17:17 ` Alex Williamson
  2026-05-14 17:45   ` Matt Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2026-05-14 17:17 UTC (permalink / raw)
  To: Matt Evans; +Cc: kernel test robot, oe-kbuild-all, kvm, alex

On Fri, 15 May 2026 00:39:50 +0800
kernel test robot <lkp@intel.com> wrote:

> tree:   https://github.com/awilliam/linux-vfio.git for-linus
> head:   a8a3ce989a94db08f77968a4e75b34eaa6d40c9a
> commit: a975fd177726e110f30b561dd0707b78f21ffe66 [3/4] vfio/pci: Set up BAR resources and maps in vfio_pci_core_enable()
> config: parisc-randconfig-r134-20260514 (https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-lkp@intel.com/config)
> compiler: hppa-linux-gcc (GCC) 8.5.0
> sparse: v0.6.5-rc1
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-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/202605150023.lXFibOM0-lkp@intel.com/
> 
> sparse warnings: (new ones prefixed by >>)
>    drivers/vfio/pci/vfio_pci_core.c:274:33: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:274:41: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:278:25: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:278:43: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:278:56: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:278:65: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:283:25: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:283:44: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:283:57: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:283:66: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:291:39: sparse: sparse: restricted pci_power_t degrades to integer
>    drivers/vfio/pci/vfio_pci_core.c:291:58: sparse: sparse: restricted pci_power_t degrades to integer
> >> drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@  
>    drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     expected void [noderef] __iomem *
>    drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     got void *
>    drivers/vfio/pci/vfio_pci_core.c:506:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
>    drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     expected void [noderef] __iomem *
>    drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     got void *
>    drivers/vfio/pci/vfio_pci_core.c:514:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
>    drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     expected void [noderef] __iomem *
>    drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     got void *
>    drivers/vfio/pci/vfio_pci_core.c:1736:9: sparse: sparse: cast from restricted vm_fault_t
> 
> vim +499 drivers/vfio/pci/vfio_pci_core.c
> 
>    484	
>    485	/*
>    486	 * Eager-request BAR resources, and iomap them.  Soft failures are
>    487	 * allowed, and consumers must check the barmap before use in order to
>    488	 * give compatible user-visible behaviour with the previous on-demand
>    489	 * allocation method.
>    490	 */
>    491	static void vfio_pci_core_map_bars(struct vfio_pci_core_device *vdev)
>    492	{
>    493		struct pci_dev *pdev = vdev->pdev;
>    494		int i;
>    495	
>    496		for (i = 0; i < PCI_STD_NUM_BARS; i++) {
>    497			int bar = i + PCI_STD_RESOURCES;
>    498	
>  > 499			vdev->barmap[bar] = ERR_PTR(-ENODEV);  

I think we just need to convert these three ERR_PTR()s to
IOMEM_ERR_PTR().  Agree?  I can fix it in the branch.  Thanks,

Alex

>    500	
>    501			if (!pci_resource_len(pdev, i))
>    502				continue;
>    503	
>    504			if (pci_request_selected_regions(pdev, 1 << bar, "vfio")) {
>    505				pci_dbg(pdev, "Failed to reserve region %d\n", bar);
>    506				vdev->barmap[bar] = ERR_PTR(-EBUSY);
>    507				continue;
>    508			}
>    509	
>    510			vdev->barmap[bar] = pci_iomap(pdev, bar, 0);
>    511			if (!vdev->barmap[bar]) {
>    512				pci_dbg(pdev, "Failed to iomap region %d\n", bar);
>    513				pci_release_selected_regions(pdev, 1 << bar);
>    514				vdev->barmap[bar] = ERR_PTR(-ENOMEM);
>    515			}
>    516		}
>    517	}
>    518	
> 
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [awilliam-vfio:for-linus 3/4] drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces)
  2026-05-14 17:17 ` Alex Williamson
@ 2026-05-14 17:45   ` Matt Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Evans @ 2026-05-14 17:45 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kernel test robot, oe-kbuild-all, kvm

Hi Alex,

On 14/05/2026 18:17, Alex Williamson wrote:
> 
> On Fri, 15 May 2026 00:39:50 +0800
> kernel test robot <lkp@intel.com> wrote:
> 
>> tree:   https://github.com/awilliam/linux-vfio.git  for-linus
>> head:   a8a3ce989a94db08f77968a4e75b34eaa6d40c9a
>> commit: a975fd177726e110f30b561dd0707b78f21ffe66 [3/4] vfio/pci: Set up BAR resources and maps in vfio_pci_core_enable()
>> config: parisc-randconfig-r134-20260514 (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-lkp@intel.com/config__;!!Bt8RZUm9aw!4Ml3rrJPR5hgJ8qM0OCxOwEdJwF-k0mYiuEeBClnnKNLCVzue2QGcVDL6uji9tVJzQBE381sJg$ )
>> compiler: hppa-linux-gcc (GCC) 8.5.0
>> sparse: v0.6.5-rc1
>> reproduce (this is a W=1 build): (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20260515/202605150023.lXFibOM0-lkp@intel.com/reproduce__;!!Bt8RZUm9aw!4Ml3rrJPR5hgJ8qM0OCxOwEdJwF-k0mYiuEeBClnnKNLCVzue2QGcVDL6uji9tVJzQDT2Jsk6w$ )
>>
>> 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/202605150023.lXFibOM0-lkp@intel.com/
>>
>> sparse warnings: (new ones prefixed by >>)
>>     drivers/vfio/pci/vfio_pci_core.c:274:33: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:274:41: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:278:25: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:278:43: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:278:56: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:278:65: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:283:25: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:283:44: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:283:57: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:283:66: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:291:39: sparse: sparse: restricted pci_power_t degrades to integer
>>     drivers/vfio/pci/vfio_pci_core.c:291:58: sparse: sparse: restricted pci_power_t degrades to integer
>>>> drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
>>     drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     expected void [noderef] __iomem *
>>     drivers/vfio/pci/vfio_pci_core.c:499:35: sparse:     got void *
>>     drivers/vfio/pci/vfio_pci_core.c:506:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
>>     drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     expected void [noderef] __iomem *
>>     drivers/vfio/pci/vfio_pci_core.c:506:43: sparse:     got void *
>>     drivers/vfio/pci/vfio_pci_core.c:514:43: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem * @@     got void * @@
>>     drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     expected void [noderef] __iomem *
>>     drivers/vfio/pci/vfio_pci_core.c:514:43: sparse:     got void *
>>     drivers/vfio/pci/vfio_pci_core.c:1736:9: sparse: sparse: cast from restricted vm_fault_t
>>
>> vim +499 drivers/vfio/pci/vfio_pci_core.c
>>
>>     484	
>>     485	/*
>>     486	 * Eager-request BAR resources, and iomap them.  Soft failures are
>>     487	 * allowed, and consumers must check the barmap before use in order to
>>     488	 * give compatible user-visible behaviour with the previous on-demand
>>     489	 * allocation method.
>>     490	 */
>>     491	static void vfio_pci_core_map_bars(struct vfio_pci_core_device *vdev)
>>     492	{
>>     493		struct pci_dev *pdev = vdev->pdev;
>>     494		int i;
>>     495	
>>     496		for (i = 0; i < PCI_STD_NUM_BARS; i++) {
>>     497			int bar = i + PCI_STD_RESOURCES;
>>     498	
>>   > 499			vdev->barmap[bar] = ERR_PTR(-ENODEV);
> 
> I think we just need to convert these three ERR_PTR()s to
> IOMEM_ERR_PTR().  Agree?  I can fix it in the branch.  Thanks,

Oops, sorry about that!  Yes agree, that would be great, thank you.

Matt

> 
> Alex
> 
>>     500	
>>     501			if (!pci_resource_len(pdev, i))
>>     502				continue;
>>     503	
>>     504			if (pci_request_selected_regions(pdev, 1 << bar, "vfio")) {
>>     505				pci_dbg(pdev, "Failed to reserve region %d\n", bar);
>>     506				vdev->barmap[bar] = ERR_PTR(-EBUSY);
>>     507				continue;
>>     508			}
>>     509	
>>     510			vdev->barmap[bar] = pci_iomap(pdev, bar, 0);
>>     511			if (!vdev->barmap[bar]) {
>>     512				pci_dbg(pdev, "Failed to iomap region %d\n", bar);
>>     513				pci_release_selected_regions(pdev, 1 << bar);
>>     514				vdev->barmap[bar] = ERR_PTR(-ENOMEM);
>>     515			}
>>     516		}
>>     517	}
>>     518	
>>
>> --
>> 0-DAY CI Kernel Test Service
>> https://github.com/intel/lkp-tests/wiki
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-14 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14 16:39 [awilliam-vfio:for-linus 3/4] drivers/vfio/pci/vfio_pci_core.c:499:35: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot
2026-05-14 17:17 ` Alex Williamson
2026-05-14 17:45   ` Matt Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox