1. 23 May, 2021 1 commit
    • Jisheng Zhang's avatar
      riscv: kexec: Fix W=1 build warnings · bab0d47c
      Jisheng Zhang authored
      
      
      Fixes the following W=1 build warning(s):
      
      In file included from include/linux/kexec.h:28,
                       from arch/riscv/kernel/machine_kexec.c:7:
      arch/riscv/include/asm/kexec.h:45:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
         45 | const extern unsigned char riscv_kexec_relocate[];
            | ^~~~~
      arch/riscv/include/asm/kexec.h:46:1: warning: ‘extern’ is not at beginning of declaration [-Wold-style-declaration]
         46 | const extern unsigned int riscv_kexec_relocate_size;
            | ^~~~~
      arch/riscv/kernel/machine_kexec.c:125:6: warning: no previous prototype for ‘machine_shutdown’ [-Wmissing-prototypes]
        125 | void machine_shutdown(void)
            |      ^~~~~~~~~~~~~~~~
      arch/riscv/kernel/machine_kexec.c:147:1: warning: no previous prototype for ‘machine_crash_shutdown’ [-Wmissing-prototypes]
        147 | machine_crash_shutdown(struct pt_regs *regs)
            | ^~~~~~~~~~~~~~~~~~~~~~
      arch/riscv/kernel/machine_kexec.c:23: warning: Function parameter or member 'image' not described in 'kexec_image_info'
      arch/riscv/kernel/machine_kexec.c:53: warning: Function parameter or member 'image' not described in 'machine_kexec_prepare'
      arch/riscv/kernel/machine_kexec.c:114: warning: Function parameter or member 'image' not described in 'machine_kexec_cleanup'
      arch/riscv/kernel/machine_kexec.c:148: warning: Function parameter or member 'regs' not described in 'machine_crash_shutdown'
      arch/riscv/kernel/machine_kexec.c:167: warning: Function parameter or member 'image' not described in 'machine_kexec'
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      bab0d47c
  2. 26 Apr, 2021 2 commits
    • Nick Kossifidis's avatar
      RISC-V: Add kdump support · e53d2818
      Nick Kossifidis authored
      
      
      This patch adds support for kdump, the kernel will reserve a
      region for the crash kernel and jump there on panic. In order
      for userspace tools (kexec-tools) to prepare the crash kernel
      kexec image, we also need to expose some information on
      /proc/iomem for the memory regions used by the kernel and for
      the region reserved for crash kernel. Note that on userspace
      the device tree is used to determine the system's memory
      layout so the "System RAM" on /proc/iomem is ignored.
      
      I tested this on riscv64 qemu and works as expected, you may
      test it by triggering a crash through /proc/sysrq_trigger:
      
      echo c > /proc/sysrq_trigger
      Signed-off-by: default avatarNick Kossifidis <mick@ics.forth.gr>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      e53d2818
    • Nick Kossifidis's avatar
      RISC-V: Add kexec support · fba8a867
      Nick Kossifidis authored
      
      
      This patch adds support for kexec on RISC-V. On SMP systems it depends
      on HOTPLUG_CPU in order to be able to bring up all harts after kexec.
      It also needs a recent OpenSBI version that supports the HSM extension.
      I tested it on riscv64 QEMU on both an smp and a non-smp system.
      Signed-off-by: default avatarNick Kossifidis <mick@ics.forth.gr>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      fba8a867