[iommufd PATCH v2 0/2] Make mdev driver dma_unmap callback tolerant to unmaps come before device open

Yi Liu
2022-11-29T09:35:52Z

Jason's "Connect VFIO to IOMMUFD" introduces vfio iommufd compat mode. Under
this mode, vfio_iommufd_bind() creates an access which has an unmap callback,
which can be called immediately. This means mdev drivers may receive unmap
requests before the mdev is opened. For now, there are only three drivers
(gvt, vfio-ap and vfio-ccw) providing dma_unmap(). vfio-ccw is fine with
such requests. While gvt-g and vfio-ap may have potential problem with such
requests due to internal implementation. This series tries to enhance the two
drivers.

This series is based on Jason's below branch.

https://github.com/jgunthorpe/linux/tree/iommufd

(commit: 41973418f6c8c241ed5647d1408d5b917f24dfd8)

Change:
v2:
- Refine the cover letter and commit message of patch 0001 (Kevin)
- Rename patch 0001 to better fit the commit message
- Add r-b from Zhi for patch 0001
- tweak iova range test to assume page-aligned for patch 0002 (Jason)
- Remove break so all queues within range are removed for patch 0002 (Kevin)

v1: https://lore.kernel.org/kvm/20221123134832.429589-1-yi.l.liu@intel.com/

Cc: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: Halil Pasic <pasic@linux.ibm.com>
Cc: Jason Herne <jjherne@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: intel-gvt-dev@lists.freedesktop.org

Regards,
Yi Liu

Matthew Rosato (1):
vfio/ap: validate iova during dma_unmap and trigger irq disable

Yi Liu (1):
i915/gvt: Move gvt mapping cache initialization to vGPU creation

drivers/gpu/drm/i915/gvt/gvt.h | 2 ++
drivers/gpu/drm/i915/gvt/kvmgt.c | 7 ++-----
drivers/gpu/drm/i915/gvt/vgpu.c | 2 ++
drivers/s390/crypto/vfio_ap_ops.c | 18 +++++++++++++++++-
4 files changed, 23 insertions(+), 6 deletions(-)

--
2.34.1