Skip to content

Commit 86080cc

Browse files
committed
iommu/vt-d: Allocate si_domain in init_dmars()
This seperates the allocation of the si_domain from its assignment to devices. It makes sure that the iommu=pt case still works in the kdump kernel, when we have to defer the assignment of devices to domains to device driver initialization time. Tested-by: ZhenHua Li <zhen-hual@hp.com> Tested-by: Baoquan He <bhe@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent cf484d0 commit 86080cc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,10 +2763,6 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
27632763
int i;
27642764
int ret = 0;
27652765

2766-
ret = si_domain_init(hw);
2767-
if (ret)
2768-
return -EFAULT;
2769-
27702766
for_each_pci_dev(pdev) {
27712767
ret = dev_prepare_static_identity_mapping(&pdev->dev, hw);
27722768
if (ret)
@@ -2780,7 +2776,7 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
27802776

27812777
if (dev->bus != &acpi_bus_type)
27822778
continue;
2783-
2779+
27842780
adev= to_acpi_device(dev);
27852781
mutex_lock(&adev->physical_node_lock);
27862782
list_for_each_entry(pn, &adev->physical_node_list, node) {
@@ -3114,6 +3110,12 @@ static int __init init_dmars(void)
31143110
iommu_identity_mapping |= IDENTMAP_GFX;
31153111
#endif
31163112

3113+
if (iommu_identity_mapping) {
3114+
ret = si_domain_init(hw_pass_through);
3115+
if (ret)
3116+
goto free_iommu;
3117+
}
3118+
31173119
check_tylersburg_isoch();
31183120

31193121
/*

0 commit comments

Comments
 (0)