• Michael Ellerman's avatar
    powerpc/nmi: Add an API for sending "safe" NMIs · 6ba55716
    Michael Ellerman authored
    Currently the options we have for sending NMIs are not necessarily
    safe, that is they can potentially interrupt a CPU in a
    non-recoverable region of code, meaning the kernel must then panic().
    
    But we'd like to use smp_send_nmi_ipi() to do cross-CPU calls in
    situations where we don't want to risk a panic(), because it doesn't
    have the requirement that interrupts must be enabled like
    smp_call_function().
    
    So add an API for the caller to indicate that it wants to use the NMI
    infrastructure, but doesn't want to do anything "unsafe".
    
    Currently that is implemented by not actually calling cause_nmi_ipi(),
    instead falling back to an IPI. In future we can pass the safe
    parameter down to cause_nmi_ipi() and the individual backends can
    potentially take it into account before deciding what to do.
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
    6ba55716
smp.h 6.23 KB