On Wed, Oct 09, 2024 at 09:38:06AM -0700, Nicolin Chen wrote:
> @@ -317,6 +324,19 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
>                       goto out_unlock;
>               }
>               hwpt = &hwpt_nested->common;
> +     } else if (pt_obj->type == IOMMUFD_OBJ_VIOMMU) {
> +             struct iommufd_hwpt_nested *hwpt_nested;
> +             struct iommufd_viommu *viommu;
> +
> +             viommu = container_of(pt_obj, struct iommufd_viommu, obj);

One thought is to continue like we do with the domain and check that
the idev's iommu ops match the viommu's iommu ops (or is null for
default) before allowing the callback.

Jason

Reply via email to