From 508c7d45e270bfda0a68fd349070af873f0984bc Mon Sep 17 00:00:00 2001 From: David Daney Date: Thu, 12 Oct 2017 14:02:28 -0700 Subject: kexec-tools: mips: Try to include bss in kernel vmcore file. The kernel message buffers, as well as a lot of other useful data reside in the bss section. Without this vmcore-dmesg cannot work, and debugging with a core dump is much more difficult. Try to add the /proc/iomem "Kernel bss" section to vmcore. If it is not found, just do what we used to do and use "Kernel data" instead. Signed-off-by: David Daney Signed-off-by: Simon Horman --- kexec/arch/mips/crashdump-mips.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c index 22fc38e..9ab041a 100644 --- a/kexec/arch/mips/crashdump-mips.c +++ b/kexec/arch/mips/crashdump-mips.c @@ -74,7 +74,10 @@ static int get_kernel_vaddr_and_size(struct crash_elf_info *elf_info, elf_info->kern_vaddr_start = elf_info->kern_paddr_start | start_offset; - if (parse_iomem_single("Kernel data\n", NULL, &end) == 0) { + /* If "Kernel bss" exists, the kernel ends there, else fall + * through and say that it ends at "Kernel data" */ + if (parse_iomem_single("Kernel bss\n", NULL, &end) == 0 || + parse_iomem_single("Kernel data\n", NULL, &end) == 0) { elf_info->kern_size = end - elf_info->kern_paddr_start; dbgprintf("kernel_vaddr= 0x%llx paddr %llx\n", elf_info->kern_vaddr_start, -- cgit