#include <xen/config.h>
#include <asm/io.h>
-#include <asm/acpi.h>
#include <xen/acpi.h>
#include <xen/errno.h>
#include <xen/iocap.h>
freeze_domains();
+ acpi_dmar_reinstate();
+
disable_nonboot_cpus();
if ( num_online_cpus() != 1 )
{
cpufreq_add_cpu(0);
microcode_resume_cpu(0);
enable_nonboot_cpus();
+ acpi_dmar_zap();
thaw_domains();
spin_unlock(&pm_lock);
return error;
console_start_sync();
spin_debug_disable();
+ acpi_dmar_reinstate();
+
local_irq_enable();
/* Ensure we are the boot CPU. */
#include <xen/sched.h>
#include <xen/domain_page.h>
#include <xen/iommu.h>
+#include <xen/acpi.h>
#include <asm/fixmap.h>
#include <asm/page.h>
#include <asm/processor.h>
/* acpi_parse_dmar() zaps APCI DMAR signature in TXT heap table */
/* but dom0 will read real table, so must zap it there too */
- dmar_table = NULL;
- acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);
- if ( dmar_table != NULL )
- {
- dmar_table->signature[0] = 'X';
- dmar_table->checksum -= 'X'-'D';
- }
+ acpi_dmar_zap();
return rc;
}
return out;
}
-static int acpi_dmar_reinstate(struct acpi_table_header *table)
-{
- table->signature[0] = 'D';
- table->checksum += 'X'-'D';
- return 0;
-}
-
static void kexec_common_shutdown(void)
{
watchdog_disable();
console_start_sync();
spin_debug_disable();
one_cpu_only();
- acpi_table_parse(ACPI_SIG_DMAR, acpi_dmar_reinstate);
+ acpi_dmar_reinstate();
}
void kexec_crash(void)
{
return parse_dmar_table(acpi_parse_dmar);
}
+
+static struct acpi_table_header *get_dmar(void)
+{
+ struct acpi_table_header *dmar_table = NULL;
+ 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 dmar_table;
+}
+
+void acpi_dmar_reinstate(void)
+{
+ struct acpi_table_header *dmar_table = get_dmar();
+ if ( dmar_table == NULL )
+ return;
+ dmar_table->signature[0] = 'D';
+ dmar_table->checksum += 'X'-'D';
+}
+
+void acpi_dmar_zap(void)
+{
+ struct acpi_table_header *dmar_table = get_dmar();
+ if ( dmar_table == NULL )
+ return;
+ dmar_table->signature[0] = 'X';
+ dmar_table->checksum -= 'X'-'D';
+}
void acpi_reboot(void);
+void acpi_dmar_zap(void);
+void acpi_dmar_reinstate(void);
+
#endif /*_LINUX_ACPI_H*/