From f8454324a060b997b652362fdaa2f01a7c548cc0 Mon Sep 17 00:00:00 2001 From: Yadviga Grigoryeva Date: Fri, 28 Feb 2014 00:49:59 +0400 Subject: [PATCH] separate highmem and lowmem for ppc32 The patch separates highmem and lowmem. Usually highmem and lowmem merges in common segment. Virtual addresses for this segment are invalid because code from crashdump-elf.c set virtual address -1 for lowmem addresses if they share segment with highmem addresses /* HIGMEM has a virtual address of -1 */ if (elf_info->lowmem_limit && (mend > (elf_info->lowmem_limit - 1))) phdr->p_vaddr = -1; The patch locates them in different segments. So lowmem will have the valid virtual address Signed-off-by: Yadviga Grigoryeva --- kexec/arch/ppc/crashdump-powerpc.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/kexec/arch/ppc/crashdump-powerpc.c b/kexec/arch/ppc/crashdump-powerpc.c index c06d310..39a12ca 100644 --- a/kexec/arch/ppc/crashdump-powerpc.c +++ b/kexec/arch/ppc/crashdump-powerpc.c @@ -214,6 +214,34 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges) crash_memory_range[memory_ranges++].end = cend; } +#ifndef CONFIG_PPC64 + /* separate lowmem and highmem in segment */ + if (memory_ranges < crash_max_memory_ranges ) { + int k,l; + for (l=0; l + elf_info32.lowmem_limit) { + /* shift crash_memory_range */ + for (k=memory_ranges; k>l; k--) { + crash_memory_range[k].start + = crash_memory_range[k-1].start; + crash_memory_range[k].end + = crash_memory_range[k-1].end; + crash_memory_range[k].type + = crash_memory_range[k-1].type; + } + memory_ranges++; + crash_memory_range[l].end + = elf_info32.lowmem_limit; + crash_memory_range[l+1].start + = elf_info32.lowmem_limit; + break; + } + } + } +#endif *range = crash_memory_range; *ranges = memory_ranges; -- 1.6.3.3.334.gb7e98.dirty