aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/setup.c
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2006-01-09 23:51:46 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:27 -0500
commit69cda7b1f06befb8d6a884b8a663d19dcaef590b (patch)
tree95896c7ca9ab089b24463afd455fdde15a14c3dd /arch/x86_64/kernel/setup.c
parentbf2083050d7879390ddedbd64e431cf167854a34 (diff)
[PATCH] kdump: x86_64: add memmmap command line option
) From: Vivek Goyal <vgoyal@in.ibm.com> - This patch introduces the memmap option for x86_64 similar to i386. - memmap=exactmap enables setting of an exact E820 memory map, as specified by the user. Changes in this version: - Used e820_end_of_ram() to find the max_pfn as suggested by Andi kleen. - removed PFN_UP & PFN_DOWN macros - Printing the user defined map also. Signed-off-by: Murali M Chakravarthy <muralim@in.ibm.com> Signed-off-by: Hariprasad Nellitheertha <nharipra@gmail.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/setup.c')
-rw-r--r--arch/x86_64/kernel/setup.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 64c4534b930c..ff9620b800c0 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -275,6 +275,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
275{ 275{
276 char c = ' ', *to = command_line, *from = COMMAND_LINE; 276 char c = ' ', *to = command_line, *from = COMMAND_LINE;
277 int len = 0; 277 int len = 0;
278 int userdef = 0;
278 279
279 /* Save unparsed command line copy for /proc/cmdline */ 280 /* Save unparsed command line copy for /proc/cmdline */
280 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); 281 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
@@ -357,6 +358,28 @@ static __init void parse_cmdline_early (char ** cmdline_p)
357 if (!memcmp(from, "mem=", 4)) 358 if (!memcmp(from, "mem=", 4))
358 parse_memopt(from+4, &from); 359 parse_memopt(from+4, &from);
359 360
361 if (!memcmp(from, "memmap=", 7)) {
362 /* exactmap option is for used defined memory */
363 if (!memcmp(from+7, "exactmap", 8)) {
364#ifdef CONFIG_CRASH_DUMP
365 /* If we are doing a crash dump, we
366 * still need to know the real mem
367 * size before original memory map is
368 * reset.
369 */
370 saved_max_pfn = e820_end_of_ram();
371#endif
372 from += 8+7;
373 end_pfn_map = 0;
374 e820.nr_map = 0;
375 userdef = 1;
376 }
377 else {
378 parse_memmapopt(from+7, &from);
379 userdef = 1;
380 }
381 }
382
360#ifdef CONFIG_NUMA 383#ifdef CONFIG_NUMA
361 if (!memcmp(from, "numa=", 5)) 384 if (!memcmp(from, "numa=", 5))
362 numa_setup(from+5); 385 numa_setup(from+5);
@@ -403,6 +426,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
403 break; 426 break;
404 *(to++) = c; 427 *(to++) = c;
405 } 428 }
429 if (userdef) {
430 printk(KERN_INFO "user-defined physical RAM map:\n");
431 e820_print_map("user");
432 }
406 *to = '\0'; 433 *to = '\0';
407 *cmdline_p = command_line; 434 *cmdline_p = command_line;
408} 435}