• Paul Burton's avatar
    MIPS: Call dump_stack() from show_regs() · 6048701d
    Paul Burton authored
    BugLink: https://bugs.launchpad.net/bugs/1790884
    
    commit 5a267832 upstream.
    
    The generic nmi_cpu_backtrace() function calls show_regs() when a struct
    pt_regs is available, and dump_stack() otherwise. If we were to make use
    of the generic nmi_cpu_backtrace() with MIPS' current implementation of
    show_regs() this would mean that we see only register data with no
    accompanying stack information, in contrast with our current
    implementation which calls dump_stack() regardless of whether register
    state is available.
    
    In preparation for making use of the generic nmi_cpu_backtrace() to
    implement arch_trigger_cpumask_backtrace(), have our implementation of
    show_regs() call dump_stack() and drop the explicit dump_stack() call in
    arch_dump_stack() which is invoked by arch_trigger_cpumask_backtrace().
    
    This will allow the output we produce to remain the same after a later
    patch switches to using nmi_cpu_backtrace(). It may mean that we produce
    extra stack output in other uses of show_regs(), but this:
    
      1) Seems harmless.
      2) Is good for consistency between arch_trigger_cpumask_backtrace()
         and other users of show_regs().
      3) Matches the behaviour of the ARM & PowerPC architectures.
    
    Marked for stable back to v4.9 as a prerequisite of the following patch
    "MIPS: Call dump_stack() from show_regs()".
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Patchwork: https://patchwork.linux-mips.org/patch/19596/
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Huacai Chen <chenhc@lemote.com>
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org # v4.9+
    Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
    Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
    6048701d
traps.c 57.8 KB