linux/drivers/vfio
Jason Gunthorpe 9c799c224d vfio/mdev: add mdev available instance checking to the core
Many of the mdev drivers use a simple counter for keeping track of the
available instances. Move this code to the core code and store the counter
in the mdev_parent. Implement it using correct locking, fixing mdpy.

Drivers just provide the value in the mdev_driver at registration time
and the core code takes care of maintaining it and exposing the value in
sysfs.

[hch: count instances per-parent instead of per-type, use an atomic_t
 to avoid taking mdev_list_lock in the show method]

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/r/20220923092652.100656-15-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2022-10-04 12:06:58 -06:00
..
fsl-mc vfio/fsl-mc: Use the new device life cycle helpers 2022-09-21 14:15:11 -06:00
mdev vfio/mdev: add mdev available instance checking to the core 2022-10-04 12:06:58 -06:00
pci hisi_acc_vfio_pci: Update some log and comment formats 2022-09-27 09:30:31 -06:00
platform vfio/amba: Use the new device life cycle helpers 2022-09-21 14:15:11 -06:00
container.c vfio: Move container code into drivers/vfio/container.c 2022-09-22 15:46:06 -06:00
iova_bitmap.c vfio: Add an IOVA bitmap support 2022-09-08 12:59:00 -06:00
Kconfig vfio: Introduce the DMA logging feature support 2022-09-08 12:59:00 -06:00
Makefile vfio: Move container code into drivers/vfio/container.c 2022-09-22 15:46:06 -06:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: Fix the comment 2022-07-22 16:24:47 -06:00
vfio_iommu_type1.c vfio: Replace phys_pfn with pages for vfio_pin_pages() 2022-07-25 13:41:22 -06:00
vfio_main.c vfio: Follow a strict lifetime for struct iommu_group 2022-09-27 09:01:23 -06:00
vfio_spapr_eeh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vfio.h vfio: Follow a strict lifetime for struct iommu_group 2022-09-27 09:01:23 -06:00
virqfd.c vfio/virqfd: Drain events from eventfd in virqfd_wakeup() 2020-11-15 09:49:10 -05:00