]> xenbits.xensource.com Git - xen.git/commitdiff
x86/boot: enable NMIs after traps init
authorSergey Dyasli <sergey.dyasli@citrix.com>
Mon, 5 Nov 2018 15:16:19 +0000 (16:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 5 Nov 2018 15:16:19 +0000 (16:16 +0100)
In certain scenarios, NMIs might be disabled during Xen boot process.
Such situation will cause alternative_instructions() to:

    panic("Timed out waiting for alternatives self-NMI to hit\n");

This bug was originally seen when using Tboot to boot Xen 4.11

To prevent this from happening, enable NMIs during cpu_init() and
during __start_xen() for BSP.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 072e054359a4d4a4f6c3fa09585667472c4f0f1d
master date: 2018-10-23 12:33:54 +0100

xen/arch/x86/cpu/common.c
xen/arch/x86/setup.c

index 81487cb2e6334d37f536e2a126e49e67853ccc2e..3fbb7d8ec3ce84e2066fb789c4b4b15fc8d90375 100644 (file)
@@ -748,6 +748,9 @@ void cpu_init(void)
 #define CD(register) asm volatile ( "mov %0,%%db" #register : : "r"(0UL) );
        CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
 #undef CD
+
+       /* Enable NMIs.  Our loader (e.g. Tboot) may have left them disabled. */
+       enable_nmis();
 }
 
 void cpu_uninit(unsigned int cpu)
index 1050127c25365d7f461b077d7a56d913e36da014..550435cf33ebdb100832fc1e0e37f02a12afd9a7 100644 (file)
@@ -683,6 +683,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     /* Full exception support from here on in. */
 
+    /* Enable NMIs.  Our loader (e.g. Tboot) may have left them disabled. */
+    enable_nmis();
+
     loader = (mbi->flags & MBI_LOADERNAME)
         ? (char *)__va(mbi->boot_loader_name) : "unknown";