include/linux/vfio_pci_core.h:247:31: sparse: sparse: incorrect type in return expression (different address spaces)
kernel test robot
build bottree: https://github.com/awilliam/linux-vfio.git next head: b9285405c5f6144f4444f97bf3048d865e11cc1d commit: 859dc0f6253b0d65fd4d79e29aa29b3d939c51a9 [11/13] vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap() config: alpha-randconfig-r132-20260521 (https://download.01.org/0day-ci/archive/20260521/[email protected]/config) compiler: alpha-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/20260521/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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:1736:9: sparse: sparse: cast from restricted vm_fault_t drivers/vfio/pci/vfio_pci_core.c: note: in included file (through drivers/vfio/pci/vfio_pci_priv.h):
>> include/linux/vfio_pci_core.h:247:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
include/linux/vfio_pci_core.h:247:31: sparse: expected void [noderef] __iomem *
include/linux/vfio_pci_core.h:247:31: sparse: got void *
include/linux/vfio_pci_core.h:250:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
include/linux/vfio_pci_core.h:250:31: sparse: expected void [noderef] __iomem *
include/linux/vfio_pci_core.h:250:31: sparse: got void *
vim +247 include/linux/vfio_pci_core.h
235
236 /*
237 * Returns a BAR's iomap base or an ERR_PTR() if, for example, the
238 * BAR isn't valid, its resource wasn't acquired, or its iomap
239 * failed. This shall only be used after vfio_pci_core_enable()
240 * has set up the BAR maps and before vfio_pci_core_disable()
241 * tears them down.
242 */
243 static inline void __iomem __must_check *
244 vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, unsigned int bar)
245 {
246 if (WARN_ON_ONCE(bar >= PCI_STD_NUM_BARS))
> 247 return ERR_PTR(-EINVAL);
248
249 if (WARN_ON_ONCE(!vdev->barmap[bar]))
250 return ERR_PTR(-ENODEV);
251
252 return vdev->barmap[bar];
253 }
254
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Alex,
Quoted 50 lines · kernel test robot
tree: https://github.com/awilliam/linux-vfio.git next head: b9285405c5f6144f4444f97bf3048d865e11cc1d commit: 859dc0f6253b0d65fd4d79e29aa29b3d939c51a9 [11/13] vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap() config: alpha-randconfig-r132-20260521 (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20260521/[email protected]/config__;!!Bt8RZUm9aw!-MeA4YCZqVD1LgfRaoW0lgRz_bEdlvVRk8RWaDsMsFVUXAfMxQ3YFOteZOcWJ88tWRlbPA$ ) compiler: alpha-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/20260521/[email protected]/reproduce__;!!Bt8RZUm9aw!-MeA4YCZqVD1LgfRaoW0lgRz_bEdlvVRk8RWaDsMsFVUXAfMxQ3YFOteZOcWJ8-nGduJOw$ )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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/sparse warnings: (new ones prefixed by >>)
drivers/vfio/pci/vfio_pci_core.c:274:33: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:274:41: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:25: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:43: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:56: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:65: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:25: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:44: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:57: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:66: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:291:39: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:291:58: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:1736:9: sparse: sparse: cast from restrictedvm_fault_tdrivers/vfio/pci/vfio_pci_core.c: note: in included file (throughdrivers/vfio/pci/vfio_pci_priv.h):Quoted 1 line
Quoted 1 line
include/linux/vfio_pci_core.h:247:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef]__iomem* @@ got void * @@
include/linux/vfio_pci_core.h:247:31: sparse: expected void [noderef]__iomem*
include/linux/vfio_pci_core.h:247:31: sparse: got void *
include/linux/vfio_pci_core.h:250:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef]__iomem* @@ got void * @@
include/linux/vfio_pci_core.h:250:31: sparse: expected void [noderef]__iomem*
include/linux/vfio_pci_core.h:250:31: sparse: got void *vim +247
include/linux/vfio_pci_core.h235
236 /*
237 * Returns a BAR's iomap base or anERR_PTR()if, for example, the
238 * BAR isn't valid, its resource wasn't acquired, or its iomap
239 * failed. This shall only be used aftervfio_pci_core_enable()
240 * has set up the BAR maps and beforevfio_pci_core_disable()
241 * tears them down.
242 */
243 static inline void__iomem__must_check*
244vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, unsigned int bar)
245 {
246 if (WARN_ON_ONCE(bar >= PCI_STD_NUM_BARS))
Quoted 4 lines
Quoted 1 line
247 return
ERR_PTR(-EINVAL);248 249 if (WARN_ON_ONCE(!vdev->barmap[bar])) 250 return ERR_PTR(-ENODEV);
:( Yep, these need to be IOMEM_ERR_PTR() also. What's easiest for you given this is in your next? Should I repost a new version of the whole series (even though the 1/3, 2/3 went in via the 7.1 RC?), or a one-off repost of this patch, or..? Sorry for the silly Q, IDK what's best practice here.
Thanks,
Matt
Quoted 8 lines
251 252 return vdev->barmap[bar]; 253 } 254--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Quoted 58 lines · On Thu, 21 May 2026 17:59:03 +0100 Matt Evans <[email protected]> wrote:
Hi Alex,
Quoted 50 lines · kernel test robot
tree: https://github.com/awilliam/linux-vfio.git next head: b9285405c5f6144f4444f97bf3048d865e11cc1d commit: 859dc0f6253b0d65fd4d79e29aa29b3d939c51a9 [11/13] vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap() config: alpha-randconfig-r132-20260521 (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20260521/[email protected]/config__;!!Bt8RZUm9aw!-MeA4YCZqVD1LgfRaoW0lgRz_bEdlvVRk8RWaDsMsFVUXAfMxQ3YFOteZOcWJ88tWRlbPA$ ) compiler: alpha-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/20260521/[email protected]/reproduce__;!!Bt8RZUm9aw!-MeA4YCZqVD1LgfRaoW0lgRz_bEdlvVRk8RWaDsMsFVUXAfMxQ3YFOteZOcWJ8-nGduJOw$ )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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/sparse warnings: (new ones prefixed by >>)
drivers/vfio/pci/vfio_pci_core.c:274:33: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:274:41: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:25: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:43: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:56: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:278:65: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:25: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:44: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:57: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:283:66: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:291:39: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:291:58: sparse: sparse: restrictedpci_power_tdegrades to integerdrivers/vfio/pci/vfio_pci_core.c:1736:9: sparse: sparse: cast from restrictedvm_fault_tdrivers/vfio/pci/vfio_pci_core.c: note: in included file (throughdrivers/vfio/pci/vfio_pci_priv.h):Quoted 1 line
Quoted 1 line
include/linux/vfio_pci_core.h:247:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef]__iomem* @@ got void * @@
include/linux/vfio_pci_core.h:247:31: sparse: expected void [noderef]__iomem*
include/linux/vfio_pci_core.h:247:31: sparse: got void *
include/linux/vfio_pci_core.h:250:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef]__iomem* @@ got void * @@
include/linux/vfio_pci_core.h:250:31: sparse: expected void [noderef]__iomem*
include/linux/vfio_pci_core.h:250:31: sparse: got void *vim +247
include/linux/vfio_pci_core.h235
236 /*
237 * Returns a BAR's iomap base or anERR_PTR()if, for example, the
238 * BAR isn't valid, its resource wasn't acquired, or its iomap
239 * failed. This shall only be used aftervfio_pci_core_enable()
240 * has set up the BAR maps and beforevfio_pci_core_disable()
241 * tears them down.
242 */
243 static inline void__iomem__must_check*
244vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, unsigned int bar)
245 {
246 if (WARN_ON_ONCE(bar >= PCI_STD_NUM_BARS))Quoted 4 lines
Quoted 1 line
247 return
ERR_PTR(-EINVAL);248 249 if (WARN_ON_ONCE(!vdev->barmap[bar])) 250 return ERR_PTR(-ENODEV);
Quoted 5 lines
:( Yep, these need to be
IOMEM_ERR_PTR()also. What's easiest for you given this is in yournext? Should I repost a new version of the whole series (even though the 1/3, 2/3 went in via the 7.1 RC?), or a one-off repost of this patch, or..? Sorry for the silly Q, IDK what's best practice here.
No worries, I should have caught it too. Just send a follow-up patch against vfio next or linux-next. Thanks,
Alex