iommu/vt-d: Init QI before root entry is allocated
authorJoerg Roedel <jroedel@suse.de>
Fri, 12 Jun 2015 07:14:34 +0000 (09:14 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 16 Jun 2015 08:59:33 +0000 (10:59 +0200)
QI needs to be available when we write the root entry into
hardware because flushes might be necessary after this.

Tested-by: ZhenHua Li <zhen-hual@hp.com>
Tested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c

index 4faec337c0cf419a880090e7872d7dd359c24471..989761c8f01728174b705ba16ad9d3f060ec9ec8 100644 (file)
@@ -2803,6 +2803,8 @@ static int __init init_dmars(void)
        for_each_active_iommu(iommu, drhd) {
                g_iommus[iommu->seq_id] = iommu;
 
+               intel_iommu_init_qi(iommu);
+
                ret = iommu_init_domains(iommu);
                if (ret)
                        goto free_iommu;
@@ -2819,9 +2821,6 @@ static int __init init_dmars(void)
                        hw_pass_through = 0;
        }
 
-       for_each_active_iommu(iommu, drhd)
-               intel_iommu_init_qi(iommu);
-
        if (iommu_pass_through)
                iommu_identity_mapping |= IDENTMAP_ALL;