mirror of https://github.com/torvalds/linux.git
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> |
||
|---|---|---|
| .. | ||
| hisilicon | ||
| mlx5 | ||
| nvgrace-gpu | ||
| pds | ||
| qat | ||
| virtio | ||
| Kconfig | ||
| Makefile | ||
| trace.h | ||
| vfio_pci.c | ||
| vfio_pci_config.c | ||
| vfio_pci_core.c | ||
| vfio_pci_dmabuf.c | ||
| vfio_pci_igd.c | ||
| vfio_pci_intrs.c | ||
| vfio_pci_priv.h | ||
| vfio_pci_rdwr.c | ||
| vfio_pci_zdev.c | ||