[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging-4.9] x86/boot: enable NMIs after traps init



commit e61a7cb5dc5f77be0b42b1b254f744c759d2eadc
Author:     Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
AuthorDate: Mon Nov 5 15:20:45 2018 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 5 15:20:45 2018 +0100

    x86/boot: enable NMIs after traps init
    
    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@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 072e054359a4d4a4f6c3fa09585667472c4f0f1d
    master date: 2018-10-23 12:33:54 +0100
---
 xen/arch/x86/cpu/common.c | 3 +++
 xen/arch/x86/setup.c      | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 9f84c7eb16..68ba80cfb6 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -753,6 +753,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)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 79babe32a6..bf5ed1fd33 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -675,6 +675,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";
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.9

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.