* setup_arch/arch_get_boot_command_line changes
@ 2008-12-09 22:20 Rusty Russell
2008-12-09 22:59 ` Kyle McMartin
2008-12-09 23:54 ` Linus Torvalds
0 siblings, 2 replies; 7+ messages in thread
From: Rusty Russell @ 2008-12-09 22:20 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-kernel, dhowells, Richard Henderson, Russell King,
Haavard Skinnemoen, Bryan Wu, Mikael Starvik, Yoshinori Sato,
Tony Luck, Hirokazu Takata, Geert Uytterhoeven, Greg Ungerer,
Ralf Baechle, linux-parisc, Paul Mackerras, Heiko Carstens,
Paul Mundt, David S. Miller, Jeff Dike, Ingo Molnar, Chris Zankel,
Linus Torvalds
OK, I've folded in all the fixes, thanks. Git tree is here:
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-boot-params.git
Stephen, please include in linux-next. Clearly this hits every arch. I'll
try to avoid rebasing unless I've broken some arch horribly.
Thanks,
Rusty.
David Howells (2):
param: Adapt MN10300 to the new parameter handling regime
param: Adapt FRV to the new parameter handling regime
Rusty Russell (10):
USB: Don't use __module_param_call
param: allow parse_args to work non-destructively.
core_param: call these really, really early.
param: make sure charp isn't used as a core_param
param: arch_get_boot_command_line()
params: move core_param() parsing to before setup_arch.
Call early_param earlier.
param: combine core_param and early_param parsing.
params: don't use alloc_bootmem for saved_command_line
param: move banner printing to top of start_kernel.
arch/alpha/kernel/setup.c | 36 ++++++++-----
arch/arm/kernel/setup.c | 43 +++++++++-------
arch/avr32/kernel/setup.c | 15 ++---
arch/blackfin/kernel/setup.c | 22 ++++----
arch/cris/kernel/setup.c | 29 +++++-----
arch/frv/kernel/setup.c | 50 +++++++-----------
arch/h8300/kernel/setup.c | 27 +++++-----
arch/ia64/dig/setup.c | 2 +-
arch/ia64/hp/sim/hpsim_setup.c | 2 +-
arch/ia64/include/asm/machvec.h | 4 +-
arch/ia64/include/asm/paravirt.h | 8 ++--
arch/ia64/kernel/machvec.c | 8 +++-
arch/ia64/kernel/setup.c | 32 ++++++------
arch/ia64/sn/kernel/setup.c | 13 ++---
arch/ia64/uv/kernel/setup.c | 2 +-
arch/ia64/xen/xen_pv_ops.c | 2 +-
arch/m32r/kernel/setup.c | 16 +++---
arch/m68k/kernel/setup.c | 27 ++++++----
arch/m68knommu/include/asm/machdep.h | 2 +-
arch/m68knommu/kernel/setup.c | 33 ++++++------
arch/m68knommu/platform/5206/config.c | 2 +-
arch/m68knommu/platform/5206e/config.c | 14 +++--
arch/m68knommu/platform/520x/config.c | 2 +-
arch/m68knommu/platform/523x/config.c | 2 +-
arch/m68knommu/platform/5249/config.c | 2 +-
arch/m68knommu/platform/5272/config.c | 23 ++++----
arch/m68knommu/platform/527x/config.c | 2 +-
arch/m68knommu/platform/528x/config.c | 2 +-
arch/m68knommu/platform/5307/config.c | 13 +++--
arch/m68knommu/platform/532x/config.c | 22 ++++----
arch/m68knommu/platform/5407/config.c | 2 +-
arch/m68knommu/platform/68328/config.c | 2 +-
arch/m68knommu/platform/68328/head-pilot.S | 2 +-
arch/m68knommu/platform/68360/config.c | 6 ++-
arch/m68knommu/platform/68EZ328/config.c | 4 +-
arch/m68knommu/platform/68VZ328/config.c | 12 +++--
arch/mips/kernel/setup.c | 20 ++++----
arch/mn10300/kernel/setup.c | 61 +++++++++-------------
arch/parisc/kernel/setup.c | 30 +++++------
arch/powerpc/kernel/prom.c | 1 -
arch/powerpc/kernel/setup_32.c | 10 +++-
arch/powerpc/kernel/setup_64.c | 8 ++-
arch/s390/kernel/setup.c | 8 +---
arch/sh/boards/board-magicpanelr2.c | 2 +-
arch/sh/boards/board-sh7785lcr.c | 2 +-
arch/sh/boards/mach-dreamcast/setup.c | 2 +-
arch/sh/boards/mach-highlander/setup.c | 2 +-
arch/sh/boards/mach-hp6xx/setup.c | 2 +-
arch/sh/boards/mach-landisk/setup.c | 2 +-
arch/sh/boards/mach-microdev/setup.c | 2 +-
arch/sh/boards/mach-migor/setup.c | 2 +-
arch/sh/boards/mach-r2d/setup.c | 2 +-
arch/sh/boards/mach-sdk7780/setup.c | 2 +-
arch/sh/boards/mach-se/7343/setup.c | 2 +-
arch/sh/boards/mach-se/770x/setup.c | 2 +-
arch/sh/boards/mach-se/7721/setup.c | 2 +-
arch/sh/boards/mach-se/7722/setup.c | 2 +-
arch/sh/boards/mach-se/7780/setup.c | 2 +-
arch/sh/boards/mach-sh03/setup.c | 2 +-
arch/sh/boards/mach-sh7763rdp/setup.c | 2 +-
arch/sh/include/asm/machvec.h | 2 +-
arch/sh/kernel/setup.c | 28 +++++-----
arch/sparc/kernel/setup.c | 14 +++---
arch/sparc64/kernel/setup.c | 12 ++--
arch/um/kernel/um_arch.c | 10 +++-
arch/x86/kernel/setup.c | 41 +++++++--------
arch/xtensa/kernel/setup.c | 19 ++++---
drivers/usb/core/usb.c | 8 ++-
include/asm-generic/vmlinux.lds.h | 3 +
include/linux/init.h | 5 +-
include/linux/moduleparam.h | 43 ++++++++++++----
init/main.c | 74 ++++++++++++--------------
kernel/kexec.c | 1 +
kernel/module.c | 2 +-
kernel/params.c | 77 +++++++++++++++++++++------
75 files changed, 535 insertions(+), 461 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 22:20 setup_arch/arch_get_boot_command_line changes Rusty Russell
@ 2008-12-09 22:59 ` Kyle McMartin
2008-12-09 23:02 ` Kyle McMartin
2008-12-10 12:44 ` Rusty Russell
2008-12-09 23:54 ` Linus Torvalds
1 sibling, 2 replies; 7+ messages in thread
From: Kyle McMartin @ 2008-12-09 22:59 UTC (permalink / raw)
To: Rusty Russell
Cc: Stephen Rothwell, linux-kernel, dhowells, Richard Henderson,
Russell King, Haavard Skinnemoen, Bryan Wu, Mikael Starvik,
Yoshinori Sato, Tony Luck, Hirokazu Takata, Geert Uytterhoeven,
Greg Ungerer, Ralf Baechle, linux-parisc, Paul Mackerras,
Heiko Carstens, Paul Mundt, David S. Miller, Jeff Dike,
Ingo Molnar, Chris Zankel, Linus Torvalds
On Wed, Dec 10, 2008 at 08:50:24AM +1030, Rusty Russell wrote:
> Rusty Russell (10):
> <snip>
> param: move banner printing to top of start_kernel.
>
Will this not run afoul of lockdep since it will be attempting to take
locks before lockdep has initialized?
(as an aside, it would be nice if it came after setup_arch, since on
some horrible platforms, printk_time needs the fpu turned on for
(integer) division, but there's no arch hook before the first printk, so
one needs to hijack the start_kernel entrypoint...)
regards, Kyle
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 22:59 ` Kyle McMartin
@ 2008-12-09 23:02 ` Kyle McMartin
2008-12-09 23:33 ` Kyle McMartin
2008-12-10 12:44 ` Rusty Russell
1 sibling, 1 reply; 7+ messages in thread
From: Kyle McMartin @ 2008-12-09 23:02 UTC (permalink / raw)
To: Kyle McMartin
Cc: Rusty Russell, Stephen Rothwell, linux-kernel, dhowells,
Richard Henderson, Russell King, Haavard Skinnemoen, Bryan Wu,
Mikael Starvik, Yoshinori Sato, Tony Luck, Hirokazu Takata,
Geert Uytterhoeven, Greg Ungerer, Ralf Baechle, linux-parisc,
Paul Mackerras, Heiko Carstens, Paul Mundt, David S. Miller,
Jeff Dike, Ingo Molnar, Chris Zankel, Linus Torvalds
On Tue, Dec 09, 2008 at 05:59:31PM -0500, Kyle McMartin wrote:
> Will this not run afoul of lockdep since it will be attempting to take
> locks before lockdep has initialized?
>
Ah, printk calls lockdep_off now. Handy.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 23:02 ` Kyle McMartin
@ 2008-12-09 23:33 ` Kyle McMartin
0 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2008-12-09 23:33 UTC (permalink / raw)
To: Kyle McMartin
Cc: Rusty Russell, Stephen Rothwell, linux-kernel, dhowells,
Richard Henderson, Russell King, Haavard Skinnemoen, Bryan Wu,
Mikael Starvik, Yoshinori Sato, Tony Luck, Hirokazu Takata,
Geert Uytterhoeven, Greg Ungerer, Ralf Baechle, linux-parisc,
Paul Mackerras, Heiko Carstens, Paul Mundt, David S. Miller,
Jeff Dike, Ingo Molnar, Chris Zankel, Linus Torvalds
On Tue, Dec 09, 2008 at 06:02:14PM -0500, Kyle McMartin wrote:
> On Tue, Dec 09, 2008 at 05:59:31PM -0500, Kyle McMartin wrote:
> > Will this not run afoul of lockdep since it will be attempting to take
> > locks before lockdep has initialized?
> >
>
> Ah, printk calls lockdep_off now. Handy.
>
Nevermind, this doesn't do what I think it does... Rusty, does this work
with lockdep enabled?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 22:20 setup_arch/arch_get_boot_command_line changes Rusty Russell
2008-12-09 22:59 ` Kyle McMartin
@ 2008-12-09 23:54 ` Linus Torvalds
2008-12-10 12:27 ` Rusty Russell
1 sibling, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2008-12-09 23:54 UTC (permalink / raw)
To: Rusty Russell
Cc: Stephen Rothwell, linux-kernel, dhowells, Richard Henderson,
Russell King, Haavard Skinnemoen, Bryan Wu, Mikael Starvik,
Yoshinori Sato, Tony Luck, Hirokazu Takata, Geert Uytterhoeven,
Greg Ungerer, Ralf Baechle, linux-parisc, Paul Mackerras,
Heiko Carstens, Paul Mundt, David S. Miller, Jeff Dike,
Ingo Molnar, Chris Zankel
On Wed, 10 Dec 2008, Rusty Russell wrote:
>
> OK, I've folded in all the fixes, thanks. Git tree is here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-boot-params.git
>
> Stephen, please include in linux-next. Clearly this hits every arch. I'll
> try to avoid rebasing unless I've broken some arch horribly.
This looks really invasive, with absolutely zero explanations of what the
point of it all is.
What?
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 23:54 ` Linus Torvalds
@ 2008-12-10 12:27 ` Rusty Russell
0 siblings, 0 replies; 7+ messages in thread
From: Rusty Russell @ 2008-12-10 12:27 UTC (permalink / raw)
To: Linus Torvalds
Cc: Stephen Rothwell, linux-kernel, dhowells, Richard Henderson,
Russell King, Haavard Skinnemoen, Bryan Wu, Mikael Starvik,
Yoshinori Sato, Tony Luck, Hirokazu Takata, Geert Uytterhoeven,
Greg Ungerer, Ralf Baechle, linux-parisc, Paul Mackerras,
Heiko Carstens, Paul Mundt, David S. Miller, Jeff Dike,
Ingo Molnar, Chris Zankel
On Wednesday 10 December 2008 10:24:11 Linus Torvalds wrote:
> This looks really invasive, with absolutely zero explanations of what the
> point of it all is.
>
> What?
Sorry, it's a cleanup. I wanted start_kernel(const char *cmdline), but that
was even more invasive.
Justification: there are about five command line parsing systems in the
kernel at the moment, and about the same number of copies of the command
line. Here's how it works at the moment:
1) setup_arch(char **cmdlinep) is called. This copies the command line
into boot_command_line, and also returns a pointer in cmdlinep. That
pointer is not usually boot_command_line, but an arch-internal cmdline
which for some archs have deleted already-parsed options. Some archs
do strstr parsing of the command line here.
2) parse_early_param() is called by some archs from setup_arch. This copies
boot_command_line into an __initdata temporary to parse for early_param().
early_param() look like foo[=bar] and go for a generic callback: they
are usually sloppily parsed but simple.
Other archs don't call this, so we call it again later in start_kernel.
(parse_early_param() can't be called before setup_arch because we don't
know the command line yet, but many archs need the parsing done to
complete setup_arch.)
3) setup_command_line() copies boot_command_line into saved_command_line,
because boot_command_line is __initdata, and we need to save it for proc.
It also copies the cmdlinep returned from setup_arch into
static_command_line, because cmdlinep may point to initdata, and
traditionally command line callbacks are allowed to keep pointers to
their args so we need to keep the (mangled) cmdline around.
4) We parse the command line again, matching for core_param, module_param
and __setup. module_param is the standard modname.arg, and core_param
is just 'arg'. They both can (optionally) make the args read/writable
in sysfs, and are trivial and typesafe to use. __setup() is a generic
prefix-matching callback which has been around forever.
5) IA64 needs machvec= processed before any of the other early_param()
calls, so it grabs this manually. It leaves it in the command line, so
it seems that init gets a $machvec in its environment if this was set.
6) Arm uses __early_param which is arm-specific. This is like early_param,
only different.
New code:
1) arch_get_boot_command_line() just gets the command-line at the start of
setup_arch. Making copies etc. is all in generic code.
2) early_param and core_param are parsed just after, so you can rely
on the results in setup_arch(), which no longer does any command line
stuff.
3) Three copies of command line total: char __initdata boot_command_line[]
since we can't alloc, char *saved_command_line for proc, and static char *
static_command_line for __setup/module_param to keep references to.
4) Some archs still have working copies of the command line, but they don't
need to and I put in FIXMEs.
5) IA64 still has to handle machvec= manually. AFAICT it's the only one, so
not worth putting in a boutique pre-early_param for that.
It's a nice cleanup, but it's not a revolutionary improvement IMHO.
Rusty.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: setup_arch/arch_get_boot_command_line changes
2008-12-09 22:59 ` Kyle McMartin
2008-12-09 23:02 ` Kyle McMartin
@ 2008-12-10 12:44 ` Rusty Russell
1 sibling, 0 replies; 7+ messages in thread
From: Rusty Russell @ 2008-12-10 12:44 UTC (permalink / raw)
To: Kyle McMartin
Cc: Stephen Rothwell, linux-kernel, dhowells, Richard Henderson,
Russell King, Haavard Skinnemoen, Bryan Wu, Mikael Starvik,
Yoshinori Sato, Tony Luck, Hirokazu Takata, Geert Uytterhoeven,
Greg Ungerer, Ralf Baechle, linux-parisc, Paul Mackerras,
Heiko Carstens, Paul Mundt, David S. Miller, Jeff Dike,
Ingo Molnar, Chris Zankel, Linus Torvalds
On Wednesday 10 December 2008 09:29:31 Kyle McMartin wrote:
> On Wed, Dec 10, 2008 at 08:50:24AM +1030, Rusty Russell wrote:
> > Rusty Russell (10):
> > <snip>
> > param: move banner printing to top of start_kernel.
> >
>
> Will this not run afoul of lockdep since it will be attempting to take
> locks before lockdep has initialized?
Hmm, works for me here. But then, i386_start_kernel -> reserve_ebda_region
->printk already, so that banner is *still* not first line.
> (as an aside, it would be nice if it came after setup_arch, since on
> some horrible platforms, printk_time needs the fpu turned on for
> (integer) division, but there's no arch hook before the first printk, so
> one needs to hijack the start_kernel entrypoint...)
That won't help much, since a failed kernel parameter parse will also call
printk. I don't think it's sane to call start_kernel without the
ability to do integer division!
Rusty.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-12-10 12:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09 22:20 setup_arch/arch_get_boot_command_line changes Rusty Russell
2008-12-09 22:59 ` Kyle McMartin
2008-12-09 23:02 ` Kyle McMartin
2008-12-09 23:33 ` Kyle McMartin
2008-12-10 12:44 ` Rusty Russell
2008-12-09 23:54 ` Linus Torvalds
2008-12-10 12:27 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox