• Guilherme G. Piccoli's avatar
    powerpc/setup: Refactor/untangle panic notifiers · e2aa34ce
    Guilherme G. Piccoli authored
    The panic notifiers infrastructure is a bit limited in the scope of
    the callbacks - basically every kind of functionality is dropped
    in a list that runs in the same point during the kernel panic path.
    This is not really on par with the complexities and particularities
    of architecture / hypervisors' needs, and a refactor is ongoing.
    
    As part of this refactor, it was observed that powerpc has 2 notifiers,
    with mixed goals: one is just a KASLR offset dumper, whereas the other
    aims to hard-disable IRQs (necessary on panic path), warn firmware of
    the panic event (fadump) and run low-level platform-specific machinery
    that might stop kernel execution and never come back.
    
    Clearly, the 2nd notifier has opposed goals: disable IRQs / fadump
    should run earlier while low-level platform actions should
    run late since it might not even return. Hence, this patch decouples
    the notifiers splitting them in three:
    
    - First one is responsible for hard-disable IRQs and fadump,
    should run early;
    
    - The kernel KASLR offset dumper is really an informative notifier,
    harmless and may run at any moment in the panic path;
    
    - The last notifier should run last, since it aims to perform
    low-level actions for specific platforms, and might never return.
    It is also only registered for 2 platforms, pseries and ps3.
    
    The patch better documents the notifiers and clears the code too,
    also removing a useless header.
    
    Currently no functionality change should be observed, but after
    the planned panic refactor we should expect more panic reliability
    with this patch.
    Signed-off-by: default avatarGuilherme G. Piccoli <gpiccoli@igalia.com>
    Reviewed-by: default avatarHari Bathini <hbathini@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20220427224924.592546-9-gpiccoli@igalia.com
    e2aa34ce
setup-common.c 23.8 KB