Linux IOMMU Development
 help / color / mirror / Atom feed
From: Michael Shavit <mshavit@google.com>
To: Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	 Joerg Roedel <joro@8bytes.org>
Cc: Michael Shavit <mshavit@google.com>,
	jean-philippe@linaro.org, nicolinc@nvidia.com,  jgg@nvidia.com,
	baolu.lu@linux.intel.com,  linux-arm-kernel@lists.infradead.org,
	iommu@lists.linux.dev,  linux-kernel@vger.kernel.org
Subject: [PATCH v3 06/13] iommu/arm-smmu-v3: Simplify arm_smmu_enable_ats
Date: Wed, 14 Jun 2023 23:41:58 +0800	[thread overview]
Message-ID: <20230614154304.2860121-7-mshavit@google.com> (raw)
In-Reply-To: <20230614154304.2860121-1-mshavit@google.com>

arm_smmu_enable_ats's call to inv_domain would trigger an invalidation
for all masters that a domain is attached to everytime it's attached to
another ATS-enabled master. It doesn't seem like those invalidations are
necessary, and it's easier to reason about arm_smmu_enable_ats if it
only issues invalidation commands for the current master.

Signed-off-by: Michael Shavit <mshavit@google.com>
---
v1->v2: Fix commit message wrapping
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 08f440fe1da6d..dc7a59e87a2b4 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -2286,7 +2286,7 @@ static void arm_smmu_enable_ats(struct arm_smmu_master *master)
 	pdev = to_pci_dev(master->dev);
 
 	atomic_inc(&smmu_domain->nr_ats_masters);
-	arm_smmu_atc_inv_domain(smmu_domain, 0, 0, 0);
+	arm_smmu_atc_inv_master(master);
 	if (pci_enable_ats(pdev, stu))
 		dev_err(master->dev, "Failed to enable ATS (STU %zu)\n", stu);
 }
-- 
2.41.0.162.gfafddb0af9-goog


  parent reply	other threads:[~2023-06-14 15:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 15:41 [PATCH v3 00/13] Add PASID support to SMMUv3 unmanaged domains Michael Shavit
2023-06-14 15:41 ` [PATCH v3 01/13] iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg Michael Shavit
2023-06-14 15:41 ` [PATCH v3 02/13] iommu/arm-smmu-v3: Add smmu_s1_cfg to smmu_master Michael Shavit
2023-06-14 15:41 ` [PATCH v3 03/13] iommu/arm-smmu-v3: Refactor write_strtab_ent Michael Shavit
2023-06-14 15:41 ` [PATCH v3 04/13] iommu/arm-smmu-v3: Refactor write_ctx_desc Michael Shavit
2023-06-14 15:41 ` [PATCH v3 05/13] iommu/arm-smmu-v3: Use the master-owned s1_cfg Michael Shavit
2023-06-14 15:41 ` Michael Shavit [this message]
2023-06-14 15:41 ` [PATCH v3 07/13] iommu/arm-smmu-v3: Keep track of attached ssids Michael Shavit
2023-06-20 10:21   ` kernel test robot
2023-06-14 15:42 ` [PATCH v3 08/13] iommu/arm-smmu-v3: Add helper for atc invalidation Michael Shavit
2023-06-14 15:42 ` [PATCH v3 09/13] iommu/arm-smmu-v3: Implement set_dev_pasid Michael Shavit
2023-06-14 15:42 ` [PATCH v3 10/13] iommu/arm-smmu-v3-sva: Remove bond refcount Michael Shavit
2023-06-14 15:42 ` [PATCH v3 11/13] iommu/arm-smmu-v3-sva: Clean unused iommu_sva Michael Shavit
2023-06-14 15:42 ` [PATCH v3 12/13] iommu/arm-smmu-v3-sva: Remove arm_smmu_bond Michael Shavit
2023-06-14 15:42 ` [PATCH v3 13/13] iommu/arm-smmu-v3-sva: Add check when enabling sva Michael Shavit

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=20230614154304.2860121-7-mshavit@google.com \
    --to=mshavit@google.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.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