[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-4.12 v2] xen/iommu: fix iommu_ops initialization



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@xxxxxxxx>
---
 xen/drivers/passthrough/vtd/intremap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c 
b/xen/drivers/passthrough/vtd/intremap.c
index a0663ecd22..838268d772 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -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;
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.