Skip to content

Commit 29e1048

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Update iotlb in nested domain attach
Should call domain_update_iotlb() to update the has_iotlb_device flag of the domain after attaching device to nested domain. Without it, this flag is not set properly and would result in missing device TLB flush. Fixes: 9838f2b ("iommu/vt-d: Set the nested domain to a device") Signed-off-by: Yi Liu <[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 8219853 commit 29e1048

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ static int domain_update_device_node(struct dmar_domain *domain)
396396
return nid;
397397
}
398398

399-
static void domain_update_iotlb(struct dmar_domain *domain);
400-
401399
/* Return the super pagesize bitmap if supported. */
402400
static unsigned long domain_super_pgsize_bitmap(struct dmar_domain *domain)
403401
{
@@ -1218,7 +1216,7 @@ domain_lookup_dev_info(struct dmar_domain *domain,
12181216
return NULL;
12191217
}
12201218

1221-
static void domain_update_iotlb(struct dmar_domain *domain)
1219+
void domain_update_iotlb(struct dmar_domain *domain)
12221220
{
12231221
struct dev_pasid_info *dev_pasid;
12241222
struct device_domain_info *info;

drivers/iommu/intel/iommu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ int qi_submit_sync(struct intel_iommu *iommu, struct qi_desc *desc,
10661066
*/
10671067
#define QI_OPT_WAIT_DRAIN BIT(0)
10681068

1069+
void domain_update_iotlb(struct dmar_domain *domain);
10691070
int domain_attach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu);
10701071
void domain_detach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu);
10711072
void device_block_translation(struct device *dev);

drivers/iommu/intel/nested.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static int intel_nested_attach_dev(struct iommu_domain *domain,
6565
list_add(&info->link, &dmar_domain->devices);
6666
spin_unlock_irqrestore(&dmar_domain->lock, flags);
6767

68+
domain_update_iotlb(dmar_domain);
69+
6870
return 0;
6971
}
7072

0 commit comments

Comments
 (0)