• Jun'ichi Nomura's avatar
    x86/boot: Ignore NMIs during very early boot · 78a509fb
    Jun'ichi Nomura authored
    When there are two racing NMIs on x86, the first NMI invokes NMI handler and
    the 2nd NMI is latched until IRET is executed.
    
    If panic on NMI and panic kexec are enabled, the first NMI triggers
    panic and starts booting the next kernel via kexec. Note that the 2nd
    NMI is still latched. During the early boot of the next kernel, once
    an IRET is executed as a result of a page fault, then the 2nd NMI is
    unlatched and invokes the NMI handler.
    
    However, NMI handler is not set up at the early stage of boot, which
    results in a boot failure.
    
    Avoid such problems by setting up a NOP handler for early NMIs.
    
    [ mingo: Refined the changelog. ]
    Signed-off-by: default avatarJun'ichi Nomura <junichi.nomura@nec.com>
    Signed-off-by: default avatarDerek Barbosa <debarbos@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul E. McKenney <paulmck@kernel.org>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    78a509fb
idt_handlers_64.S 1.32 KB