Skip to contentSkip to conversation

x86: fix tboot after c/s 23013:65d26504e843 (ACPI cleanup)

PATCH New Jan Beulich 1 participant 1 message Mar 25, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix tboot after c/s 23013:65d26504e843 (ACPI cleanup)

TXT code calls acpi_parse_dmar() with a transient copy of the DMAR table, and hence storing the pointer for later reference was wrong. Obtain the pointer in acpi_dmar_init() instead.

xen/drivers/passthrough/vtd/dmar.c +7 -1
@@ -673,7 +673,6 @@ static int __init acpi_parse_dmar(struct
     u8 dmar_host_address_width;
     int ret = 0;
 
-    dmar_table = table;
     dmar = (struct acpi_table_dmar *)table;
 
     if ( !iommu_enabled )
@@ -762,6 +761,13 @@ out:
 
 int __init acpi_dmar_init(void)
 {
+    unsigned long flags;
+
+    /* Disabling IRQs avoids cross-CPU TLB flush in map_pages_to_xen(). */
+    local_irq_save(flags);
+    acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);
+    local_irq_restore(flags);
+
     return parse_dmar_table(acpi_parse_dmar);
 }
 

TXT code calls acpi_parse_dmar() with a transient copy of the DMAR table, and hence storing the pointer for later reference was wrong. Obtain the pointer in acpi_dmar_init() instead.

xen/drivers/passthrough/vtd/dmar.c +7 -1
@@ -673,7 +673,6 @@ static int __init acpi_parse_dmar(struct
     u8 dmar_host_address_width;
     int ret = 0;
 
-    dmar_table = table;
     dmar = (struct acpi_table_dmar *)table;
 
     if ( !iommu_enabled )
@@ -762,6 +761,13 @@ out:
 
 int __init acpi_dmar_init(void)
 {
+    unsigned long flags;
+
+    /* Disabling IRQs avoids cross-CPU TLB flush in map_pages_to_xen(). */
+    local_irq_save(flags);
+    acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);
+    local_irq_restore(flags);
+
     return parse_dmar_table(acpi_parse_dmar);
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel