Skip to content

Commit 80ca79f

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Remove scalabe mode in domain_context_clear_one()
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 <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent a016e53 commit 80ca79f

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,24 +2124,14 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
21242124
struct context_entry *context;
21252125
u16 did_old;
21262126

2127-
if (!iommu)
2128-
return;
2129-
21302127
spin_lock(&iommu->lock);
21312128
context = iommu_context_addr(iommu, bus, devfn, 0);
21322129
if (!context) {
21332130
spin_unlock(&iommu->lock);
21342131
return;
21352132
}
21362133

2137-
if (sm_supported(iommu)) {
2138-
if (hw_pass_through && domain_type_is_si(info->domain))
2139-
did_old = FLPT_DEFAULT_DID;
2140-
else
2141-
did_old = domain_id_iommu(info->domain, iommu);
2142-
} else {
2143-
did_old = context_domain_id(context);
2144-
}
2134+
did_old = context_domain_id(context);
21452135

21462136
context_clear_entry(context);
21472137
__iommu_flush_cache(iommu, context, sizeof(*context));
@@ -2152,9 +2142,6 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
21522142
DMA_CCMD_MASK_NOBIT,
21532143
DMA_CCMD_DEVICE_INVL);
21542144

2155-
if (sm_supported(iommu))
2156-
qi_flush_pasid_cache(iommu, did_old, QI_PC_ALL_PASIDS, 0);
2157-
21582145
iommu->flush.flush_iotlb(iommu,
21592146
did_old,
21602147
0,

0 commit comments

Comments
 (0)