Kdump: Elf core Header generation
RFC PATCH 2/3 Kdump: Elf core Header generation
This patch does following.
* Creates a segment for storing elf headers.
* Creates Elf headers for dump capture.
* Functionality to modify command line internally. (Appending elfcorehdr= and user defined memory map, memap=exactmap).
---
Signed-off-by Vivek Goyal <[email protected]>
---
kexec/arch/i386/Makefile renamed from kexec/arch/i386/Makefile~kexec-tools-crashdump-elf-headers-x86 +1 -0
@@ -9,3 +9,4 @@ KEXEC_C_SRCS+= kexec/arch/i386/kexec-mul KEXEC_C_SRCS+= kexec/arch/i386/kexec-beoboot-x86.c KEXEC_C_SRCS+= kexec/arch/i386/kexec-nbi.c KEXEC_C_SRCS+= kexec/arch/i386/x86-linux-setup.c +KEXEC_C_SRCS+= kexec/arch/i386/crashdump-x86.c
kexec/arch/i386/crashdump-x86.c new file +469 -0
469 lines not on this page · raw message
kexec/arch/i386/crashdump-x86.h renamed from kexec/arch/i386/crashdump-x86.h~kexec-tools-crashdump-elf-headers-x86 +18 -0
@@ -1,6 +1,24 @@#ifndef CRASHDUMP_X86_H #define CRASHDUMP_X86_H +int get_crash_memory_ranges (struct memory_range ** range,int * ranges); +int prepare_crash_memory_elf_headers (struct kexec_info *info,void *buf, +unsigned long size); +int add_memmap (struct memory_range *memmap_p,unsigned long long addr, +size_t size); +int delete_memmap (struct memory_range *memmap_p,unsigned long long addr, +size_t size); +int cmdline_add_memmap (char *cmdline,struct memory_range *memmap_p); +int cmdline_add_elfcorehdr (char *cmdline,unsigned long addr); + +extern struct memory_range crash_reserved_mem; + +#define PAGE_OFFSET 0xc0000000 +#define __pa (x) ((unsigned long)(x)-PAGE_OFFSET) + +#define CRASH_MAX_MEMMAP_NR (KEXEC_MAX_SEGMENTS + 1) +#define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 2) +/* Backup Region, First 640K of System RAM. */ #define BACKUP_START 0x00000000#define BACKUP_END 0x0009ffff
kexec/arch/i386/kexec-elf-x86.c renamed from kexec/arch/i386/kexec-elf-x86.c~kexec-tools-crashdump-elf-headers-x86 +63 -2
95 lines not on this page · raw message
kexec/arch/i386/kexec-x86.c renamed from kexec/arch/i386/kexec-x86.c~kexec-tools-crashdump-elf-headers-x86 +1 -1
@@ -30,9 +30,9 @@#include "../../kexec-elf.h" #include "../../kexec-syscall.h" #include "kexec-x86.h" +#include "crashdump-x86.h" #include <arch/options.h> -#define MAX_MEMORY_RANGES 64#define MAX_LINE 160static struct memory_range memory_range[MAX_MEMORY_RANGES ];
kexec/arch/i386/kexec-x86.h renamed from kexec/arch/i386/kexec-x86.h~kexec-tools-crashdump-elf-headers-x86 +2 -0
@@ -1,6 +1,8 @@#ifndef KEXEC_X86_H #define KEXEC_X86_H +#define MAX_MEMORY_RANGES 64 +extern unsigned char compat_x86_64[];extern uint32_t compat_x86_64_size, compat_x86_64_entry32;
_