[PATCH v9 02/14] iommu/arm-smmu-v3: Start building a generic PASID layer

Nicolin Chen nicolinc at nvidia.com
Tue Jul 2 10:03:08 PDT 2024


On Tue, Jul 02, 2024 at 03:57:05PM +0100, Will Deacon wrote:
> > @@ -611,10 +599,9 @@ void arm_smmu_sva_remove_dev_pasid(struct iommu_domain *domain,
> >       struct arm_smmu_bond *bond = NULL, *t;
> >       struct arm_smmu_master *master = dev_iommu_priv_get(dev);
> >
> > +     arm_smmu_remove_pasid(master, to_smmu_domain(domain), id);
> > +
> >       mutex_lock(&sva_lock);
> > -
> > -     arm_smmu_clear_cd(master, id);
> 
> This looks a bit alarming, as you're effectively moving the CD
> modification outside of the critical section. I assume we're relying on
> the iommu group mutex to serialise this in the caller? I can't see any
> consistent locking in the driver for arm_smmu_clear_cd().

Hi Will, your assumption is correct. Jason had the same remark
during the v7 review:
https://lore.kernel.org/linux-iommu/ZkDAL+TX93QfTFMc@nvidia.com/

Thanks
Nicolin



More information about the linux-arm-kernel mailing list