Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Matt Evans <mattev@meta.com>
To: Alex Williamson <alex@shazbot.org>
Cc: kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev, kvm@vger.kernel.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 18:45:49 +0100	[thread overview]
Message-ID: <923eed09-6637-425d-a8fc-123c9e010c33@meta.com> (raw)
In-Reply-To: <20260514111731.5ef8faa4@shazbot.org>

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
> 


      reply	other threads:[~2026-05-14 17:45 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
2026-05-14 17:45   ` Matt Evans [this message]

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=923eed09-6637-425d-a8fc-123c9e010c33@meta.com \
    --to=mattev@meta.com \
    --cc=alex@shazbot.org \
    --cc=kvm@vger.kernel.org \
    --cc=lkp@intel.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