All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: Ethan Zhao <haifeng.zhao@linux.intel.com>,
	Eric Badger <ebadger@purestorage.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 8/8] iommu/vt-d: Remove scalabe mode in domain_context_clear_one()
Date: Tue,  5 Mar 2024 20:21:21 +0800	[thread overview]
Message-ID: <20240305122121.211482-9-baolu.lu@linux.intel.com> (raw)
In-Reply-To: <20240305122121.211482-1-baolu.lu@linux.intel.com>

domain_context_clear_one() only handles the context entry teardown in
legacy mode. Remove the scalable mode check in it to avoid dead code.

Remove an unnecessary check in the code as well.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20240305013305.204605-6-baolu.lu@linux.intel.com
---
 drivers/iommu/intel/iommu.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index d682eb6ad4d2..50eb9aed47cc 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2175,9 +2175,6 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
 	struct context_entry *context;
 	u16 did_old;
 
-	if (!iommu)
-		return;
-
 	spin_lock(&iommu->lock);
 	context = iommu_context_addr(iommu, bus, devfn, 0);
 	if (!context) {
@@ -2185,14 +2182,7 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
 		return;
 	}
 
-	if (sm_supported(iommu)) {
-		if (hw_pass_through && domain_type_is_si(info->domain))
-			did_old = FLPT_DEFAULT_DID;
-		else
-			did_old = domain_id_iommu(info->domain, iommu);
-	} else {
-		did_old = context_domain_id(context);
-	}
+	did_old = context_domain_id(context);
 
 	context_clear_entry(context);
 	__iommu_flush_cache(iommu, context, sizeof(*context));
@@ -2203,9 +2193,6 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
 				   DMA_CCMD_MASK_NOBIT,
 				   DMA_CCMD_DEVICE_INVL);
 
-	if (sm_supported(iommu))
-		qi_flush_pasid_cache(iommu, did_old, QI_PC_ALL_PASIDS, 0);
-
 	iommu->flush.flush_iotlb(iommu,
 				 did_old,
 				 0,
-- 
2.34.1


  parent reply	other threads:[~2024-03-05 12:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 12:21 [PATCH 0/8] [PULL REQUEST] iommu/vt-d: Fixes for iommu next Lu Baolu
2024-03-05 12:21 ` [PATCH 1/8] PCI: Make pci_dev_is_disconnected() helper public for other drivers Lu Baolu
2024-03-05 12:21 ` [PATCH 2/8] iommu/vt-d: Don't issue ATS Invalidation request when device is disconnected Lu Baolu
2024-03-05 12:21 ` [PATCH 3/8] iommu/vt-d: Improve ITE fault handling if target device isn't present Lu Baolu
2024-03-05 12:21 ` [PATCH 4/8] iommu: Add static iommu_ops->release_domain Lu Baolu
2024-03-05 12:21 ` [PATCH 5/8] iommu/vt-d: Fix NULL domain on device release Lu Baolu
2024-03-05 12:21 ` [PATCH 6/8] iommu/vt-d: Setup scalable mode context entry in probe path Lu Baolu
2024-03-05 12:21 ` [PATCH 7/8] iommu/vt-d: Remove scalable mode context entry setup from attach_dev Lu Baolu
2024-03-05 12:21 ` Lu Baolu [this message]
2024-03-06 16:36 ` [PATCH 0/8] [PULL REQUEST] iommu/vt-d: Fixes for iommu next Joerg Roedel

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=20240305122121.211482-9-baolu.lu@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ebadger@purestorage.com \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.