From: Rusty Russell <rusty@rustcorp.com.au>
To: Pawel Moll <pawel.moll@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH] virtio-mmio: Devices parameter parsing
Date: Thu, 01 Dec 2011 12:36:39 +1030 [thread overview]
Message-ID: <877h2ht58w.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1322588190.3164.129.camel@hornet.cambridge.arm.com>
On Tue, 29 Nov 2011 17:36:30 +0000, Pawel Moll <pawel.moll@arm.com> 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.
WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Pawel Moll <pawel.moll@arm.com>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"virtualization\@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH] virtio-mmio: Devices parameter parsing
Date: Thu, 01 Dec 2011 12:36:39 +1030 [thread overview]
Message-ID: <877h2ht58w.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1322588190.3164.129.camel@hornet.cambridge.arm.com>
On Tue, 29 Nov 2011 17:36:30 +0000, Pawel Moll <pawel.moll@arm.com> 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.
next prev parent reply other threads:[~2011-12-01 2:06 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 13:53 [PATCH] virtio-mmio: Devices parameter parsing Pawel Moll
2011-11-16 0:42 ` Rusty Russell
2011-11-16 0:42 ` Rusty Russell
2011-11-16 18:13 ` Pawel Moll
2011-11-16 18:13 ` Pawel Moll
2011-11-17 12:42 ` [PATCH v2] " Pawel Moll
2011-11-17 12:42 ` Pawel Moll
2011-11-21 3:32 ` [PATCH] " Rusty Russell
2011-11-21 3:32 ` Rusty Russell
2011-11-21 14:44 ` Pawel Moll
2011-11-21 14:44 ` Pawel Moll
2011-11-21 17:56 ` Pawel Moll
2011-11-21 17:56 ` Pawel Moll
2011-11-22 0:53 ` Rusty Russell
2011-11-22 0:53 ` Rusty Russell
2011-11-23 18:08 ` Pawel Moll
2011-11-28 0:31 ` Rusty Russell
2011-11-28 0:31 ` Rusty Russell
2011-11-29 17:36 ` Pawel Moll
2011-11-29 17:36 ` Pawel Moll
2011-12-01 2:06 ` Rusty Russell [this message]
2011-12-01 2:06 ` Rusty Russell
2011-12-12 17:53 ` Pawel Moll
2011-12-12 17:53 ` Pawel Moll
2011-12-12 17:57 ` [PATCH 1/2] params: <level>_initcall-like kernel parameters Pawel Moll
2011-12-12 17:57 ` Pawel Moll
2011-12-12 17:57 ` [PATCH 2/2] virtio-mmio: Devices parameter parsing Pawel Moll
2011-12-12 17:57 ` Pawel Moll
2012-04-09 16:32 ` Sasha Levin
2012-04-09 16:32 ` Sasha Levin
2012-04-10 12:53 ` Pawel Moll
2012-04-10 12:53 ` Pawel Moll
2011-12-15 3:51 ` [PATCH 1/2] params: <level>_initcall-like kernel parameters Rusty Russell
2011-12-15 3:51 ` Rusty Russell
2011-12-15 9:38 ` Pawel Moll
2011-12-15 9:38 ` Pawel Moll
2011-11-22 0:44 ` [PATCH] virtio-mmio: Devices parameter parsing Rusty Russell
2011-11-22 0:44 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2012-05-09 17:30 Pawel Moll
2012-05-09 17:30 ` Pawel Moll
2012-05-10 0:44 ` Rusty Russell
2012-05-10 0:44 ` Rusty Russell
2011-11-15 13:53 Pawel Moll
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=877h2ht58w.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=pawel.moll@arm.com \
--cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.