-
- Downloads
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>
Showing
- drivers/s390/cio/vfio_ccw_drv.c 0 additions, 1 deletiondrivers/s390/cio/vfio_ccw_drv.c
- drivers/s390/cio/vfio_ccw_ops.c 1 addition, 14 deletionsdrivers/s390/cio/vfio_ccw_ops.c
- drivers/s390/cio/vfio_ccw_private.h 0 additions, 2 deletionsdrivers/s390/cio/vfio_ccw_private.h
- drivers/s390/crypto/vfio_ap_ops.c 1 addition, 12 deletionsdrivers/s390/crypto/vfio_ap_ops.c
- drivers/s390/crypto/vfio_ap_private.h 0 additions, 2 deletionsdrivers/s390/crypto/vfio_ap_private.h
- drivers/vfio/mdev/mdev_core.c 19 additions, 3 deletionsdrivers/vfio/mdev/mdev_core.c
- drivers/vfio/mdev/mdev_sysfs.c 4 additions, 1 deletiondrivers/vfio/mdev/mdev_sysfs.c
- include/linux/mdev.h 3 additions, 0 deletionsinclude/linux/mdev.h
- samples/vfio-mdev/mdpy.c 4 additions, 18 deletionssamples/vfio-mdev/mdpy.c
Loading
Please register or sign in to comment