Skip to content

Commit 56ecaf6

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Remove domain parameter for intel_pasid_setup_dirty_tracking()
The only usage of input @Domain is to get the domain id (DID) to flush cache after setting dirty tracking. However, DID can be obtained from the pasid entry. So no need to pass in domain. This can make this helper cleaner when adding the missing dirty tracking for the parent domain, which needs to use the DID of nested domain. Signed-off-by: Yi Liu <[email protected]> Reviewed-by: Joao Martins <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 5e54e86 commit 56ecaf6

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4741,8 +4741,7 @@ static int intel_iommu_set_dirty_tracking(struct iommu_domain *domain,
47414741
goto out_unlock;
47424742

47434743
list_for_each_entry(info, &dmar_domain->devices, link) {
4744-
ret = intel_pasid_setup_dirty_tracking(info->iommu,
4745-
info->domain, info->dev,
4744+
ret = intel_pasid_setup_dirty_tracking(info->iommu, info->dev,
47464745
IOMMU_NO_PASID, enable);
47474746
if (ret)
47484747
goto err_unwind;
@@ -4756,8 +4755,8 @@ static int intel_iommu_set_dirty_tracking(struct iommu_domain *domain,
47564755

47574756
err_unwind:
47584757
list_for_each_entry(info, &dmar_domain->devices, link)
4759-
intel_pasid_setup_dirty_tracking(info->iommu, dmar_domain,
4760-
info->dev, IOMMU_NO_PASID,
4758+
intel_pasid_setup_dirty_tracking(info->iommu, info->dev,
4759+
IOMMU_NO_PASID,
47614760
dmar_domain->dirty_tracking);
47624761
spin_unlock(&dmar_domain->lock);
47634762
return ret;

drivers/iommu/intel/pasid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,
428428
* Set up dirty tracking on a second only or nested translation type.
429429
*/
430430
int intel_pasid_setup_dirty_tracking(struct intel_iommu *iommu,
431-
struct dmar_domain *domain,
432431
struct device *dev, u32 pasid,
433432
bool enabled)
434433
{
@@ -445,7 +444,7 @@ int intel_pasid_setup_dirty_tracking(struct intel_iommu *iommu,
445444
return -ENODEV;
446445
}
447446

448-
did = domain_id_iommu(domain, iommu);
447+
did = pasid_get_domain_id(pte);
449448
pgtt = pasid_pte_get_pgtt(pte);
450449
if (pgtt != PASID_ENTRY_PGTT_SL_ONLY &&
451450
pgtt != PASID_ENTRY_PGTT_NESTED) {

drivers/iommu/intel/pasid.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,
307307
struct dmar_domain *domain,
308308
struct device *dev, u32 pasid);
309309
int intel_pasid_setup_dirty_tracking(struct intel_iommu *iommu,
310-
struct dmar_domain *domain,
311310
struct device *dev, u32 pasid,
312311
bool enabled);
313312
int intel_pasid_setup_pass_through(struct intel_iommu *iommu,

0 commit comments

Comments
 (0)