[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250530091325.694456-1-wei.w.wang@intel.com>
Date: Fri, 30 May 2025 17:13:25 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: baolu.lu@...ux.intel.com,
kevin.tian@...el.com,
yi.l.liu@...el.com,
dwmw2@...radead.org,
jroedel@...e.de,
linux-kernel@...r.kernel.org,
iommu@...ts.linux.dev
Cc: Wei Wang <wei.w.wang@...el.com>
Subject: [PATCH v1] iommu/vt-d: Remove dead code in intel_iommu_domain_alloc_paging_flags()
When dirty_tracking is enabled, first_stage is set to false to use the
second stage translation table. dmar_domain->use_first_level, which is
assigned from first_page, is guaranteed to be false when the execution
reaches the location of the code to be removed by this patch. So the
handling for dmar_domain->use_first_level being true there will never
be executed.
Signed-off-by: Wei Wang <wei.w.wang@...el.com>
---
drivers/iommu/intel/iommu.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index cb0b993bebb4..1145567c60f9 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3418,13 +3418,8 @@ intel_iommu_domain_alloc_paging_flags(struct device *dev, u32 flags,
spin_lock_init(&dmar_domain->s1_lock);
}
- if (dirty_tracking) {
- if (dmar_domain->use_first_level) {
- iommu_domain_free(domain);
- return ERR_PTR(-EOPNOTSUPP);
- }
+ if (dirty_tracking)
domain->dirty_ops = &intel_dirty_ops;
- }
return domain;
}
base-commit: e0797d3b91de75b6c95b4a0e0649ebd4aac1d9d1
--
2.43.0
Powered by blists - more mailing lists