Commit 86080ccc authored by Joerg Roedel's avatar Joerg Roedel

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: default avatarZhenHua Li <zhen-hual@hp.com>
Tested-by: default avatarBaoquan He <bhe@redhat.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent cf484d0e
...@@ -2763,10 +2763,6 @@ static int __init iommu_prepare_static_identity_mapping(int hw) ...@@ -2763,10 +2763,6 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
int i; int i;
int ret = 0; int ret = 0;
ret = si_domain_init(hw);
if (ret)
return -EFAULT;
for_each_pci_dev(pdev) { for_each_pci_dev(pdev) {
ret = dev_prepare_static_identity_mapping(&pdev->dev, hw); ret = dev_prepare_static_identity_mapping(&pdev->dev, hw);
if (ret) if (ret)
...@@ -3114,6 +3110,12 @@ static int __init init_dmars(void) ...@@ -3114,6 +3110,12 @@ static int __init init_dmars(void)
iommu_identity_mapping |= IDENTMAP_GFX; iommu_identity_mapping |= IDENTMAP_GFX;
#endif #endif
if (iommu_identity_mapping) {
ret = si_domain_init(hw_pass_through);
if (ret)
goto free_iommu;
}
check_tylersburg_isoch(); check_tylersburg_isoch();
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment