From: Rusty Russell <rusty@rustcorp.com.au>
To: Hugh Dickins <hugh@veritas.com>
Cc: Ingo Molnar <mingo@elte.hu>, Yinghai Lu <yinghai@kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@au1.ibm.com>
Subject: Re: linux-next: parsing mem=700M broken
Date: Sat, 27 Dec 2008 23:42:53 +1030 [thread overview]
Message-ID: <200812272342.54881.rusty@rustcorp.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0812241437230.15556@blonde.anvils>
On Thursday 25 December 2008 01:14:35 Hugh Dickins wrote:> But (of course: it's a patch to arch/x86) doesn't help at all on> ppc64; and I presume other architectures also remain broken...
Confirmed ppc64. But it's broken in a *different* way.
Whereas most archs called parse_early_param from setup_arch, powerpcdoes it before start_kernel. So instead of moving parsing earlier,my patch actually moved it later for powerpc.
Too late, for mem=.
Rather than try to untangle the powerpc boot process (most archs woulddo most of this in setup_arch), I think I have to expose the parseragain so they can call it:
commit 25bf48b74b9fb23b347d00656b604f9e55c72183Author: Rusty Russell <rusty@rustcorp.com.au>Date: Sat Dec 27 23:40:37 2008 +1030
Fix powerpc (tested on ppc64) command line handling. Powerpc used to call parse_early_param() really early; the change made it too late. Put it back.
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.cindex d36cbd0..e5f2387 100644--- a/arch/powerpc/kernel/prom.c+++ b/arch/powerpc/kernel/prom.c@@ -32,6 +32,7 @@ #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h>+#include <linux/start_kernel.h> #include <asm/prom.h> #include <asm/rtas.h>@@ -1188,6 +1189,7 @@ void __init early_init_devtree(void *params) /* Save command line for /proc/cmdline and then parse parameters */ strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);+ parse_early_and_core_params(boot_command_line); /* Reserve LMB regions used by kernel, initrd, dt, etc... */ lmb_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.cindex a237371..52ca63a 100644--- a/arch/powerpc/kernel/setup_32.c+++ b/arch/powerpc/kernel/setup_32.c@@ -264,12 +264,6 @@ static void __init exc_lvl_early_init(void) #define exc_lvl_early_init() #endif -void arch_get_boot_command_line(void)-{- /* FIXME: Get rid of cmd_line in favor of boot_command_line? */- strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);-}- /* Warning, IO base is not yet inited */ void __init setup_arch(void) {diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.cindex 7d25b42..348bc8a 100644--- a/arch/powerpc/kernel/setup_64.c+++ b/arch/powerpc/kernel/setup_64.c@@ -502,12 +502,6 @@ static void __init emergency_stack_init(void) } } -void arch_get_boot_command_line(void)-{- /* FIXME: Get rid of cmd_line in favor of boot_command_line? */- strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);-}- /* * Called into from start_kernel, after lock_kernel has been called. * Initializes bootmem, which is unsed to manage page allocation untildiff --git a/include/linux/start_kernel.h b/include/linux/start_kernel.hindex d3e5f27..347cc95 100644--- a/include/linux/start_kernel.h+++ b/include/linux/start_kernel.h@@ -9,4 +9,7 @@ extern asmlinkage void __init start_kernel(void); +/* Usually called by start_kernel, but some nasty archs need it earlier. */+void __init parse_early_and_core_params(char *cmdline);+ #endif /* _LINUX_START_KERNEL_H */diff --git a/init/main.c b/init/main.cindex fb00387..ad933ad 100644--- a/init/main.c+++ b/init/main.c@@ -522,6 +522,21 @@ void __init __weak thread_info_cache_init(void) { } +/* Non-destructive early parse of commandline. PowerPC calls this early. */+void __init parse_early_and_core_params(char *cmdline)+{+ static bool __initdata done = false;++ if (done)+ return;++ parse_args("Core and early params", cmdline,+ __start___core_param,+ __stop___core_param - __start___core_param,+ do_early_param, true);+ done = true;+}+ asmlinkage void __init start_kernel(void) { char *static_command_line;@@ -530,10 +545,7 @@ asmlinkage void __init start_kernel(void) printk(linux_banner); arch_get_boot_command_line();- parse_args("Core and early params", boot_command_line,- __start___core_param,- __stop___core_param - __start___core_param,- do_early_param, true);+ parse_early_and_core_params(boot_command_line); smp_setup_processor_id(); \0ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2008-12-27 13:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-23 3:06 linux-next: parsing mem=700M broken Hugh Dickins
2008-12-23 5:52 ` Yinghai Lu
2008-12-23 14:33 ` Ingo Molnar
2008-12-24 7:38 ` Rusty Russell
2008-12-24 8:09 ` Yinghai Lu
2008-12-24 23:09 ` Yinghai Lu
2008-12-25 11:40 ` Rusty Russell
2008-12-25 22:46 ` Yinghai Lu
2008-12-24 12:30 ` Ingo Oeser
2008-12-25 5:50 ` Rusty Russell
2008-12-24 14:44 ` Hugh Dickins
2008-12-25 3:28 ` Rusty Russell
2008-12-27 13:12 ` Rusty Russell [this message]
2008-12-28 0:43 ` Hugh Dickins
2008-12-28 2:07 ` Yinghai Lu
2009-01-01 3:42 ` Rusty Russell
2008-12-25 12:17 ` [RFC] boot parameter handling cleanup II Rusty Russell
2008-12-25 12:20 ` [RFC PATCH] param: start_kernel_with_args() Rusty Russell
2008-12-27 10:14 ` [RFC] boot parameter handling cleanup II Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200812272342.54881.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=benh@au1.ibm.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox