diff options
-rw-r--r-- | Documentation/kdump/kdump.txt | 13 | ||||
-rw-r--r-- | arch/arm/kernel/setup.c | 29 |
2 files changed, 32 insertions, 10 deletions
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index bc4bd5a44b88..88ff63d5fde3 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -263,12 +263,6 @@ The syntax is: | |||
263 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset] | 263 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset] |
264 | range=start-[end] | 264 | range=start-[end] |
265 | 265 | ||
266 | Please note, on arm, the offset is required. | ||
267 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...]@offset | ||
268 | range=start-[end] | ||
269 | |||
270 | 'start' is inclusive and 'end' is exclusive. | ||
271 | |||
272 | For example: | 266 | For example: |
273 | 267 | ||
274 | crashkernel=512M-2G:64M,2G-:128M | 268 | crashkernel=512M-2G:64M,2G-:128M |
@@ -307,10 +301,9 @@ Boot into System Kernel | |||
307 | on the memory consumption of the kdump system. In general this is not | 301 | on the memory consumption of the kdump system. In general this is not |
308 | dependent on the memory size of the production system. | 302 | dependent on the memory size of the production system. |
309 | 303 | ||
310 | On arm, use "crashkernel=Y@X". Note that the start address of the kernel | 304 | On arm, the use of "crashkernel=Y@X" is no longer necessary; the |
311 | will be aligned to 128MiB (0x08000000), so if the start address is not then | 305 | kernel will automatically locate the crash kernel image within the |
312 | any space below the alignment point may be overwritten by the dump-capture kernel, | 306 | first 512MB of RAM if X is not given. |
313 | which means it is possible that the vmcore is not that precise as expected. | ||
314 | 307 | ||
315 | 308 | ||
316 | Load the Dump-capture Kernel | 309 | Load the Dump-capture Kernel |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 139791ed473d..77b54c461c52 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -938,6 +938,13 @@ static int __init init_machine_late(void) | |||
938 | late_initcall(init_machine_late); | 938 | late_initcall(init_machine_late); |
939 | 939 | ||
940 | #ifdef CONFIG_KEXEC | 940 | #ifdef CONFIG_KEXEC |
941 | /* | ||
942 | * The crash region must be aligned to 128MB to avoid | ||
943 | * zImage relocating below the reserved region. | ||
944 | */ | ||
945 | #define CRASH_ALIGN (128 << 20) | ||
946 | #define CRASH_ADDR_MAX (PHYS_OFFSET + (512 << 20)) | ||
947 | |||
941 | static inline unsigned long long get_total_mem(void) | 948 | static inline unsigned long long get_total_mem(void) |
942 | { | 949 | { |
943 | unsigned long total; | 950 | unsigned long total; |
@@ -965,6 +972,28 @@ static void __init reserve_crashkernel(void) | |||
965 | if (ret) | 972 | if (ret) |
966 | return; | 973 | return; |
967 | 974 | ||
975 | if (crash_base <= 0) { | ||
976 | unsigned long long crash_max = CRASH_ADDR_MAX; | ||
977 | if (crash_max > (u32)~0) | ||
978 | crash_max = (u32)~0; | ||
979 | crash_base = memblock_find_in_range(CRASH_ALIGN, crash_max, | ||
980 | crash_size, CRASH_ALIGN); | ||
981 | if (!crash_base) { | ||
982 | pr_err("crashkernel reservation failed - No suitable area found.\n"); | ||
983 | return; | ||
984 | } | ||
985 | } else { | ||
986 | unsigned long long start; | ||
987 | |||
988 | start = memblock_find_in_range(crash_base, | ||
989 | crash_base + crash_size, | ||
990 | crash_size, SECTION_SIZE); | ||
991 | if (start != crash_base) { | ||
992 | pr_err("crashkernel reservation failed - memory is in use.\n"); | ||
993 | return; | ||
994 | } | ||
995 | } | ||
996 | |||
968 | ret = memblock_reserve(crash_base, crash_size); | 997 | ret = memblock_reserve(crash_base, crash_size); |
969 | if (ret < 0) { | 998 | if (ret < 0) { |
970 | pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n", | 999 | pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n", |