summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2006-11-16 12:43:31 -0500
committerSimon Horman <horms@verge.net.au>2006-11-20 10:40:18 +0900
commit37b8875625334156fc0a6e521d44c89d119d56dc (patch)
tree0dd6f24719628157730ea4215f0ab1181269303d
parent4e74957bef2f2cd3692b0c4f40deb589cecd673c (diff)
kexec-tools: Drop hardcoding the kernel start addr to 2MB (x86_64)
o Drop the code which was hardcoding the kernel start addr to 2MB. It broke with older kernels where kernel has been compiled for a different physical addr using CONFIG_PHYSICAL_START. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Broken out from "Don't create hardcoded PT_LOAD header (x86_64)" patch. Signed off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/x86_64/crashdump-x86_64.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c
index 2b8c3fc..ae5d5d0 100644
--- a/kexec/arch/x86_64/crashdump-x86_64.c
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
@@ -40,7 +40,7 @@
/* Forward Declaration. */
static int exclude_crash_reserve_region(int *nr_ranges);
-#define KERN_VADDR_ALIGN 0x200000 /* 2MB */
+#define KERN_VADDR_ALIGN 0x100000 /* 1MB */
/* Read kernel physical load addr from /proc/iomem (Kernel Code) and
* store in kexec_info */
@@ -84,24 +84,6 @@ static int get_kernel_paddr(struct kexec_info *info)
return -1;
}
-/* Hardcoding kernel virtual address and size. While writting
- * this patch vanilla kernel is compiled for addr 2MB. Anybody
- * using kernel older than that which was compiled for 1MB
- * physical addr, use older version of kexec-tools. This function
- * is there just for backward compatibility reasons and we should
- * get rid of it at some point of time.
- */
-
-static int hardcode_kernel_vaddr_size(struct kexec_info *info)
-{
- fprintf(stderr, "Warning: Hardcoding kernel virtual addr and size\n");
- info->kern_vaddr_start = __START_KERNEL_map + 0x200000;
- info->kern_size = KERNEL_TEXT_SIZE - 0x200000;
- fprintf(stderr, "Warning: virtual addr = 0x%lx size = 0x%lx\n",
- info->kern_vaddr_start, info->kern_size);
- return 0;
-}
-
/* Retrieve info regarding virtual address kernel has been compiled for and
* size of the kernel from /proc/kcore. Current /proc/kcore parsing from
* from kexec-tools fails because of malformed elf notes. A kernel patch has
@@ -137,8 +119,7 @@ static int get_kernel_vaddr_and_size(struct kexec_info *info)
result = build_elf_core_info(buf, size, &ehdr, elf_flags);
if (result < 0) {
fprintf(stderr, "ELF core (kcore) parse failed\n");
- hardcode_kernel_vaddr_size(info);
- return 0;
+ return -1;
}
/* Traverse through the Elf headers and find the region where