Skip to contentSkip to conversation

xen/iommu: fix iommu_ops initialization

PATCH In review Juergen Gross 3 participants 4 messages Feb 1, 2019 – Feb 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
 xen/drivers/passthrough/vtd/intremap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/drivers/passthrough/vtd/intremap.c +2 -2
index a0663ecd22..838268d772 100644
@@ -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;
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 11 lines · Juergen Gross

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.

And of course:

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v2 1/1
#2 lore raw
In reply to Juergen Gross
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 01.02.19 at 17:29, <[email protected]> wrote:

Commit 32a5ea00ec75ef53e ("IOMMU/x86: remove indirection from certain IOMMU hook accesses") introduced iommu_ops initialized at boot time with data declared as __initconstrel.

Quoted 7 lines

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v2 1/1
#3 lore raw
In reply to Juergen Gross
Quoted 8 lines

From: Juergen Gross [mailto:[email protected]]
Sent: Saturday, February 2, 2019 12:30 AM

Commit 32a5ea00ec75ef53e ("IOMMU/x86: remove indirection from certain
IOMMU hook accesses") introduced iommu_ops initialized at boot time with data declared as __initconstrel.

Quoted 7 lines

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel