linux/drivers/vfio
Brett Creeley 6a7e448c6b vfio/pds: Refactor/simplify reset logic
The current logic for handling resets is more complicated than it needs
to be. The deferred_reset flag is used to indicate a reset is needed
and the deferred_reset_state is the requested, post-reset, state.

Also, the deferred_reset logic was added to vfio migration drivers to
prevent a circular locking dependency with respect to mm_lock and state
mutex. This is mainly because of the copy_to/from_user() functions(which
takes mm_lock) invoked under state mutex.

Remove all of the deferred reset logic and just pass the requested
next state to pds_vfio_reset() so it can be used for VMM and DSC
initiated resets.

This removes the need for pds_vfio_state_mutex_lock(), so remove that
and replace its use with a simple mutex_unlock().

Also, remove the reset_mutex as it's no longer needed since the
state_mutex can be the driver's primary protector.

Suggested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Link: https://lore.kernel.org/r/20240308182149.22036-3-brett.creeley@amd.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2024-03-11 12:10:37 -06:00
..
cdx Char/Misc and other driver changes for 6.7-rc1 2023-11-03 14:51:08 -10:00
fsl-mc eventfd: simplify eventfd_signal() 2023-11-28 14:08:38 +01:00
mdev vfio: mdev: make mdev_bus_type const 2024-02-22 12:19:33 -07:00
pci vfio/pds: Refactor/simplify reset logic 2024-03-11 12:10:37 -06:00
platform vfio/platform: Convert to platform remove callback returning void 2024-03-11 12:09:22 -06:00
container.c VFIO updates for v6.3-rc1 2023-02-25 11:52:57 -08:00
debugfs.c vfio/migration: Add debugfs to live migration driver 2023-12-04 14:29:08 -07:00
device_cdev.c vfio: Add VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT 2023-07-25 10:20:37 -06:00
group.c vfio: Move the IOMMU_CAP_CACHE_COHERENCY check in __vfio_register_dev() 2023-07-25 10:20:41 -06:00
iommufd.c vfio: Support IO page table replacement 2023-07-28 13:31:24 -03:00
Kconfig vfio/migration: Add debugfs to live migration driver 2023-12-04 14:29:08 -07:00
Makefile vfio/migration: Add debugfs to live migration driver 2023-12-04 14:29:08 -07:00
vfio.h vfio/migration: Add debugfs to live migration driver 2023-12-04 14:29:08 -07:00
vfio_iommu_spapr_tce.c powerpc/iommu: Add iommu_ops to report capabilities and allow blocking domains 2023-03-15 00:51:46 +11:00
vfio_iommu_type1.c Revert "vfio/type1: Unpin zero pages" 2024-03-04 16:11:07 -07:00
vfio_main.c vfio/migration: Add debugfs to live migration driver 2023-12-04 14:29:08 -07:00
virqfd.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00