aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2015-06-12 06:27:16 -0400
committerJoerg Roedel <jroedel@suse.de>2015-06-16 04:59:34 -0400
commit86080ccc223aabf8d0b85a504f4f06aa88e82fb3 (patch)
tree12ecb1693240725446127943322382fc1844cc82 /drivers/iommu
parentcf484d0e6939ce287e65880ffe48860165fe5cb5 (diff)
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-iommu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index e5a03f84d2f5..b43f04933015 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2763,10 +2763,6 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
2763 int i; 2763 int i;
2764 int ret = 0; 2764 int ret = 0;
2765 2765
2766 ret = si_domain_init(hw);
2767 if (ret)
2768 return -EFAULT;
2769
2770 for_each_pci_dev(pdev) { 2766 for_each_pci_dev(pdev) {
2771 ret = dev_prepare_static_identity_mapping(&pdev->dev, hw); 2767 ret = dev_prepare_static_identity_mapping(&pdev->dev, hw);
2772 if (ret) 2768 if (ret)
@@ -2780,7 +2776,7 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
2780 2776
2781 if (dev->bus != &acpi_bus_type) 2777 if (dev->bus != &acpi_bus_type)
2782 continue; 2778 continue;
2783 2779
2784 adev= to_acpi_device(dev); 2780 adev= to_acpi_device(dev);
2785 mutex_lock(&adev->physical_node_lock); 2781 mutex_lock(&adev->physical_node_lock);
2786 list_for_each_entry(pn, &adev->physical_node_list, node) { 2782 list_for_each_entry(pn, &adev->physical_node_list, node) {
@@ -3114,6 +3110,12 @@ static int __init init_dmars(void)
3114 iommu_identity_mapping |= IDENTMAP_GFX; 3110 iommu_identity_mapping |= IDENTMAP_GFX;
3115#endif 3111#endif
3116 3112
3113 if (iommu_identity_mapping) {
3114 ret = si_domain_init(hw_pass_through);
3115 if (ret)
3116 goto free_iommu;
3117 }
3118
3117 check_tylersburg_isoch(); 3119 check_tylersburg_isoch();
3118 3120
3119 /* 3121 /*