diff options
Diffstat (limited to 'kexec')
-rw-r--r-- | kexec/arch/i386/crashdump-x86.c | 4 | ||||
-rw-r--r-- | kexec/arch/ia64/crashdump-ia64.c | 5 | ||||
-rw-r--r-- | kexec/arch/ppc64/crashdump-ppc64.c | 4 | ||||
-rw-r--r-- | kexec/arch/x86_64/crashdump-x86_64.c | 2 | ||||
-rw-r--r-- | kexec/crashdump-elf.c | 11 | ||||
-rw-r--r-- | kexec/crashdump.h | 6 |
6 files changed, 14 insertions, 18 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 1c85a5a..6d33ca4 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -524,13 +524,13 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, if (arch_options.core_header_type == CORE_TYPE_ELF64) { if (crash_create_elf64_headers(info, &elf_info64, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, 1024) < 0) return -1; } else { if (crash_create_elf32_headers(info, &elf_info32, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, 1024) < 0) return -1; } diff --git a/kexec/arch/ia64/crashdump-ia64.c b/kexec/arch/ia64/crashdump-ia64.c index 14e95a6..d565bd1 100644 --- a/kexec/arch/ia64/crashdump-ia64.c +++ b/kexec/arch/ia64/crashdump-ia64.c @@ -232,13 +232,14 @@ int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr, if (crash_create_elf64_headers(info, &elf_info, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, + EFI_PAGE_SIZE) < 0) return -1; elfcorehdr = add_buffer(info, tmp, sz, sz, EFI_PAGE_SIZE, min_base, max_addr, -1); loaded_segments[loaded_segments_num].start = elfcorehdr; - loaded_segments[loaded_segments_num].end = elfcorehdr + size; + loaded_segments[loaded_segments_num].end = elfcorehdr + sz; loaded_segments[loaded_segments_num].reserved = 1; loaded_segments_num++; cmdline_add_elfcorehdr(cmdline, elfcorehdr); diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c index d3231b6..66aa64a 100644 --- a/kexec/arch/ppc64/crashdump-ppc64.c +++ b/kexec/arch/ppc64/crashdump-ppc64.c @@ -344,13 +344,13 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, if (arch_options.core_header_type == CORE_TYPE_ELF64) { if (crash_create_elf64_headers(info, &elf_info64, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, 1024) < 0) return -1; } else { if (crash_create_elf32_headers(info, &elf_info32, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, 1024) < 0) return -1; } diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c index 14b70ea..0dc07c4 100644 --- a/kexec/arch/x86_64/crashdump-x86_64.c +++ b/kexec/arch/x86_64/crashdump-x86_64.c @@ -607,7 +607,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, /* Create elf header segment and store crash image data. */ if (crash_create_elf64_headers(info, &elf_info, crash_memory_range, nr_ranges, - &tmp, &sz) < 0) + &tmp, &sz, 1024) < 0) return -1; /* Hack: With some ld versions (GNU ld version 2.14.90.0.4 20030523), diff --git a/kexec/crashdump-elf.c b/kexec/crashdump-elf.c index e702a53..b8e1f49 100644 --- a/kexec/crashdump-elf.c +++ b/kexec/crashdump-elf.c @@ -27,11 +27,11 @@ do { \ int FUNC(struct kexec_info *info, struct crash_elf_info *elf_info, struct memory_range *range, int ranges, - void **buf, unsigned long *size) + void **buf, unsigned long *size, unsigned long align) { EHDR *elf; PHDR *phdr; - int i, sz, align; + int i, sz; char *bufp; long int nr_cpus = 0; uint64_t notes_addr, notes_len; @@ -72,13 +72,6 @@ int FUNC(struct kexec_info *info, sz += sizeof(PHDR); } - /* - * The kernel command line option memmap= requires 1k granularity, - * therefore we align the size to 1024 here. - */ - - align = 1024; - sz += align - 1; sz &= ~(align - 1); diff --git a/kexec/crashdump.h b/kexec/crashdump.h index 10cffe0..482acb0 100644 --- a/kexec/crashdump.h +++ b/kexec/crashdump.h @@ -27,12 +27,14 @@ struct crash_elf_info { int crash_create_elf32_headers(struct kexec_info *info, struct crash_elf_info *elf_info, struct memory_range *range, int ranges, - void **buf, unsigned long *size); + void **buf, unsigned long *size, + unsigned long align); int crash_create_elf64_headers(struct kexec_info *info, struct crash_elf_info *elf_info, struct memory_range *range, int ranges, - void **buf, unsigned long *size); + void **buf, unsigned long *size, + unsigned long align); int xen_present(void); int xen_get_nr_phys_cpus(void); |