[PATCH v2 07/14] iommufd/viommu: Support get_viommu_size and viommu_init ops

Tian, Kevin kevin.tian at intel.com
Wed Jun 18 22:45:45 PDT 2025


> From: Nicolin Chen <nicolinc at nvidia.com>
> Sent: Saturday, June 14, 2025 2:35 PM
> 
> To ease the for-driver iommufd APIs, get_viommu_size and viommu_init ops
> are introduced to replace the viommu_init op.
> 
> Let the new viommu_init pathway coexist with the old viommu_alloc one.
> 
> Since the viommu_alloc op and its pathway will be soon deprecated, try to
> minimize the code difference between them by adding a tentative jump tag.
> 
> Note that this fails a !viommu->ops case from now on with a
> WARN_ON_ONCE
> since a vIOMMU is expected to support an alloc_domain_nested op for now,
> or some sort of a viommu op in the foreseeable future. This
> WARN_ON_ONCE
> can be lifted, if some day there is a use case wanting !viommu->ops.
> 
> Suggested-by: Jason Gunthorpe <jgg at nvidia.com>
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>

Reviewed-by: Kevin Tian <kevin.tian at intel.com>



More information about the linux-arm-kernel mailing list