Skip to content
  • Hidehiro Kawai's avatar
    panic: change nmi_panic from macro to function · ebc41f20
    Hidehiro Kawai authored
    Commit 1717f209 ("panic, x86: Fix re-entrance problem due to panic
    on NMI") and commit 58c5661f
    
     ("panic, x86: Allow CPUs to save
    registers even if looping in NMI context") introduced nmi_panic() which
    prevents concurrent/recursive execution of panic().  It also saves
    registers for the crash dump on x86.
    
    However, there are some cases where NMI handlers still use panic().
    This patch set partially replaces them with nmi_panic() in those cases.
    
    Even this patchset is applied, some NMI or similar handlers (e.g.  MCE
    handler) continue to use panic().  This is because I can't test them
    well and actual problems won't happen.  For example, the possibility
    that normal panic and panic on MCE happen simultaneously is very low.
    
    This patch (of 3):
    
    Convert nmi_panic() to a proper function and export it instead of
    exporting internal implementation details to modules, for obvious
    reasons.
    
    Signed-off-by: default avatarHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
    Acked-by: default avatarBorislav Petkov <bp@suse.de>
    Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Cc: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
    Cc: Javi Merino <javi.merino@arm.com>
    Cc: Gobinda Charan Maji <gobinda.cemk07@gmail.com>
    Cc: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
    Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
    Cc: Tejun Heo <tj@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ebc41f20