]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
iommu: fix iommu_ops initialization
authorJuergen Gross <jgross@suse.com>
Tue, 12 Feb 2019 10:54:07 +0000 (11:54 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Feb 2019 10:54:07 +0000 (11:54 +0100)
Commit 32a5ea00ec75ef53e ("IOMMU/x86: remove indirection from certain
IOMMU hook accesses") introduced iommu_ops initialized at boot time
with data declared as __initconstrel.

On Intel systems there is another path where iommu_ops is initialized
and this path is relevant on resume after returning from system suspend.
As the initialization data is no longer accessible in this case that
second initialization must be dropped in case the system isn't just
booting.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/drivers/passthrough/vtd/intremap.c

index a0663ecd22389323c840605ff826ca2e1d9f261d..838268d7725d778ec16808199797cd51794a2f89 100644 (file)
@@ -893,12 +893,12 @@ int iommu_enable_x2apic_IR(void)
 
         if ( !platform_supports_x2apic() )
             return -ENXIO;
+
+        iommu_ops = intel_iommu_ops;
     }
     else if ( !x2apic_enabled )
         return -EOPNOTSUPP;
 
-    iommu_ops = intel_iommu_ops;
-
     for_each_drhd_unit ( drhd )
     {
         iommu = drhd->iommu;