[PATCH v5 3/3] iommu/arm-smmu-v3: Allow ATS to be always on

Nicolin Chen nicolinc at nvidia.com
Thu May 21 10:44:55 PDT 2026


On Thu, May 21, 2026 at 10:44:09AM -0300, Jason Gunthorpe wrote:
> On Wed, May 20, 2026 at 03:35:32PM -0700, Nicolin Chen wrote:
> > @ -3870,13 +3870,15 @@ static int arm_smmu_blocking_set_dev_pasid(struct iommu_domain *new_domain,
> >          * When the last user of the CD table goes away downgrade the STE back
> >          * to a non-cd_table one, by re-attaching its sid_domain.
> >          */
> > -       if (!master->ats_always_on &&
> > -           !arm_smmu_ssids_in_use(&master->cd_table)) {
> > +       if (!arm_smmu_ssids_in_use(&master->cd_table)) {
> >                 struct iommu_domain *sid_domain =
> >                         iommu_driver_get_domain_for_dev(master->dev);
> > +               bool ats_always_on = master->ats_always_on &&
> > +                                    sid_domain->type != IOMMU_DOMAIN_BLOCKED;
> > +               bool downgrade = sid_domain->type == IOMMU_DOMAIN_IDENTITY ||
> > +                                sid_domain->type == IOMMU_DOMAIN_BLOCKED;
> > 
> > -               if (sid_domain->type == IOMMU_DOMAIN_IDENTITY ||
> > -                   sid_domain->type == IOMMU_DOMAIN_BLOCKED)
> > +               if (!ats_always_on && downgrade)
> >                         sid_domain->ops->attach_dev(sid_domain, dev,
> >                                                     sid_domain);
> 
> Only identity should remain with the CD S1DSS STE, BLOCKED should
> attach the normal blocking domain still

Yea. I have !ats_always_on guarding here.

Thanks
Nicolin



More information about the linux-arm-kernel mailing list