You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/hw/vfio
John Levon ecbe424a63 vfio: only check region info cache for initial regions
It is semantically valid for a VFIO device to increase the number of
regions after initialization. In this case, we'd attempt to check for
cached region info past the size of the ->reginfo array. Check for the
region index and skip the cache in these cases.

This also works around some VGPU use cases which appear to be a bug,
where VFIO_DEVICE_QUERY_GFX_PLANE returns a region index beyond the
reported ->num_regions.

Fixes: 95cdb024 ("vfio: add region info cache")
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Alex Williamson <alex@shazbot.org>
Link: https://lore.kernel.org/qemu-devel/20251014151227.2298892-3-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
1 day ago
..
Kconfig vfio: Remove 'vfio-platform' 1 month ago
ap.c vfio/iommufd: add vfio_device_free_name 4 months ago
ccw.c vfio: rename field to "num_initial_regions" 1 day ago
container-legacy.c vfio/container: Support unmap all in one ioctl() 1 day ago
container.c system/physmem: Extract API out of 'system/ram_addr.h' header 2 weeks ago
cpr-iommufd.c vfio: cpr-exec mode 3 weeks ago
cpr-legacy.c vfio/cpr-legacy: drop an erroneous assert 1 day ago
cpr.c vfio: cpr-exec mode 3 weeks ago
device.c vfio: only check region info cache for initial regions 1 day ago
display.c ramfb: Add property to control if load the romfile 3 months ago
helpers.c vfio/migration: Add x-migration-load-config-after-iter VFIO property 3 months ago
igd.c vfio/igd.c: use QOM casts where appropriate 1 month ago
iommufd-stubs.c migration: vfio cpr state hook 4 months ago
iommufd.c vfio: rename field to "num_initial_regions" 1 day ago
listener.c vfio/listener: Add an assertion for unmap_all 1 day ago
meson.build hw/vfio/container-base.c: rename file to container.c 4 weeks ago
migration-multifd.c vfio queue: 3 months ago
migration-multifd.h vfio/migration: Add x-migration-load-config-after-iter VFIO property 3 months ago
migration.c vfio/migration: Add x-migration-load-config-after-iter VFIO property 3 months ago
pci-quirks.c vfio: Do not unparent in instance_finalize() 4 weeks ago
pci-quirks.h vfio/pci: introduce config_offset field in VFIOConfigMirrorQuirk 8 months ago
pci.c vfio: rename field to "num_initial_regions" 1 day ago
pci.h hw/vfio/types.h: rename TYPE_VFIO_PCI_BASE to TYPE_VFIO_PCI_DEVICE 4 weeks ago
region.c vfio: Do not unparent in instance_finalize() 4 weeks ago
spapr.c hw: Remove unnecessary 'system/ram_addr.h' header 2 weeks ago
trace-events hw/vfio: Avoid ram_addr_t in vfio_container_query_dirty_bitmap() 3 weeks ago
trace.h vfio: add license tag to some files 4 months ago
types.h hw/vfio/types.h: rename TYPE_VFIO_PCI_BASE to TYPE_VFIO_PCI_DEVICE 4 weeks ago
vfio-display.h vfio: Introduce new files for VFIORegion definitions and declarations 6 months ago
vfio-helpers.h vfio/migration: Add x-migration-load-config-after-iter VFIO property 3 months ago
vfio-iommufd.h vfio/vfio-iommufd.h: rename VFIOContainer bcontainer field to parent_obj 4 weeks ago
vfio-listener.h include/hw/vfio/vfio-container-base.h: rename VFIOContainerBase to VFIOContainer 4 weeks ago
vfio-migration-internal.h hw/vfio/vfio-migration: Remove unnecessary 'qemu/typedefs.h' include 3 months ago
vfio-region.h vfio: Move vfio-region.h under hw/vfio/ 1 month ago