On Tue, 29 Nov 2011 17:36:30 +0000, Pawel Moll <pawel.moll@xxxxxxx> wrote: > On Mon, 2011-11-28 at 00:31 +0000, Rusty Russell wrote: > > Off the top of my head, this makes me think of the way initcalls are > > ordered. We could put a parameter parsing initcall at the start of each > > initcall level in include/asm-generic/vmlinux.lds.h's INITCALLS macro. > > > > Then we steal four bits from struct kernel_param's flags to indicate the > > level of the initcall (-1 == existing ones, otherwise N == before level > > N initcalls). > > Yes, this was my initial idea as well. The only problem I faced is the > fact that there is no "between levels"... It's easy to add parameters > parsing _at_ any particular level, but hard to do this _after_ level A > and _before_ level B. The initcalls section simply contains all the > calls, ordered by the level - the only "separated" level is the pre-SMP > early one. And order within one level is determined by the link order, > so I can't guarantee parsing the parameters as the first call of a level > (nor as the last call of the previous level). Yeah, that's why I suggested changing the linker script. > /* This is the fundamental function for registering boot/module > parameters. */ > -#define __module_param_call(prefix, name, ops, arg, isbool, perm) \ > +#define __module_param_call(prefix, name, ops, arg, isbool, late, perm) \ > /* Default value instead of permissions? */ \ > static int __param_perm_check_##name __attribute__((unused)) = \ > BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ Might as well change isbool to "flags", since we have to fix callers anyway. > diff --git a/init/main.c b/init/main.c > index 217ed23..ce89a53 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -407,7 +407,7 @@ static int __init do_early_param(char *param, char *val) > > void __init parse_early_options(char *cmdline) > { > - parse_args("early options", cmdline, NULL, 0, do_early_param); > + parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param); It'd be nice to replace the early param stuff too, but that's probably a separate patch. As is getting rid of the old __setup() calls everywhere ;) But so far, it looks good! Thanks, Rusty. _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization