Skip to content

RFC Initial implementation of kdump for ARM

Mika Westerberg linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10arm: kdump: reserve memory for crashkernelarch/arm/kernel/setup.c+51 -00 replies
2/10arm: kdump: implement crash_setup_regs()arch/arm/include/asm/kexec.h+32 -31 reply
2/10arm: kdump: implement crash_setup_regs()+0 -00 replies
3/10arm: kdump: implement machine_crash_shutdown()arch/arm/kernel/machine_kexec.c+4 -00 replies
4/10arm: kdump: skip indirection page when crashingarch/arm/kernel/relocate_kernel.S+6 -00 replies
5/10arm: kdump: make kexec work in interrupt contextarch/arm/mm/mmu.c+6 -41 reply
6/10arm: kdump: implement copy_oldmem_page()arch/arm/kernel/Makefile arch/arm/kernel/crash_dump.c+83 -00 replies
7/10arm: allow passing an ELF64 header to elf_check_arch()arch/arm/include/asm/elf.h arch/arm/kernel/elf.c+6 -42 replies
7/10arm: allow passing an ELF64 header to elf_check_arch()+0 -00 replies
7/10arm: allow passing an ELF64 header to elf_check_arch()+0 -01 reply
8/10arm: kdump: add support for elfcorehdr= parameterarch/arm/kernel/setup.c+25 -00 replies
9/10arm: implement reserve memory early parameterarch/arm/include/asm/setup.h arch/arm/kernel/setup.c arch/arm/mm/init.c+43 -81 reply
9/10arm: implement reserve memory early parameter+0 -00 replies
9/10arm: implement reserve memory early parameterarch/arm/include/asm/memory.h arch/arm/kernel/setup.c+7 -20 replies
10/10arm: kdump: add CONFIG_CRASH_DUMP Kconfig optionarch/arm/Kconfig arch/arm/Makefile+21 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/10] Initial implementation of kdump for ARM

Hello,

This series implements initial support for crashdumps on ARM. Mostly this stuff is adapted from other architectures (namely x86). I've been testing this on my N900 which is OMAP3430 based. I've used LKDTM module to crash the kernel in different places.

This works as follows (see also Documentation/kdump/kdump.txt):

1. Memory is reserved for the dump capture kernel by using kernel command line option: crashkernel=size at start
2. Userspace tool prepares vmcore header based on /proc/iomem and passes this and the dump capture kernel using kexec system call. We also reserve primary kernel memory by passing mem=size$start options to the dump capture kernel.
3. When crash happens, primary kernel saves current machine state and passes control to the dump capture kernel
4. Dump capture kernel makes /proc/vmcore available to userspace which can use it as it likes (for example copying it to some media etc.).

I also have rough modifications for kexec-tools which makes it possible to load the dump capture kernel and related information. I've planned to clean those and send them to kexec mailing list after this kernel part is finished. I also have some gdb macros adapted from Documentation/kdump/gdbmacros.txt that work on ARM kernel crashdumps, in case someone is interested.

When ARM switches to use LMB, some of the patches that reserve bootmem need to be reworked.

Note that these probably don't work with SMP systems (I don't have such hardware available).

I would really appreciate any comments and suggestions.

Thanks,
MW

Mika Westerberg (10):
arm: kdump: reserve memory for crashkernel
arm: kdump: implement crash_setup_regs()
arm: kdump: implement machine_crash_shutdown()
arm: kdump: skip indirection page when crashing
arm: kdump: make kexec work in interrupt context
arm: kdump: implement copy_oldmem_page()
arm: allow passing an ELF64 header to elf_check_arch()
arm: kdump: add support for elfcorehdr= parameter
arm: implement reserve memory early parameter
arm: kdump: add CONFIG_CRASH_DUMP Kconfig option

 arch/arm/Kconfig                  |   11 ++++
 arch/arm/Makefile                 |   10 ++++
 arch/arm/include/asm/elf.h        |    4 +-
 arch/arm/include/asm/kexec.h      |   35 ++++++++++++-
 arch/arm/include/asm/setup.h      |    4 ++
 arch/arm/kernel/Makefile          |    1 +
 arch/arm/kernel/crash_dump.c      |   82 +++++++++++++++++++++++++++++++
 arch/arm/kernel/elf.c             |    6 ++-
 arch/arm/kernel/machine_kexec.c   |    4 ++
 arch/arm/kernel/relocate_kernel.S |    6 ++
 arch/arm/kernel/setup.c           |   98 ++++++++++++++++++++++++++++++++++--
 arch/arm/mm/init.c                |   25 +++++++++-
 arch/arm/mm/mmu.c                 |   10 ++--
 13 files changed, 277 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm/kernel/crash_dump.c