Subject: Re: [PATCH v5 3/3] vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap()

From: Alex Williamson <[email-masked]>
Date: Wed, 20 May 2026 15:11:52 -0600

On Mon, 11 May 2026 07:58:25 -0700
Matt Evans <[email-masked]> wrote:

> Since "vfio/pci: Set up barmap in vfio_pci_core_enable()", the
> resource request and iomap for the BARs was performed early, and
> vfio_pci_core_setup_barmap() just checks those actions succeeded.
> 
> Move this logic to a new helper that checks success and returns the
> iomap address, replacing the various bare vdev->barmap[] lookups.
> This maintains the error behaviour of the previous on-demand
> vfio_pci_core_setup_barmap() scheme.
> 
> Signed-off-by: Matt Evans <[email-masked]>
> ---
>  drivers/vfio/pci/nvgrace-gpu/main.c | 20 ++++++++++++-------
>  drivers/vfio/pci/vfio_pci_core.c    | 11 +++++------
>  drivers/vfio/pci/vfio_pci_dmabuf.c  |  2 +-
>  drivers/vfio/pci/vfio_pci_rdwr.c    | 30 ++++++++---------------------
>  drivers/vfio/pci/virtio/legacy_io.c | 13 ++++++-------
>  include/linux/vfio_pci_core.h       | 20 ++++++++++++++++++-
>  6 files changed, 52 insertions(+), 44 deletions(-)

Applied to vfio next branch for v7.2, based on v7.1-rc4 which includes
the remainder of the series.  Thanks,

Alex