diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-03-11 00:22:07 -0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-03-11 19:47:32 +1100 |
commit | 05348d6ff899706087c667d276066ac11aebf6bc (patch) | |
tree | 80762131ef8d78ec2bcad67204758d082ae6508a /kexec/arch/i386/crashdump-x86.c | |
parent | a2d9b444eb54029513ad2300466b3cf55dbcd9b5 (diff) |
x86: Fix biarch crashdump setup.
Generate the correct crashdump header for x86_64 kernels
when a 32bit kernel is used.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/i386/crashdump-x86.c')
-rw-r--r-- | kexec/arch/i386/crashdump-x86.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 804dadd..9d37442 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -509,7 +509,7 @@ static struct crash_elf_info elf_info32 = static enum coretype get_core_type(struct kexec_info *info, struct memory_range *range, int ranges) { - if (info->kexec_flags & KEXEC_ARCH_X86_64) + if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64) return CORE_TYPE_ELF64; else { /* fall back to default */ @@ -534,6 +534,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, unsigned long sz, elfcorehdr; int nr_ranges, align = 1024; struct memory_range *mem_range, *memmap_p; + unsigned machine; if (get_crash_memory_ranges(&mem_range, &nr_ranges, info->kexec_flags) < 0) @@ -548,6 +549,12 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, get_core_type(info, mem_range, nr_ranges); } + /* Get the elf architecture of the running kernel */ + machine = EM_386; + if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64) { + machine = EM_X86_64; + } + /* Memory regions which panic kernel can safely use to boot into */ sz = (sizeof(struct memory_range) * (KEXEC_MAX_SEGMENTS + 1)); memmap_p = xmalloc(sz); @@ -571,6 +578,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, /* Create elf header segment and store crash image data. */ if (arch_options.core_header_type == CORE_TYPE_ELF64) { + elf_info64.machine = machine; if (crash_create_elf64_headers(info, &elf_info64, crash_memory_range, nr_ranges, &tmp, &sz, @@ -578,6 +586,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, return -1; } else { + elf_info32.machine = machine; if (crash_create_elf32_headers(info, &elf_info32, crash_memory_range, nr_ranges, &tmp, &sz, |