Re: [PATCH v2 2/3] vfio/pci: Replace vfio_pci_core_setup_barmap() with checks for resource/map

Alex Williamson
2026-04-23T21:30:51Z

On Thu, 23 Apr 2026 11:25:08 -0700
Matt Evans <mattev@meta.com> 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() now just checks those actions succeeded.
>
> There were two types of callers:
> - Those that need the iomap, because they'll access the BAR
> - Those that need the resource, because they'll map/export it
>
> This replaces vfio_pci_core_setup_barmap() with two helpers,
> vfio_pci_core_check_barmap_valid() and vfio_pci_core_check_bar_rsrc(),
> to make it clear which behaviour is required in each caller.

TBH, I don't see why we need the distinction. Thanks,

Alex