[PATCH v2 10/14] iommu/arm-smmu-v3: Replace arm_vsmmu_alloc with arm_vsmmu_init

Nicolin Chen nicolinc at nvidia.com
Mon Jun 16 19:15:19 PDT 2025


On Mon, Jun 16, 2025 at 10:43:22PM +0000, Pranjal Shrivastava wrote:
> On Fri, Jun 13, 2025 at 11:35:22PM -0700, Nicolin Chen wrote:
> > To ease the for-driver iommufd APIs, get_viommu_size and viommu_init ops
> > are introduced.
> > 
> > Sanitize the inputs and report the size of struct arm_vsmmu on success, in
> > arm_smmu_get_viommu_size().
> > 
> > Place the type sanity at the last, becase there will be soon an impl level
> > get_viommu_size op, which will require the same sanity tests prior. It can
> > simply insert a piece of code in front of the IOMMU_VIOMMU_TYPE_ARM_SMMUV3
> > sanity.
> > 
> 
> That's what I was wondering, so we plan to replace the impl->vsmmu_alloc
> op as well?

There is no such op in v6.16-rc1.

> > -	return &vsmmu->core;
> > +	viommu->ops = &arm_vsmmu_ops;
> > +	return 0;
> >  }
> 
> Seems much better now that the driver doesn't need to callback to the
> core for allocating viommu. One quick question though I see we've 
> removed the following too:
> 
>         if (master->smmu->impl_ops &&master->smmu->impl_ops->vsmmu_alloc)
> 	                vsmmu = master->smmu->impl_ops->vsmmu_alloc(
> 			                        master->smmu, s2_parent,
> 						ictx, viommu_type,
> 						user_data);
> 
> Not sure why don't I see that in the diffs.. do we plan to split this
> into an impl-specific size and init too?

Because there is no vsmmu_alloc in v6.16-rc1. I guess you are
referring to older versions of HW queue (vCMDQ) series that
was not merged?

Thanks
Nicolin



More information about the linux-arm-kernel mailing list