|
@@ -2509,6 +2509,15 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
|
|
|
list_add(&info->global, &device_domain_list);
|
|
|
if (dev)
|
|
|
dev->archdata.iommu = info;
|
|
|
+
|
|
|
+ if (dev && dev_is_pci(dev) && info->pasid_supported) {
|
|
|
+ ret = intel_pasid_alloc_table(dev);
|
|
|
+ if (ret) {
|
|
|
+ __dmar_remove_one_dev_info(info);
|
|
|
+ spin_unlock_irqrestore(&device_domain_lock, flags);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ }
|
|
|
spin_unlock_irqrestore(&device_domain_lock, flags);
|
|
|
|
|
|
if (dev && domain_context_mapping(domain, dev)) {
|
|
@@ -4843,6 +4852,7 @@ static void __dmar_remove_one_dev_info(struct device_domain_info *info)
|
|
|
if (info->dev) {
|
|
|
iommu_disable_dev_iotlb(info);
|
|
|
domain_context_clear(iommu, info->dev);
|
|
|
+ intel_pasid_free_table(info->dev);
|
|
|
}
|
|
|
|
|
|
unlink_domain_info(info);
|