x86: machine_restart() must not call acpi_dmar_reinstate() twice
authorJan Beulich <jbeulich@suse.com>
Fri, 13 Sep 2013 12:27:34 +0000 (14:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 13 Sep 2013 12:27:34 +0000 (14:27 +0200)
.. as that function is not idempotent (it always alters the table
checksum). The (generally) duplicate call was a result from it being
made before machine_restart() re-invoking itself on the boot CPU.

Considering that no problem arose so far from the table corruption I
doubt that we need to restore the correct table signature on the
reboot path in general. The only case I can see this as potentially
necessary is the tboot one, hence do the call just in that case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/shutdown.c

index 167905a575bd48785a3dd21abf94eecf3335f7b3..6eba2715ad4693547305dc120418978a0008e2f6 100644 (file)
@@ -466,8 +466,6 @@ void machine_restart(unsigned int delay_millisecs)
     console_start_sync();
     spin_debug_disable();
 
-    acpi_dmar_reinstate();
-
     local_irq_enable();
 
     /* Ensure we are the boot CPU. */
@@ -492,7 +490,10 @@ void machine_restart(unsigned int delay_millisecs)
     mdelay(delay_millisecs);
 
     if ( tboot_in_measured_env() )
+    {
+        acpi_dmar_reinstate();
         tboot_shutdown(TB_SHUTDOWN_REBOOT);
+    }
 
     efi_reset_system(reboot_mode != 0);