Re: [PATCH v4 2/4] iommufd/viommu: Associate a kvm pointer to iommufd_viommu

Jason Gunthorpe
2026-04-27T14:04:24Z

On Mon, Apr 27, 2026 at 11:40:03AM +0530, Aneesh Kumar K.V (Arm) wrote:
> @@ -68,14 +71,22 @@ int iommufd_viommu_alloc_ioctl(struct iommufd_ucmd *ucmd)
> goto out_put_hwpt;
> }
>
> + if (idev->kvm && !kvm_get_kvm_safe(idev->kvm)) {
> + rc = -ENOENT;
> + goto out_put_hwpt;
> + }

Can we actually do this or is this circular module references if kvm
isn't built in? kvm->vfio->iommufd->kvm isn't it?

This is why I want to use file *...

Jason