[PATCH v7 13/16] iommufd/viommu: Select vIOMMU operations before allocation

Jason Gunthorpe jgg at nvidia.com
Wed Oct 28 12:07:21 PDT 2026


> [ ... 62 lines skipped ... ]
> --- a/drivers/iommu/amd/iommufd.c
> +++ b/drivers/iommu/amd/iommufd.c
> @@ -32,13 +32,21 @@ void *amd_iommufd_hw_info(struct device *dev, u32 *length, enum iommu_hw_info_ty
>  	return hwinfo;
>  }
>  
> -size_t amd_iommufd_get_viommu_size(struct device *dev, enum iommu_viommu_type viommu_type)
> +static size_t amd_iommufd_get_viommu_size(struct device *dev,
> +		enum iommu_viommu_type viommu_type)
>  {
>  	return VIOMMU_STRUCT_SIZE(struct amd_iommu_viommu, core);
>  }
>  
> -int amd_iommufd_viommu_init(struct iommufd_viommu *viommu, struct iommu_domain *parent,
> -			    const struct iommu_user_data *user_data)
> +const struct iommufd_viommu_ops *
> +amd_iommufd_get_viommu_ops(struct device *dev, enum iommu_viommu_type viommu_type)
> +{
> +	return &amd_viommu_ops;
> +}

This needs to fail not retain the broken behavior if this is getting
touched..

The rest looks OK and makes sense to me

-- 
Jason



More information about the linux-arm-kernel mailing list