From: Jason Gunthorpe <jgg@nvidia.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: will@kernel.org, joro@8bytes.org, bhelgaas@google.com,
robin.murphy@arm.com, praan@google.com, baolu.lu@linux.intel.com,
kevin.tian@intel.com, miko.lenczewski@arm.com,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
dan.j.williams@intel.com, jonathan.cameron@huawei.com,
vsethi@nvidia.com, linux-cxl@vger.kernel.org, nirmoyd@nvidia.com
Subject: Re: [PATCH v5 3/3] iommu/arm-smmu-v3: Allow ATS to be always on
Date: Thu, 21 May 2026 10:44:09 -0300 [thread overview]
Message-ID: <20260521134409.GG3602937@nvidia.com> (raw)
In-Reply-To: <ag43NP4UiS7Z9T6q@Asurada-Nvidia>
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
Jason
next prev parent reply other threads:[~2026-05-21 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 19:46 [PATCH v5 0/3] Allow ATS to be always on for certain ATS-capable devices Nicolin Chen
2026-05-20 19:46 ` [PATCH v5 1/3] PCI: Add pci_ats_required() for CXL.cache capable devices Nicolin Chen
2026-05-20 20:03 ` Bjorn Helgaas
2026-05-20 20:20 ` Nicolin Chen
2026-05-20 19:46 ` [PATCH v5 2/3] PCI: Allow ATS to be always on for pre-CXL devices Nicolin Chen
2026-05-20 20:04 ` Bjorn Helgaas
2026-05-20 19:46 ` [PATCH v5 3/3] iommu/arm-smmu-v3: Allow ATS to be always on Nicolin Chen
2026-05-20 22:35 ` Nicolin Chen
2026-05-21 13:44 ` Jason Gunthorpe [this message]
2026-05-21 17:44 ` Nicolin Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260521134409.GG3602937@nvidia.com \
--to=jgg@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=iommu@lists.linux.dev \
--cc=jonathan.cameron@huawei.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=miko.lenczewski@arm.com \
--cc=nicolinc@nvidia.com \
--cc=nirmoyd@nvidia.com \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=vsethi@nvidia.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox