[PATCH v3 06/11] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC
Jason Gunthorpe
jgg at nvidia.com
Thu Oct 17 10:06:43 PDT 2024
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
More information about the linux-arm-kernel
mailing list