Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Matt Evans <mattev@meta.com>
Cc: kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev, kvm@vger.kernel.org,
	alex@shazbot.org
Subject: 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)
Date: Thu, 14 May 2026 11:17:31 -0600	[thread overview]
Message-ID: <20260514111731.5ef8faa4@shazbot.org> (raw)
In-Reply-To: <202605150023.lXFibOM0-lkp@intel.com>

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


  reply	other threads:[~2026-05-14 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-05-14 17:45   ` Matt Evans

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=20260514111731.5ef8faa4@shazbot.org \
    --to=alex@shazbot.org \
    --cc=kvm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mattev@meta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox