From 2f2aa1af0325ee974ef2526cef1a2546a9923281 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Thu, 27 Jul 2006 15:13:05 -0700 Subject: kexec-tools: i386 backup region naming convention fix On Thu, Jul 27, 2006 at 12:32:56PM -0600, Eric W. Biederman wrote: > > I have found a couple of moments and have been able to > catch up with most of the backlog of patches for kexec-tools. > There are several details I need to follow up on, and there is > some testing I want to do to make certain everything is working. > > The primary kexec-tools archive is: > git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools.git > > An archive to hold versions before 1.101 is at: > git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-historic.git > > So far I have all version in there since 1.0 except 1.9, 1.92, and 1.93 > if someone happens to have a copy point me at it and I will update the > history. > > Patches that hang out in quilt for a while can be annoying to import > into git because their authorship information is not stored in an > unambiguous way. git is general is much stricter about the format > it's meta-data information is stored in. > > Maneesh in kdump10 there were two patches in particular that I have > not sorted out their who wrote them. If you could help me sort that > out I would appreciate it. > > ppc64-initrd-option.patch > ppc64-kdump-device_tree-sort.patch > > Before I make a release here is my list of things I intend to look at: > - Why we have defined the location of the crash backup region twice. Hi Eric, Are you referring to BACKUP_REGION_START and BACKUP_START declarations? I am not sure why did I do that, may be somehow I thought that purgatory code is not sharing the header files with main kexec code base. Please have a look at the patch attached for i386. If this looks fine, I shall generate the patches for x86_64 and ppc64 too. Thanks & Regards Vivek Signed-off-by: Vivek Goyal --- kexec/arch/i386/crashdump-x86.c | 8 ++++---- kexec/arch/i386/crashdump-x86.h | 7 ++++--- purgatory/arch/i386/crashdump_backup.c | 8 +++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 03995d8..b286527 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -533,7 +533,7 @@ static int prepare_crash_memory_elf64_headers(struct kexec_info *info, bufp += sizeof(Elf64_Phdr); phdr->p_type = PT_LOAD; phdr->p_flags = PF_R|PF_W|PF_X; - if (mstart == BACKUP_START && mend == BACKUP_END) + if (mstart == BACKUP_SRC_START && mend == BACKUP_SRC_END) phdr->p_offset = info->backup_start; else phdr->p_offset = mstart; @@ -628,7 +628,7 @@ static int prepare_crash_memory_elf32_headers(struct kexec_info *info, bufp += sizeof(Elf32_Phdr); phdr->p_type = PT_LOAD; phdr->p_flags = PF_R|PF_W|PF_X; - if (mstart == BACKUP_START && mend == BACKUP_END) + if (mstart == BACKUP_SRC_START && mend == BACKUP_SRC_END) phdr->p_offset = info->backup_start; else phdr->p_offset = mstart; @@ -667,12 +667,12 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, sz = (sizeof(struct memory_range) * (KEXEC_MAX_SEGMENTS + 1)); memmap_p = xmalloc(sz); memset(memmap_p, 0, sz); - add_memmap(memmap_p, BACKUP_START, BACKUP_SIZE); + add_memmap(memmap_p, BACKUP_SRC_START, BACKUP_SRC_SIZE); sz = crash_reserved_mem.end - crash_reserved_mem.start +1; add_memmap(memmap_p, crash_reserved_mem.start, sz); /* Create a backup region segment to store backup data*/ - sz = (BACKUP_SIZE + align - 1) & ~(align - 1); + sz = (BACKUP_SRC_SIZE + align - 1) & ~(align - 1); tmp = xmalloc(sz); memset(tmp, 0, sz); info->backup_start = add_buffer(info, tmp, sz, sz, align, diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h index de6c248..bb6ceb9 100644 --- a/kexec/arch/i386/crashdump-x86.h +++ b/kexec/arch/i386/crashdump-x86.h @@ -1,6 +1,7 @@ #ifndef CRASHDUMP_X86_H #define CRASHDUMP_X86_H +struct kexec_info; int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline, unsigned long max_addr, unsigned long min_base); @@ -14,8 +15,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline, #define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 2) /* Backup Region, First 640K of System RAM. */ -#define BACKUP_START 0x00000000 -#define BACKUP_END 0x0009ffff -#define BACKUP_SIZE (BACKUP_END - BACKUP_START + 1) +#define BACKUP_SRC_START 0x00000000 +#define BACKUP_SRC_END 0x0009ffff +#define BACKUP_SRC_SIZE (BACKUP_SRC_END - BACKUP_SRC_START + 1) #endif /* CRASHDUMP_X86_H */ diff --git a/purgatory/arch/i386/crashdump_backup.c b/purgatory/arch/i386/crashdump_backup.c index 39a1946..c619446 100644 --- a/purgatory/arch/i386/crashdump_backup.c +++ b/purgatory/arch/i386/crashdump_backup.c @@ -20,9 +20,7 @@ #include #include - -#define BACKUP_REGION_SOURCE 0x00000000 -#define BACKUP_REGION_SIZE 0xa0000 +#include "../../../kexec/arch/i386/crashdump-x86.h" /* Backup region start gets set after /proc/iomem has been parsed. */ /* We reuse the same code for x86_64 also so changing backup_start to @@ -37,10 +35,10 @@ void crashdump_backup_memory(void) { void *dest, *src; - src = (void *) BACKUP_REGION_SOURCE; + src = (void *) BACKUP_SRC_START; if (backup_start) { dest = (void *)(backup_start); - memcpy(dest, src, BACKUP_REGION_SIZE); + memcpy(dest, src, BACKUP_SRC_SIZE); } } -- cgit