linux/drivers/vfio/pci
Ankit Agrawal a23b10608d vfio/nvgrace-gpu: wait for the GPU mem to be ready
Speculative prefetches from CPU to GPU memory until the GPU is
ready after reset can cause harmless corrected RAS events to
be logged on Grace systems. It is thus preferred that the
mapping not be re-established until the GPU is ready post reset.

The GPU readiness can be checked through BAR0 registers similar
to the checking at the time of device probe.

It can take several seconds for the GPU to be ready. So it is
desirable that the time overlaps as much of the VM startup as
possible to reduce impact on the VM bootup time. The GPU
readiness state is thus checked on the first fault/huge_fault
request or read/write access which amortizes the GPU readiness
time.

The first fault and read/write checks the GPU state when the
reset_done flag - which denotes whether the GPU has just been
reset. The memory_lock is taken across map/access to avoid
races with GPU reset.

Also check if the memory is enabled, before waiting for GPU
to be ready. Otherwise the readiness check would block for 30s.

Lastly added PM handling wrapping on read/write access.

Cc: Shameer Kolothum <skolothumtho@nvidia.com>
Cc: Alex Williamson <alex@shazbot.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Vikram Sethi <vsethi@nvidia.com>
Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
Suggested-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Link: https://lore.kernel.org/r/20251127170632.3477-7-ankita@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-11-28 10:09:26 -07:00
..
hisilicon vfio/pci: Convert all PCI drivers to get_region_info_caps 2025-11-12 15:06:40 -07:00
mlx5 vfio/pci: Convert all PCI drivers to get_region_info_caps 2025-11-12 15:06:40 -07:00
nvgrace-gpu vfio/nvgrace-gpu: wait for the GPU mem to be ready 2025-11-28 10:09:26 -07:00
pds vfio/pci: Convert all PCI drivers to get_region_info_caps 2025-11-12 15:06:40 -07:00
qat vfio/pci: Convert all PCI drivers to get_region_info_caps 2025-11-12 15:06:40 -07:00
virtio vfio/pci: Convert all PCI drivers to get_region_info_caps 2025-11-12 15:06:40 -07:00
Kconfig vfio/pci: Add dma-buf export support for MMIO regions 2025-11-20 21:12:19 -07:00
Makefile vfio/pci: Add dma-buf export support for MMIO regions 2025-11-20 21:12:19 -07:00
trace.h vfio/pci: Cleanup license mess 2019-01-22 11:06:05 -07:00
vfio_pci.c [v9] vfio/pci: Allow MMIO regions to be exported through dma-buf 2025-11-20 21:20:00 -07:00
vfio_pci_config.c vfio/nvgrace-gpu: wait for the GPU mem to be ready 2025-11-28 10:09:26 -07:00
vfio_pci_core.c vfio: use vfio_pci_core_setup_barmap to map bar in mmap 2025-11-28 10:07:25 -07:00
vfio_pci_dmabuf.c vfio/pci: Add dma-buf export support for MMIO regions 2025-11-20 21:12:19 -07:00
vfio_pci_igd.c vfio/pci: Use pci_is_display() 2025-07-17 15:30:13 -05:00
vfio_pci_intrs.c vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-11-28 10:04:27 -07:00
vfio_pci_priv.h vfio/nvgrace-gpu: wait for the GPU mem to be ready 2025-11-28 10:09:26 -07:00
vfio_pci_rdwr.c vfio/pci: Expose setup ROM at ROM bar when needed 2025-01-06 08:09:54 -07:00
vfio_pci_zdev.c Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next 2022-09-08 10:44:34 -06:00