[PATCH v2 07/10] iommu/arm-smmu-v3: Pass in vsmmu to arm_smmu_domain_get_iotlb_tag()

Nicolin Chen nicolinc at nvidia.com
Mon Jan 26 19:34:17 PST 2026


On Mon, Jan 26, 2026 at 05:20:00PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 21, 2026 at 05:24:25PM -0800, Nicolin Chen wrote:
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > index 5a7032081553..8323f74c8923 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> > @@ -3137,6 +3137,7 @@ static int __arm_smmu_domain_get_iotlb_tag(struct arm_smmu_domain *smmu_domain,
> >  
> >  int arm_smmu_domain_get_iotlb_tag(struct arm_smmu_domain *smmu_domain,
> >  				  struct arm_smmu_device *smmu,
> > +				  struct arm_vsmmu *vsmmu,
> >  				  struct arm_smmu_inv *tag, bool alloc)
> >  {
> >  	int ret;
> 
> This all seems too complicated, the domain passed in should have been
> a iommu_domain, not a smmu_domain, then you can just do
> 
> if (domain->Type == IOMMU_DOMAIN_NESTED) {
>   struct arm_smmu_nested_domain *nested = to_smmu_nested_domain(domain);
>    tag->type = INV_TYPE_S2_VMID_VSMMU;
>    tag->id = nested->vsmmu->vmid;
>    tag->smmu = nested->vsmmu->smmu;
>    return 0;
> }
> 
> Here and everything is simple.

Hmm, should have squashed this in the base series v10 that I just
sent. Anyway, I can change this in v3.

Thanks
Nicolin



More information about the linux-arm-kernel mailing list