History

iommu/vt-d: Fix RID2PASID setup/teardown failure

The IOMMU driver shares the pasid table for PCI alias devices. When the RID2PASID entry of the shared pasid table has been filled by the first device, the subsequent device will encounter the "DMAR: Setup RID2PASID failed" failure as the pasid entry has already been marked as present. As the result, the IOMMU probing process will be aborted. On the contrary, when any alias device is hot-removed from the system, for example, by writing to /sys/bus/pci/devices/.../remove, the shared RID2PASID will be cleared without any notifications to other devices. As the result, any DMAs from those rest devices are blocked. Sharing pasid table among PCI alias devices could save two memory pages for devices underneath the PCIe-to-PCI bridges. Anyway, considering that those devices are rare on modern platforms that support VT-d in scalable mode and the saved memory is negligible, it's reasonable to remove this part of immature code to make the driver feasible and stable.

Lu Baolu committed 4 years ago

Commit 4140d771 parent 316f92a4 files · +3 −94Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/intel-iommu.h+0−3
@@ -612,7 +612,6 @@ struct intel_iommu { · 611 unmodified lines
612612 struct device_domain_info {
613613 struct list_head link; /* link to domain siblings */
614614 struct list_head global; /* link to global list */
615− struct list_head table; /* link to pasid table */
616615 u32 segment; /* PCI segment number */
617616 u8 bus; /* PCI bus number */
618617 u8 devfn; /* PCI devfn number */
@@ -729,8 +728,6 @@ extern int dmar_ir_support(void); · 110 unmodified lines
729728 void *alloc_pgtable_page(int node);
730729 void free_pgtable_page(void *vaddr);
731730 struct intel_iommu *domain_get_iommu(struct dmar_domain *domain);
732−int for_each_device_domain(int (*fn)(struct device_domain_info *info,
733− void *data), void *data);
734731 void iommu_flush_write_buffer(struct intel_iommu *iommu);
735732 int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev);
736733 struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn);