[PATCH v2 02/10] iommu/arm-smmu-v3: Pass in IOTLB cache tag to CD and STE
Nicolin Chen
nicolinc at nvidia.com
Mon Jan 26 19:28:24 PST 2026
On Mon, Jan 26, 2026 at 04:53:58PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 21, 2026 at 05:24:20PM -0800, Nicolin Chen wrote:
> > Now, struct arm_smmu_attach_state has the IOTLB cache tags copied from the
> > cd->asid or s2_cfg->vmid of an smmu_domain.
> >
> > Pass it down to arm_smmu_make_s1_cd() and arm_smmu_make_s2_domain_ste() to
> > set in the CD and STE, removing the references of smmu_domain for its asid
> > or vmid.
> >
> > Note the two set_dev_pasid callbacks finalize CDs in arm_smmu_set_pasid().
> > So, it is safe for arm_smmu_make_sva_cd() and arm_smmu_make_s1_cd() to use
> > a dummy iotlb tag (asid=0) because arm_smmu_set_pasid() will fix it.
>
> Maybe it is time to fix that up?
>
> I think if you make arm_smmu_set_pasid() take in a function pointer of signature:
>
> void (*func)(struct arm_smmu_cd *target,
> struct arm_smmu_master *master,
> struct arm_smmu_domain *smmu_domain,
> struct arm_smmu_inv *tag)
>
> It can accept both arm_smmu_make_s1_cd() and arm_smmu_make_sva_cd()
> then call them at the right point once the tag is finally known.
Ack. That's cleaner. I will add a preparatory patch doing this.
Thanks!
Nicolin
More information about the linux-arm-kernel
mailing list