i915/gvt: Move gvt mapping cache initialization to intel_vgpu_init_dev()
vfio container registers .dma_unmap() callback after the device is opened. So it's fine for mdev drivers to initialize internal mapping cache in .open_device(). See vfio_device_container_register(). Now with iommufd an access ops with an unmap callback is registered when the device is bound to iommufd which is before .open_device() is called. This implies gvt's .dma_unmap() could be called before its internal mapping cache is initialized. The fix is moving gvt mapping cache initialization to vGPU init. While at it also move ptable initialization together. Link: https://lore.kernel.org/r/20221202135402.756470-2-yi.l.liu@intel.comReviewed-by: NZhi Wang <zhi.a.wang@intel.com> Reviewed-by: NZhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: NYi Liu <yi.l.liu@intel.com> Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
Showing
想要评论请 注册 或 登录