2023-01-05 01:28:53

by Paul E. McKenney

[permalink] [raw]
Subject: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

The BOOT_CONFIG family of Kconfig options allows a bootconfig file
containing kernel boot parameters to be embedded into an initrd or into
the kernel itself. This can be extremely useful when deploying kernels
in cases where some of the boot parameters depend on the kernel version
rather than on the server hardware, firmware, or workload.

Unfortunately, the "bootconfig" kernel parameter must be specified in
order to cause the kernel to look for the embedded bootconfig file,
and it clearly does not help to embed this "bootconfig" kernel parameter
into that file.

Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
kernel to act as if the "bootconfig" kernel parameter had been specified.
In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
for the embedded bootconfig file even when the "bootconfig" kernel
parameter is omitted. This permits kernel-version-dependent kernel
boot parameters to be embedded into the kernel image without the need to
(for example) update large numbers of boot loaders.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: <[email protected]>

diff --git a/Documentation/admin-guide/bootconfig.rst b/Documentation/admin-guide/bootconfig.rst
index 9355c525fbe0a..91339efdcb541 100644
--- a/Documentation/admin-guide/bootconfig.rst
+++ b/Documentation/admin-guide/bootconfig.rst
@@ -201,6 +201,8 @@ To remove the config from the image, you can use -d option as below::

Then add "bootconfig" on the normal kernel command line to tell the
kernel to look for the bootconfig at the end of the initrd file.
+Alternatively, build your kernel with the ``CONFIG_BOOT_CONFIG_FORCE``
+Kconfig option selected.

Embedding a Boot Config into Kernel
-----------------------------------
@@ -217,7 +219,9 @@ path to the bootconfig file from source tree or object tree.
The kernel will embed it as the default bootconfig.

Just as when attaching the bootconfig to the initrd, you need ``bootconfig``
-option on the kernel command line to enable the embedded bootconfig.
+option on the kernel command line to enable the embedded bootconfig, or,
+alternatively, build your kernel with the ``CONFIG_BOOT_CONFIG_FORCE``
+Kconfig option selected.

Note that even if you set this option, you can override the embedded
bootconfig by another bootconfig which attached to the initrd.
diff --git a/init/Kconfig b/init/Kconfig
index 7e5c3ddc341de..f894fb004bad4 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1376,6 +1376,18 @@ config BOOT_CONFIG

If unsure, say Y.

+config BOOT_CONFIG_FORCE
+ bool "Force unconditional bootconfig processing"
+ depends on BOOT_CONFIG
+ help
+ With this Kconfig option set, BOOT_CONFIG processing is carried
+ out even when the "bootconfig" kernel-boot parameter is omitted.
+ In fact, with this Kconfig option set, there is no way to
+ make the kernel ignore the BOOT_CONFIG-supplied kernel-boot
+ parameters.
+
+ If unsure, say N.
+
config BOOT_CONFIG_EMBED
bool "Embed bootconfig file in the kernel"
depends on BOOT_CONFIG
diff --git a/init/main.c b/init/main.c
index e1c3911d7c707..669cb892e6c17 100644
--- a/init/main.c
+++ b/init/main.c
@@ -156,7 +156,7 @@ static char *extra_init_args;

#ifdef CONFIG_BOOT_CONFIG
/* Is bootconfig on command line? */
-static bool bootconfig_found;
+static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
static size_t initargs_offs;
#else
# define bootconfig_found false


Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Wed, 4 Jan 2023 16:58:38 -0800
"Paul E. McKenney" <[email protected]> wrote:

> The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> containing kernel boot parameters to be embedded into an initrd or into
> the kernel itself. This can be extremely useful when deploying kernels
> in cases where some of the boot parameters depend on the kernel version
> rather than on the server hardware, firmware, or workload.
>
> Unfortunately, the "bootconfig" kernel parameter must be specified in
> order to cause the kernel to look for the embedded bootconfig file,
> and it clearly does not help to embed this "bootconfig" kernel parameter
> into that file.
>
> Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> kernel to act as if the "bootconfig" kernel parameter had been specified.
> In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> for the embedded bootconfig file even when the "bootconfig" kernel
> parameter is omitted. This permits kernel-version-dependent kernel
> boot parameters to be embedded into the kernel image without the need to
> (for example) update large numbers of boot loaders.
>

I like this because this is a simple solution. We have another option
to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
bootloader. Thus, it is better to have this option so that user can
always enable bootconfig.

Acked-by: Masami Hiramatsu (Google) <[email protected]>

BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
(or at least recommend to enable this)

Thank you!

> Signed-off-by: Paul E. McKenney <[email protected]>
> Cc: Masami Hiramatsu <[email protected]>
> Cc: Jonathan Corbet <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: Nick Desaulniers <[email protected]>
> Cc: Vlastimil Babka <[email protected]>
> Cc: Johannes Weiner <[email protected]>
> Cc: <[email protected]>
>
> diff --git a/Documentation/admin-guide/bootconfig.rst b/Documentation/admin-guide/bootconfig.rst
> index 9355c525fbe0a..91339efdcb541 100644
> --- a/Documentation/admin-guide/bootconfig.rst
> +++ b/Documentation/admin-guide/bootconfig.rst
> @@ -201,6 +201,8 @@ To remove the config from the image, you can use -d option as below::
>
> Then add "bootconfig" on the normal kernel command line to tell the
> kernel to look for the bootconfig at the end of the initrd file.
> +Alternatively, build your kernel with the ``CONFIG_BOOT_CONFIG_FORCE``
> +Kconfig option selected.
>
> Embedding a Boot Config into Kernel
> -----------------------------------
> @@ -217,7 +219,9 @@ path to the bootconfig file from source tree or object tree.
> The kernel will embed it as the default bootconfig.
>
> Just as when attaching the bootconfig to the initrd, you need ``bootconfig``
> -option on the kernel command line to enable the embedded bootconfig.
> +option on the kernel command line to enable the embedded bootconfig, or,
> +alternatively, build your kernel with the ``CONFIG_BOOT_CONFIG_FORCE``
> +Kconfig option selected.
>
> Note that even if you set this option, you can override the embedded
> bootconfig by another bootconfig which attached to the initrd.
> diff --git a/init/Kconfig b/init/Kconfig
> index 7e5c3ddc341de..f894fb004bad4 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1376,6 +1376,18 @@ config BOOT_CONFIG
>
> If unsure, say Y.
>
> +config BOOT_CONFIG_FORCE
> + bool "Force unconditional bootconfig processing"
> + depends on BOOT_CONFIG
> + help
> + With this Kconfig option set, BOOT_CONFIG processing is carried
> + out even when the "bootconfig" kernel-boot parameter is omitted.
> + In fact, with this Kconfig option set, there is no way to
> + make the kernel ignore the BOOT_CONFIG-supplied kernel-boot
> + parameters.
> +
> + If unsure, say N.
> +
> config BOOT_CONFIG_EMBED
> bool "Embed bootconfig file in the kernel"
> depends on BOOT_CONFIG
> diff --git a/init/main.c b/init/main.c
> index e1c3911d7c707..669cb892e6c17 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -156,7 +156,7 @@ static char *extra_init_args;
>
> #ifdef CONFIG_BOOT_CONFIG
> /* Is bootconfig on command line? */
> -static bool bootconfig_found;
> +static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> static size_t initargs_offs;
> #else
> # define bootconfig_found false


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-07 16:41:20

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> On Wed, 4 Jan 2023 16:58:38 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > containing kernel boot parameters to be embedded into an initrd or into
> > the kernel itself. This can be extremely useful when deploying kernels
> > in cases where some of the boot parameters depend on the kernel version
> > rather than on the server hardware, firmware, or workload.
> >
> > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > order to cause the kernel to look for the embedded bootconfig file,
> > and it clearly does not help to embed this "bootconfig" kernel parameter
> > into that file.
> >
> > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > for the embedded bootconfig file even when the "bootconfig" kernel
> > parameter is omitted. This permits kernel-version-dependent kernel
> > boot parameters to be embedded into the kernel image without the need to
> > (for example) update large numbers of boot loaders.
>
> I like this because this is a simple solution. We have another option
> to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> bootloader. Thus, it is better to have this option so that user can
> always enable bootconfig.

Glad you like it!

In addition, if the help text is accurate, another shortcoming of
CONFIG_CMDLINE is that its semantics vary from one architecture to
another. Some have CONFIG_CMDLINE override the boot-loader supplied
parameters, and others differ in the order in which the parameters
are processed.

> Acked-by: Masami Hiramatsu (Google) <[email protected]>

Thank you!

> BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> (or at least recommend to enable this)

Like this?

Thanx, Paul

------------------------------------------------------------------------

commit d09a1505c51a70da38b34ac38062977299aef742
Author: Paul E. McKenney <[email protected]>
Date: Sat Jan 7 08:09:22 2023 -0800

bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED

When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
will normally be to unconditionally provide the specified kernel-boot
arguments to the kernel, as opposed to requiring a separately provided
bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.

The old semantics may be obtained by manually overriding this default.

Suggested-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>

diff --git a/init/Kconfig b/init/Kconfig
index 0fb19fa0edba9..97a0f14d9020d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1379,6 +1379,7 @@ config BOOT_CONFIG
config BOOT_CONFIG_FORCE
bool "Force unconditional bootconfig processing"
depends on BOOT_CONFIG
+ default y if BOOT_CONFIG_EMBED
help
With this Kconfig option set, BOOT_CONFIG processing is carried
out even when the "bootconfig" kernel-boot parameter is omitted.

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sat, 7 Jan 2023 08:22:02 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > On Wed, 4 Jan 2023 16:58:38 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > containing kernel boot parameters to be embedded into an initrd or into
> > > the kernel itself. This can be extremely useful when deploying kernels
> > > in cases where some of the boot parameters depend on the kernel version
> > > rather than on the server hardware, firmware, or workload.
> > >
> > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > order to cause the kernel to look for the embedded bootconfig file,
> > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > into that file.
> > >
> > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > parameter is omitted. This permits kernel-version-dependent kernel
> > > boot parameters to be embedded into the kernel image without the need to
> > > (for example) update large numbers of boot loaders.
> >
> > I like this because this is a simple solution. We have another option
> > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > bootloader. Thus, it is better to have this option so that user can
> > always enable bootconfig.
>
> Glad you like it!
>
> In addition, if the help text is accurate, another shortcoming of
> CONFIG_CMDLINE is that its semantics vary from one architecture to
> another. Some have CONFIG_CMDLINE override the boot-loader supplied
> parameters, and others differ in the order in which the parameters
> are processed.

Yes, that differences confuse us...

>
> > Acked-by: Masami Hiramatsu (Google) <[email protected]>
>
> Thank you!
>
> > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > (or at least recommend to enable this)
>
> Like this?

Yes! Thanks.

>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit d09a1505c51a70da38b34ac38062977299aef742
> Author: Paul E. McKenney <[email protected]>
> Date: Sat Jan 7 08:09:22 2023 -0800
>
> bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
>
> When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> will normally be to unconditionally provide the specified kernel-boot
> arguments to the kernel, as opposed to requiring a separately provided
> bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
>
> The old semantics may be obtained by manually overriding this default.
>
> Suggested-by: Masami Hiramatsu <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>

Acked-by: Masami Hiramatsu (Google) <[email protected]>

Thank you!

>
> diff --git a/init/Kconfig b/init/Kconfig
> index 0fb19fa0edba9..97a0f14d9020d 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> config BOOT_CONFIG_FORCE
> bool "Force unconditional bootconfig processing"
> depends on BOOT_CONFIG
> + default y if BOOT_CONFIG_EMBED
> help
> With this Kconfig option set, BOOT_CONFIG processing is carried
> out even when the "bootconfig" kernel-boot parameter is omitted.


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-09 05:02:26

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> On Sat, 7 Jan 2023 08:22:02 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > in cases where some of the boot parameters depend on the kernel version
> > > > rather than on the server hardware, firmware, or workload.
> > > >
> > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > into that file.
> > > >
> > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > boot parameters to be embedded into the kernel image without the need to
> > > > (for example) update large numbers of boot loaders.
> > >
> > > I like this because this is a simple solution. We have another option
> > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > bootloader. Thus, it is better to have this option so that user can
> > > always enable bootconfig.
> >
> > Glad you like it!
> >
> > In addition, if the help text is accurate, another shortcoming of
> > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > parameters, and others differ in the order in which the parameters
> > are processed.
>
> Yes, that differences confuse us...

I am glad that it is not just me. ;-)

I will add words to that effect to the commit log.

> > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> >
> > Thank you!
> >
> > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > (or at least recommend to enable this)
> >
> > Like this?
>
> Yes! Thanks.
>
> >
> > Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit d09a1505c51a70da38b34ac38062977299aef742
> > Author: Paul E. McKenney <[email protected]>
> > Date: Sat Jan 7 08:09:22 2023 -0800
> >
> > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> >
> > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > will normally be to unconditionally provide the specified kernel-boot
> > arguments to the kernel, as opposed to requiring a separately provided
> > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> >
> > The old semantics may be obtained by manually overriding this default.
> >
> > Suggested-by: Masami Hiramatsu <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
>
> Acked-by: Masami Hiramatsu (Google) <[email protected]>

Applied, thank you!

Thanx, Paul

> Thank you!
>
> >
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 0fb19fa0edba9..97a0f14d9020d 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > config BOOT_CONFIG_FORCE
> > bool "Force unconditional bootconfig processing"
> > depends on BOOT_CONFIG
> > + default y if BOOT_CONFIG_EMBED
> > help
> > With this Kconfig option set, BOOT_CONFIG processing is carried
> > out even when the "bootconfig" kernel-boot parameter is omitted.
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sun, 8 Jan 2023 20:25:01 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > On Sat, 7 Jan 2023 08:22:02 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > rather than on the server hardware, firmware, or workload.
> > > > >
> > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > into that file.
> > > > >
> > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > (for example) update large numbers of boot loaders.
> > > >
> > > > I like this because this is a simple solution. We have another option
> > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > bootloader. Thus, it is better to have this option so that user can
> > > > always enable bootconfig.
> > >
> > > Glad you like it!
> > >
> > > In addition, if the help text is accurate, another shortcoming of
> > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > parameters, and others differ in the order in which the parameters
> > > are processed.
> >
> > Yes, that differences confuse us...
>
> I am glad that it is not just me. ;-)
>
> I will add words to that effect to the commit log.
>
> > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > >
> > > Thank you!
> > >
> > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > (or at least recommend to enable this)
> > >
> > > Like this?
> >
> > Yes! Thanks.
> >
> > >
> > > Thanx, Paul
> > >
> > > ------------------------------------------------------------------------
> > >
> > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > Author: Paul E. McKenney <[email protected]>
> > > Date: Sat Jan 7 08:09:22 2023 -0800
> > >
> > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > >
> > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > will normally be to unconditionally provide the specified kernel-boot
> > > arguments to the kernel, as opposed to requiring a separately provided
> > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > >
> > > The old semantics may be obtained by manually overriding this default.
> > >
> > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > Signed-off-by: Paul E. McKenney <[email protected]>
> >
> > Acked-by: Masami Hiramatsu (Google) <[email protected]>
>
> Applied, thank you!
>
> Thanx, Paul

Paul, just for confirmation, have you picked these patches on your tree?

Thank you,

>
> > Thank you!
> >
> > >
> > > diff --git a/init/Kconfig b/init/Kconfig
> > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > --- a/init/Kconfig
> > > +++ b/init/Kconfig
> > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > config BOOT_CONFIG_FORCE
> > > bool "Force unconditional bootconfig processing"
> > > depends on BOOT_CONFIG
> > > + default y if BOOT_CONFIG_EMBED
> > > help
> > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > out even when the "bootconfig" kernel-boot parameter is omitted.
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-10 01:10:42

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> On Sun, 8 Jan 2023 20:25:01 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > >
> > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > rather than on the server hardware, firmware, or workload.
> > > > > >
> > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > into that file.
> > > > > >
> > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > (for example) update large numbers of boot loaders.
> > > > >
> > > > > I like this because this is a simple solution. We have another option
> > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > always enable bootconfig.
> > > >
> > > > Glad you like it!
> > > >
> > > > In addition, if the help text is accurate, another shortcoming of
> > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > parameters, and others differ in the order in which the parameters
> > > > are processed.
> > >
> > > Yes, that differences confuse us...
> >
> > I am glad that it is not just me. ;-)
> >
> > I will add words to that effect to the commit log.
> >
> > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > >
> > > > Thank you!
> > > >
> > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > (or at least recommend to enable this)
> > > >
> > > > Like this?
> > >
> > > Yes! Thanks.
> > >
> > > >
> > > > Thanx, Paul
> > > >
> > > > ------------------------------------------------------------------------
> > > >
> > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > Author: Paul E. McKenney <[email protected]>
> > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > >
> > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > >
> > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > will normally be to unconditionally provide the specified kernel-boot
> > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > >
> > > > The old semantics may be obtained by manually overriding this default.
> > > >
> > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > >
> > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> >
> > Applied, thank you!
>
> Paul, just for confirmation, have you picked these patches on your tree?

I have, but if you would prefer to take them, just let me know when you
have pulled them in. It is easy for me to drop them.

Here they are in the -rcu tree:

3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED

git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Thanx, Paul

> Thank you,
>
> >
> > > Thank you!
> > >
> > > >
> > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > --- a/init/Kconfig
> > > > +++ b/init/Kconfig
> > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > config BOOT_CONFIG_FORCE
> > > > bool "Force unconditional bootconfig processing"
> > > > depends on BOOT_CONFIG
> > > > + default y if BOOT_CONFIG_EMBED
> > > > help
> > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > >
> > >
> > > --
> > > Masami Hiramatsu (Google) <[email protected]>
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Mon, 9 Jan 2023 16:07:32 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > On Sun, 8 Jan 2023 20:25:01 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > >
> > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > >
> > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > into that file.
> > > > > > >
> > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > (for example) update large numbers of boot loaders.
> > > > > >
> > > > > > I like this because this is a simple solution. We have another option
> > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > always enable bootconfig.
> > > > >
> > > > > Glad you like it!
> > > > >
> > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > parameters, and others differ in the order in which the parameters
> > > > > are processed.
> > > >
> > > > Yes, that differences confuse us...
> > >
> > > I am glad that it is not just me. ;-)
> > >
> > > I will add words to that effect to the commit log.
> > >
> > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > >
> > > > > Thank you!
> > > > >
> > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > (or at least recommend to enable this)
> > > > >
> > > > > Like this?
> > > >
> > > > Yes! Thanks.
> > > >
> > > > >
> > > > > Thanx, Paul
> > > > >
> > > > > ------------------------------------------------------------------------
> > > > >
> > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > Author: Paul E. McKenney <[email protected]>
> > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > >
> > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > >
> > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > >
> > > > > The old semantics may be obtained by manually overriding this default.
> > > > >
> > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > >
> > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > >
> > > Applied, thank you!
> >
> > Paul, just for confirmation, have you picked these patches on your tree?
>
> I have, but if you would prefer to take them, just let me know when you
> have pulled them in. It is easy for me to drop them.
>
> Here they are in the -rcu tree:
>
> 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
>
> git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Yeah, if it's not hurry, let me pick those to linux-trace tree
(bootconfig/for-next). I would like to consolidate the bootconfig
updates on my tree.

Thanks,

>
> Thanx, Paul
>
> > Thank you,
> >
> > >
> > > > Thank you!
> > > >
> > > > >
> > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > --- a/init/Kconfig
> > > > > +++ b/init/Kconfig
> > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > config BOOT_CONFIG_FORCE
> > > > > bool "Force unconditional bootconfig processing"
> > > > > depends on BOOT_CONFIG
> > > > > + default y if BOOT_CONFIG_EMBED
> > > > > help
> > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > >
> > > >
> > > > --
> > > > Masami Hiramatsu (Google) <[email protected]>
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-10 01:31:14

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> On Mon, 9 Jan 2023 16:07:32 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > >
> > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > >
> > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > >
> > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > into that file.
> > > > > > > >
> > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > >
> > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > always enable bootconfig.
> > > > > >
> > > > > > Glad you like it!
> > > > > >
> > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > parameters, and others differ in the order in which the parameters
> > > > > > are processed.
> > > > >
> > > > > Yes, that differences confuse us...
> > > >
> > > > I am glad that it is not just me. ;-)
> > > >
> > > > I will add words to that effect to the commit log.
> > > >
> > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > >
> > > > > > Thank you!
> > > > > >
> > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > (or at least recommend to enable this)
> > > > > >
> > > > > > Like this?
> > > > >
> > > > > Yes! Thanks.
> > > > >
> > > > > >
> > > > > > Thanx, Paul
> > > > > >
> > > > > > ------------------------------------------------------------------------
> > > > > >
> > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > >
> > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > >
> > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > >
> > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > >
> > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > >
> > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > >
> > > > Applied, thank you!
> > >
> > > Paul, just for confirmation, have you picked these patches on your tree?
> >
> > I have, but if you would prefer to take them, just let me know when you
> > have pulled them in. It is easy for me to drop them.
> >
> > Here they are in the -rcu tree:
> >
> > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
>
> Yeah, if it's not hurry, let me pick those to linux-trace tree
> (bootconfig/for-next). I would like to consolidate the bootconfig
> updates on my tree.

Please go ahead and grab them. Just out of curiosity, are they in time
for the upcoming v6.3 merge window?

Thanx, Paul

> Thanks,
>
> >
> > Thanx, Paul
> >
> > > Thank you,
> > >
> > > >
> > > > > Thank you!
> > > > >
> > > > > >
> > > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > > --- a/init/Kconfig
> > > > > > +++ b/init/Kconfig
> > > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > > config BOOT_CONFIG_FORCE
> > > > > > bool "Force unconditional bootconfig processing"
> > > > > > depends on BOOT_CONFIG
> > > > > > + default y if BOOT_CONFIG_EMBED
> > > > > > help
> > > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > > >
> > > > >
> > > > > --
> > > > > Masami Hiramatsu (Google) <[email protected]>
> > >
> > >
> > > --
> > > Masami Hiramatsu (Google) <[email protected]>
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Mon, 9 Jan 2023 17:09:53 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> > On Mon, 9 Jan 2023 16:07:32 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > >
> > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > >
> > > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > > >
> > > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > > into that file.
> > > > > > > > >
> > > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > > >
> > > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > > always enable bootconfig.
> > > > > > >
> > > > > > > Glad you like it!
> > > > > > >
> > > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > > parameters, and others differ in the order in which the parameters
> > > > > > > are processed.
> > > > > >
> > > > > > Yes, that differences confuse us...
> > > > >
> > > > > I am glad that it is not just me. ;-)
> > > > >
> > > > > I will add words to that effect to the commit log.
> > > > >
> > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > >
> > > > > > > Thank you!
> > > > > > >
> > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > (or at least recommend to enable this)
> > > > > > >
> > > > > > > Like this?
> > > > > >
> > > > > > Yes! Thanks.
> > > > > >
> > > > > > >
> > > > > > > Thanx, Paul
> > > > > > >
> > > > > > > ------------------------------------------------------------------------
> > > > > > >
> > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > >
> > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > >
> > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > >
> > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > >
> > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > >
> > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > >
> > > > > Applied, thank you!
> > > >
> > > > Paul, just for confirmation, have you picked these patches on your tree?
> > >
> > > I have, but if you would prefer to take them, just let me know when you
> > > have pulled them in. It is easy for me to drop them.
> > >
> > > Here they are in the -rcu tree:
> > >
> > > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > >
> > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> >
> > Yeah, if it's not hurry, let me pick those to linux-trace tree
> > (bootconfig/for-next). I would like to consolidate the bootconfig
> > updates on my tree.
>
> Please go ahead and grab them. Just out of curiosity, are they in time
> for the upcoming v6.3 merge window?

Yes, I will do.

Thank you!

>
> Thanx, Paul
>
> > Thanks,
> >
> > >
> > > Thanx, Paul
> > >
> > > > Thank you,
> > > >
> > > > >
> > > > > > Thank you!
> > > > > >
> > > > > > >
> > > > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > > > --- a/init/Kconfig
> > > > > > > +++ b/init/Kconfig
> > > > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > > > config BOOT_CONFIG_FORCE
> > > > > > > bool "Force unconditional bootconfig processing"
> > > > > > > depends on BOOT_CONFIG
> > > > > > > + default y if BOOT_CONFIG_EMBED
> > > > > > > help
> > > > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Masami Hiramatsu (Google) <[email protected]>
> > > >
> > > >
> > > > --
> > > > Masami Hiramatsu (Google) <[email protected]>
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-10 15:43:20

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Tue, Jan 10, 2023 at 11:17:21PM +0900, Masami Hiramatsu wrote:
> On Mon, 9 Jan 2023 17:09:53 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> > > On Mon, 9 Jan 2023 16:07:32 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > >
> > > > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > >
> > > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > >
> > > > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > > > >
> > > > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > > > into that file.
> > > > > > > > > >
> > > > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > > > >
> > > > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > > > always enable bootconfig.
> > > > > > > >
> > > > > > > > Glad you like it!
> > > > > > > >
> > > > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > > > parameters, and others differ in the order in which the parameters
> > > > > > > > are processed.
> > > > > > >
> > > > > > > Yes, that differences confuse us...
> > > > > >
> > > > > > I am glad that it is not just me. ;-)
> > > > > >
> > > > > > I will add words to that effect to the commit log.
> > > > > >
> > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > >
> > > > > > > > Thank you!
> > > > > > > >
> > > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > > (or at least recommend to enable this)
> > > > > > > >
> > > > > > > > Like this?
> > > > > > >
> > > > > > > Yes! Thanks.
> > > > > > >
> > > > > > > >
> > > > > > > > Thanx, Paul
> > > > > > > >
> > > > > > > > ------------------------------------------------------------------------
> > > > > > > >
> > > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > > >
> > > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > > >
> > > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > > >
> > > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > > >
> > > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > >
> > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > >
> > > > > > Applied, thank you!
> > > > >
> > > > > Paul, just for confirmation, have you picked these patches on your tree?
> > > >
> > > > I have, but if you would prefer to take them, just let me know when you
> > > > have pulled them in. It is easy for me to drop them.
> > > >
> > > > Here they are in the -rcu tree:
> > > >
> > > > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > > > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > >
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > >
> > > Yeah, if it's not hurry, let me pick those to linux-trace tree
> > > (bootconfig/for-next). I would like to consolidate the bootconfig
> > > updates on my tree.
> >
> > Please go ahead and grab them. Just out of curiosity, are they in time
> > for the upcoming v6.3 merge window?
>
> Yes, I will do.

Very good, I will drop them from my tree on my next rebase.

Thanx, Paul

2023-01-26 19:26:21

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Tue, Jan 10, 2023 at 07:02:59AM -0800, Paul E. McKenney wrote:
> On Tue, Jan 10, 2023 at 11:17:21PM +0900, Masami Hiramatsu wrote:
> > On Mon, 9 Jan 2023 17:09:53 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> > > > On Mon, 9 Jan 2023 16:07:32 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > > > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > >
> > > > > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > >
> > > > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > > >
> > > > > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > > > > >
> > > > > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > > > > into that file.
> > > > > > > > > > >
> > > > > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > > > > >
> > > > > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > > > > always enable bootconfig.
> > > > > > > > >
> > > > > > > > > Glad you like it!
> > > > > > > > >
> > > > > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > > > > parameters, and others differ in the order in which the parameters
> > > > > > > > > are processed.
> > > > > > > >
> > > > > > > > Yes, that differences confuse us...
> > > > > > >
> > > > > > > I am glad that it is not just me. ;-)
> > > > > > >
> > > > > > > I will add words to that effect to the commit log.
> > > > > > >
> > > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > > >
> > > > > > > > > Thank you!
> > > > > > > > >
> > > > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > > > (or at least recommend to enable this)
> > > > > > > > >
> > > > > > > > > Like this?
> > > > > > > >
> > > > > > > > Yes! Thanks.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > Thanx, Paul
> > > > > > > > >
> > > > > > > > > ------------------------------------------------------------------------
> > > > > > > > >
> > > > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > > > >
> > > > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > > > >
> > > > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > > > >
> > > > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > > > >
> > > > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > > >
> > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > >
> > > > > > > Applied, thank you!
> > > > > >
> > > > > > Paul, just for confirmation, have you picked these patches on your tree?
> > > > >
> > > > > I have, but if you would prefer to take them, just let me know when you
> > > > > have pulled them in. It is easy for me to drop them.
> > > > >
> > > > > Here they are in the -rcu tree:
> > > > >
> > > > > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > > > > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > >
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > >
> > > > Yeah, if it's not hurry, let me pick those to linux-trace tree
> > > > (bootconfig/for-next). I would like to consolidate the bootconfig
> > > > updates on my tree.
> > >
> > > Please go ahead and grab them. Just out of curiosity, are they in time
> > > for the upcoming v6.3 merge window?
> >
> > Yes, I will do.
>
> Very good, I will drop them from my tree on my next rebase.

Apologies for nagging, but I don't see this in -next, so I figured that
I should follow up. Is there some adjustment required to this patch?
If so, please let me know so that I can fix it.

Thanx, Paul

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Thu, 26 Jan 2023 11:26:14 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Tue, Jan 10, 2023 at 07:02:59AM -0800, Paul E. McKenney wrote:
> > On Tue, Jan 10, 2023 at 11:17:21PM +0900, Masami Hiramatsu wrote:
> > > On Mon, 9 Jan 2023 17:09:53 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> > > > > On Mon, 9 Jan 2023 16:07:32 -0800
> > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > >
> > > > > > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > > > > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > >
> > > > > > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > >
> > > > > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > > > >
> > > > > > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > > > > > >
> > > > > > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > > > > > into that file.
> > > > > > > > > > > >
> > > > > > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > > > > > >
> > > > > > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > > > > > always enable bootconfig.
> > > > > > > > > >
> > > > > > > > > > Glad you like it!
> > > > > > > > > >
> > > > > > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > > > > > parameters, and others differ in the order in which the parameters
> > > > > > > > > > are processed.
> > > > > > > > >
> > > > > > > > > Yes, that differences confuse us...
> > > > > > > >
> > > > > > > > I am glad that it is not just me. ;-)
> > > > > > > >
> > > > > > > > I will add words to that effect to the commit log.
> > > > > > > >
> > > > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > > > >
> > > > > > > > > > Thank you!
> > > > > > > > > >
> > > > > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > > > > (or at least recommend to enable this)
> > > > > > > > > >
> > > > > > > > > > Like this?
> > > > > > > > >
> > > > > > > > > Yes! Thanks.
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Thanx, Paul
> > > > > > > > > >
> > > > > > > > > > ------------------------------------------------------------------------
> > > > > > > > > >
> > > > > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > > > > >
> > > > > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > > > > >
> > > > > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > > > > >
> > > > > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > > > > >
> > > > > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > > > >
> > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > >
> > > > > > > > Applied, thank you!
> > > > > > >
> > > > > > > Paul, just for confirmation, have you picked these patches on your tree?
> > > > > >
> > > > > > I have, but if you would prefer to take them, just let me know when you
> > > > > > have pulled them in. It is easy for me to drop them.
> > > > > >
> > > > > > Here they are in the -rcu tree:
> > > > > >
> > > > > > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > > > > > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > >
> > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > >
> > > > > Yeah, if it's not hurry, let me pick those to linux-trace tree
> > > > > (bootconfig/for-next). I would like to consolidate the bootconfig
> > > > > updates on my tree.
> > > >
> > > > Please go ahead and grab them. Just out of curiosity, are they in time
> > > > for the upcoming v6.3 merge window?
> > >
> > > Yes, I will do.
> >
> > Very good, I will drop them from my tree on my next rebase.
>
> Apologies for nagging, but I don't see this in -next, so I figured that
> I should follow up. Is there some adjustment required to this patch?
> If so, please let me know so that I can fix it.

Thanks for following up!
Sorry, it was my mistake to forget it to -next. Let me fix that.


>
> Thanx, Paul


--
Masami Hiramatsu (Google) <[email protected]>

2023-01-31 18:50:22

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Fri, Jan 27, 2023 at 02:57:31PM +0900, Masami Hiramatsu wrote:
> On Thu, 26 Jan 2023 11:26:14 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Tue, Jan 10, 2023 at 07:02:59AM -0800, Paul E. McKenney wrote:
> > > On Tue, Jan 10, 2023 at 11:17:21PM +0900, Masami Hiramatsu wrote:
> > > > On Mon, 9 Jan 2023 17:09:53 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > On Tue, Jan 10, 2023 at 09:54:50AM +0900, Masami Hiramatsu wrote:
> > > > > > On Mon, 9 Jan 2023 16:07:32 -0800
> > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > >
> > > > > > > On Tue, Jan 10, 2023 at 08:56:36AM +0900, Masami Hiramatsu wrote:
> > > > > > > > On Sun, 8 Jan 2023 20:25:01 -0800
> > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > >
> > > > > > > > > On Sun, Jan 08, 2023 at 03:04:25PM +0900, Masami Hiramatsu wrote:
> > > > > > > > > > On Sat, 7 Jan 2023 08:22:02 -0800
> > > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > > >
> > > > > > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > > > > > On Wed, 4 Jan 2023 16:58:38 -0800
> > > > > > > > > > > > "Paul E. McKenney" <[email protected]> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > The BOOT_CONFIG family of Kconfig options allows a bootconfig file
> > > > > > > > > > > > > containing kernel boot parameters to be embedded into an initrd or into
> > > > > > > > > > > > > the kernel itself. This can be extremely useful when deploying kernels
> > > > > > > > > > > > > in cases where some of the boot parameters depend on the kernel version
> > > > > > > > > > > > > rather than on the server hardware, firmware, or workload.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Unfortunately, the "bootconfig" kernel parameter must be specified in
> > > > > > > > > > > > > order to cause the kernel to look for the embedded bootconfig file,
> > > > > > > > > > > > > and it clearly does not help to embed this "bootconfig" kernel parameter
> > > > > > > > > > > > > into that file.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Therefore, provide a new BOOT_CONFIG_FORCE Kconfig option that causes the
> > > > > > > > > > > > > kernel to act as if the "bootconfig" kernel parameter had been specified.
> > > > > > > > > > > > > In other words, kernels built with CONFIG_BOOT_CONFIG_FORCE=y will look
> > > > > > > > > > > > > for the embedded bootconfig file even when the "bootconfig" kernel
> > > > > > > > > > > > > parameter is omitted. This permits kernel-version-dependent kernel
> > > > > > > > > > > > > boot parameters to be embedded into the kernel image without the need to
> > > > > > > > > > > > > (for example) update large numbers of boot loaders.
> > > > > > > > > > > >
> > > > > > > > > > > > I like this because this is a simple solution. We have another option
> > > > > > > > > > > > to specify "bootconfig" in CONFIG_CMDLINE, but it can be overwritten by
> > > > > > > > > > > > bootloader. Thus, it is better to have this option so that user can
> > > > > > > > > > > > always enable bootconfig.
> > > > > > > > > > >
> > > > > > > > > > > Glad you like it!
> > > > > > > > > > >
> > > > > > > > > > > In addition, if the help text is accurate, another shortcoming of
> > > > > > > > > > > CONFIG_CMDLINE is that its semantics vary from one architecture to
> > > > > > > > > > > another. Some have CONFIG_CMDLINE override the boot-loader supplied
> > > > > > > > > > > parameters, and others differ in the order in which the parameters
> > > > > > > > > > > are processed.
> > > > > > > > > >
> > > > > > > > > > Yes, that differences confuse us...
> > > > > > > > >
> > > > > > > > > I am glad that it is not just me. ;-)
> > > > > > > > >
> > > > > > > > > I will add words to that effect to the commit log.
> > > > > > > > >
> > > > > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > > > > >
> > > > > > > > > > > Thank you!
> > > > > > > > > > >
> > > > > > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > > > > > (or at least recommend to enable this)
> > > > > > > > > > >
> > > > > > > > > > > Like this?
> > > > > > > > > >
> > > > > > > > > > Yes! Thanks.
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Thanx, Paul
> > > > > > > > > > >
> > > > > > > > > > > ------------------------------------------------------------------------
> > > > > > > > > > >
> > > > > > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > > > > > >
> > > > > > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > > > > > >
> > > > > > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > > > > > >
> > > > > > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > > > > > >
> > > > > > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > > > > >
> > > > > > > > > > Acked-by: Masami Hiramatsu (Google) <[email protected]>
> > > > > > > > >
> > > > > > > > > Applied, thank you!
> > > > > > > >
> > > > > > > > Paul, just for confirmation, have you picked these patches on your tree?
> > > > > > >
> > > > > > > I have, but if you would prefer to take them, just let me know when you
> > > > > > > have pulled them in. It is easy for me to drop them.
> > > > > > >
> > > > > > > Here they are in the -rcu tree:
> > > > > > >
> > > > > > > 3d9ccc4a8b56e bootconfig: Allow forcing unconditional bootconfig processing
> > > > > > > 68b920592ff67 bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > >
> > > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> > > > > >
> > > > > > Yeah, if it's not hurry, let me pick those to linux-trace tree
> > > > > > (bootconfig/for-next). I would like to consolidate the bootconfig
> > > > > > updates on my tree.
> > > > >
> > > > > Please go ahead and grab them. Just out of curiosity, are they in time
> > > > > for the upcoming v6.3 merge window?
> > > >
> > > > Yes, I will do.
> > >
> > > Very good, I will drop them from my tree on my next rebase.
> >
> > Apologies for nagging, but I don't see this in -next, so I figured that
> > I should follow up. Is there some adjustment required to this patch?
> > If so, please let me know so that I can fix it.
>
> Thanks for following up!
> Sorry, it was my mistake to forget it to -next. Let me fix that.

And I see it now, thank you!

Thanx, Paul

2023-02-24 08:32:11

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

Hi Paul,

On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > (or at least recommend to enable this)
>
> Like this?
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit d09a1505c51a70da38b34ac38062977299aef742
> Author: Paul E. McKenney <[email protected]>
> Date: Sat Jan 7 08:09:22 2023 -0800
>
> bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
>
> When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> will normally be to unconditionally provide the specified kernel-boot
> arguments to the kernel, as opposed to requiring a separately provided
> bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
>
> The old semantics may be obtained by manually overriding this default.
>
> Suggested-by: Masami Hiramatsu <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>
>
> diff --git a/init/Kconfig b/init/Kconfig
> index 0fb19fa0edba9..97a0f14d9020d 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> config BOOT_CONFIG_FORCE
> bool "Force unconditional bootconfig processing"
> depends on BOOT_CONFIG
> + default y if BOOT_CONFIG_EMBED
> help
> With this Kconfig option set, BOOT_CONFIG processing is carried
> out even when the "bootconfig" kernel-boot parameter is omitted.

Thanks for your patch, which is now commit 6ded8a28ed80e4cc
("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").

After this change, an all{mod,yes}config kernel has:

CONFIG_BOOT_CONFIG_FORCE=y
CONFIG_BOOT_CONFIG_EMBED=y
CONFIG_BOOT_CONFIG_EMBED_FILE=""

Will this actually work? I haven't tried booting such a kernel yet.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

Hi Geert,

On Fri, 24 Feb 2023 09:31:50 +0100
Geert Uytterhoeven <[email protected]> wrote:

> Hi Paul,
>
> On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > (or at least recommend to enable this)
> >
> > Like this?
> >
> > Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit d09a1505c51a70da38b34ac38062977299aef742
> > Author: Paul E. McKenney <[email protected]>
> > Date: Sat Jan 7 08:09:22 2023 -0800
> >
> > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> >
> > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > will normally be to unconditionally provide the specified kernel-boot
> > arguments to the kernel, as opposed to requiring a separately provided
> > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> >
> > The old semantics may be obtained by manually overriding this default.
> >
> > Suggested-by: Masami Hiramatsu <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
> >
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 0fb19fa0edba9..97a0f14d9020d 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > config BOOT_CONFIG_FORCE
> > bool "Force unconditional bootconfig processing"
> > depends on BOOT_CONFIG
> > + default y if BOOT_CONFIG_EMBED
> > help
> > With this Kconfig option set, BOOT_CONFIG processing is carried
> > out even when the "bootconfig" kernel-boot parameter is omitted.
>
> Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
>
> After this change, an all{mod,yes}config kernel has:
>
> CONFIG_BOOT_CONFIG_FORCE=y
> CONFIG_BOOT_CONFIG_EMBED=y
> CONFIG_BOOT_CONFIG_EMBED_FILE=""
>
> Will this actually work? I haven't tried booting such a kernel yet.

Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
but do not add the bootconfig file to initrd. You may see below message
on boot log, but kernel boots normally. :)

'bootconfig' found on command line, but no bootconfig found

(Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
will be shown without 'bootconfig' on command line.)

Thank you!

>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds


--
Masami Hiramatsu (Google) <[email protected]>

2023-02-24 16:33:13

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> Hi Geert,
>
> On Fri, 24 Feb 2023 09:31:50 +0100
> Geert Uytterhoeven <[email protected]> wrote:
>
> > Hi Paul,
> >
> > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > (or at least recommend to enable this)
> > >
> > > Like this?
> > >
> > > Thanx, Paul
> > >
> > > ------------------------------------------------------------------------
> > >
> > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > Author: Paul E. McKenney <[email protected]>
> > > Date: Sat Jan 7 08:09:22 2023 -0800
> > >
> > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > >
> > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > will normally be to unconditionally provide the specified kernel-boot
> > > arguments to the kernel, as opposed to requiring a separately provided
> > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > >
> > > The old semantics may be obtained by manually overriding this default.
> > >
> > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > Signed-off-by: Paul E. McKenney <[email protected]>
> > >
> > > diff --git a/init/Kconfig b/init/Kconfig
> > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > --- a/init/Kconfig
> > > +++ b/init/Kconfig
> > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > config BOOT_CONFIG_FORCE
> > > bool "Force unconditional bootconfig processing"
> > > depends on BOOT_CONFIG
> > > + default y if BOOT_CONFIG_EMBED
> > > help
> > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > out even when the "bootconfig" kernel-boot parameter is omitted.
> >
> > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> >
> > After this change, an all{mod,yes}config kernel has:
> >
> > CONFIG_BOOT_CONFIG_FORCE=y
> > CONFIG_BOOT_CONFIG_EMBED=y
> > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> >
> > Will this actually work? I haven't tried booting such a kernel yet.
>
> Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> but do not add the bootconfig file to initrd. You may see below message
> on boot log, but kernel boots normally. :)
>
> 'bootconfig' found on command line, but no bootconfig found
>
> (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> will be shown without 'bootconfig' on command line.)

I just tried it again, and for me it just silently ignores the bootconfig
setup. Which is what I recall happening when I tried it when creating
the patch.

Here is the .config file pieces of interest:

CONFIG_BOOT_CONFIG=y
CONFIG_BOOT_CONFIG_FORCE=y
CONFIG_BOOT_CONFIG_EMBED=y
CONFIG_BOOT_CONFIG_EMBED_FILE=""

Anyone else seeing something different?

Thanx, Paul

> Thank you!
>
> >
> > Gr{oetje,eeting}s,
> >
> > Geert
> >
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> >
> > In personal conversations with technical people, I call myself a hacker. But
> > when I'm talking to journalists I just say "programmer" or something like that.
> > -- Linus Torvalds
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Fri, 24 Feb 2023 08:33:07 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> > Hi Geert,
> >
> > On Fri, 24 Feb 2023 09:31:50 +0100
> > Geert Uytterhoeven <[email protected]> wrote:
> >
> > > Hi Paul,
> > >
> > > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > (or at least recommend to enable this)
> > > >
> > > > Like this?
> > > >
> > > > Thanx, Paul
> > > >
> > > > ------------------------------------------------------------------------
> > > >
> > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > Author: Paul E. McKenney <[email protected]>
> > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > >
> > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > >
> > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > will normally be to unconditionally provide the specified kernel-boot
> > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > >
> > > > The old semantics may be obtained by manually overriding this default.
> > > >
> > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > >
> > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > --- a/init/Kconfig
> > > > +++ b/init/Kconfig
> > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > config BOOT_CONFIG_FORCE
> > > > bool "Force unconditional bootconfig processing"
> > > > depends on BOOT_CONFIG
> > > > + default y if BOOT_CONFIG_EMBED
> > > > help
> > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > >
> > > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> > >
> > > After this change, an all{mod,yes}config kernel has:
> > >
> > > CONFIG_BOOT_CONFIG_FORCE=y
> > > CONFIG_BOOT_CONFIG_EMBED=y
> > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > >
> > > Will this actually work? I haven't tried booting such a kernel yet.
> >
> > Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> > but do not add the bootconfig file to initrd. You may see below message
> > on boot log, but kernel boots normally. :)
> >
> > 'bootconfig' found on command line, but no bootconfig found
> >
> > (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> > will be shown without 'bootconfig' on command line.)
>
> I just tried it again, and for me it just silently ignores the bootconfig
> setup. Which is what I recall happening when I tried it when creating
> the patch.
>
> Here is the .config file pieces of interest:
>
> CONFIG_BOOT_CONFIG=y
> CONFIG_BOOT_CONFIG_FORCE=y
> CONFIG_BOOT_CONFIG_EMBED=y
> CONFIG_BOOT_CONFIG_EMBED_FILE=""
>
> Anyone else seeing something different?

Hmm, from the code, I think you'll see that message in early console log.

In init/main.c:

----
#ifdef CONFIG_BOOT_CONFIG
/* Is bootconfig on command line? */
static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
static size_t initargs_offs;
#else
----
And
----
static void __init setup_boot_config(void)
{
...
strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
bootconfig_params);

if (IS_ERR(err) || !bootconfig_found)
return;

/* parse_args() stops at the next param of '--' and returns an address */
if (err)
initargs_offs = err - tmp_cmdline;

if (!data) {
pr_err("'bootconfig' found on command line, but no bootconfig found\n");
return;
}
----

Thus, if CONFIG_BOOT_CONFIG_FORCE=y, the process passes the below check

if (IS_ERR(err) || !bootconfig_found)
return;

But since we have an empty 'data', the error should be printed.

Thank you,

>
> Thanx, Paul
>
> > Thank you!
> >
> > >
> > > Gr{oetje,eeting}s,
> > >
> > > Geert
> > >
> > > --
> > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> > >
> > > In personal conversations with technical people, I call myself a hacker. But
> > > when I'm talking to journalists I just say "programmer" or something like that.
> > > -- Linus Torvalds
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>

2023-02-25 01:21:46

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Sat, Feb 25, 2023 at 09:58:11AM +0900, Masami Hiramatsu wrote:
> On Fri, 24 Feb 2023 08:33:07 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> > > Hi Geert,
> > >
> > > On Fri, 24 Feb 2023 09:31:50 +0100
> > > Geert Uytterhoeven <[email protected]> wrote:
> > >
> > > > Hi Paul,
> > > >
> > > > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > (or at least recommend to enable this)
> > > > >
> > > > > Like this?
> > > > >
> > > > > Thanx, Paul
> > > > >
> > > > > ------------------------------------------------------------------------
> > > > >
> > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > Author: Paul E. McKenney <[email protected]>
> > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > >
> > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > >
> > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > >
> > > > > The old semantics may be obtained by manually overriding this default.
> > > > >
> > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > >
> > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > --- a/init/Kconfig
> > > > > +++ b/init/Kconfig
> > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > config BOOT_CONFIG_FORCE
> > > > > bool "Force unconditional bootconfig processing"
> > > > > depends on BOOT_CONFIG
> > > > > + default y if BOOT_CONFIG_EMBED
> > > > > help
> > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > >
> > > > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > > > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> > > >
> > > > After this change, an all{mod,yes}config kernel has:
> > > >
> > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > >
> > > > Will this actually work? I haven't tried booting such a kernel yet.
> > >
> > > Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> > > but do not add the bootconfig file to initrd. You may see below message
> > > on boot log, but kernel boots normally. :)
> > >
> > > 'bootconfig' found on command line, but no bootconfig found
> > >
> > > (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> > > will be shown without 'bootconfig' on command line.)
> >
> > I just tried it again, and for me it just silently ignores the bootconfig
> > setup. Which is what I recall happening when I tried it when creating
> > the patch.
> >
> > Here is the .config file pieces of interest:
> >
> > CONFIG_BOOT_CONFIG=y
> > CONFIG_BOOT_CONFIG_FORCE=y
> > CONFIG_BOOT_CONFIG_EMBED=y
> > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> >
> > Anyone else seeing something different?
>
> Hmm, from the code, I think you'll see that message in early console log.
>
> In init/main.c:
>
> ----
> #ifdef CONFIG_BOOT_CONFIG
> /* Is bootconfig on command line? */
> static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> static size_t initargs_offs;
> #else
> ----
> And
> ----
> static void __init setup_boot_config(void)
> {
> ...
> strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
> bootconfig_params);
>
> if (IS_ERR(err) || !bootconfig_found)
> return;
>
> /* parse_args() stops at the next param of '--' and returns an address */
> if (err)
> initargs_offs = err - tmp_cmdline;
>
> if (!data) {
> pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> return;
> }
> ----
>
> Thus, if CONFIG_BOOT_CONFIG_FORCE=y, the process passes the below check
>
> if (IS_ERR(err) || !bootconfig_found)
> return;
>
> But since we have an empty 'data', the error should be printed.

And you are quite right, the runs without data files did get me this:

'bootconfig' found on command line, but no bootconfig found

Please accept my apologies for my confusion.

Thanx, Paul

> Thank you,
>
> >
> > Thanx, Paul
> >
> > > Thank you!
> > >
> > > >
> > > > Gr{oetje,eeting}s,
> > > >
> > > > Geert
> > > >
> > > > --
> > > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> > > >
> > > > In personal conversations with technical people, I call myself a hacker. But
> > > > when I'm talking to journalists I just say "programmer" or something like that.
> > > > -- Linus Torvalds
> > >
> > >
> > > --
> > > Masami Hiramatsu (Google) <[email protected]>
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Fri, 24 Feb 2023 17:19:10 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Sat, Feb 25, 2023 at 09:58:11AM +0900, Masami Hiramatsu wrote:
> > On Fri, 24 Feb 2023 08:33:07 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> > > > Hi Geert,
> > > >
> > > > On Fri, 24 Feb 2023 09:31:50 +0100
> > > > Geert Uytterhoeven <[email protected]> wrote:
> > > >
> > > > > Hi Paul,
> > > > >
> > > > > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > (or at least recommend to enable this)
> > > > > >
> > > > > > Like this?
> > > > > >
> > > > > > Thanx, Paul
> > > > > >
> > > > > > ------------------------------------------------------------------------
> > > > > >
> > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > >
> > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > >
> > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > >
> > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > >
> > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > >
> > > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > > --- a/init/Kconfig
> > > > > > +++ b/init/Kconfig
> > > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > > config BOOT_CONFIG_FORCE
> > > > > > bool "Force unconditional bootconfig processing"
> > > > > > depends on BOOT_CONFIG
> > > > > > + default y if BOOT_CONFIG_EMBED
> > > > > > help
> > > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > > >
> > > > > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > > > > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> > > > >
> > > > > After this change, an all{mod,yes}config kernel has:
> > > > >
> > > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > > >
> > > > > Will this actually work? I haven't tried booting such a kernel yet.
> > > >
> > > > Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> > > > but do not add the bootconfig file to initrd. You may see below message
> > > > on boot log, but kernel boots normally. :)
> > > >
> > > > 'bootconfig' found on command line, but no bootconfig found
> > > >
> > > > (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> > > > will be shown without 'bootconfig' on command line.)
> > >
> > > I just tried it again, and for me it just silently ignores the bootconfig
> > > setup. Which is what I recall happening when I tried it when creating
> > > the patch.
> > >
> > > Here is the .config file pieces of interest:
> > >
> > > CONFIG_BOOT_CONFIG=y
> > > CONFIG_BOOT_CONFIG_FORCE=y
> > > CONFIG_BOOT_CONFIG_EMBED=y
> > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > >
> > > Anyone else seeing something different?
> >
> > Hmm, from the code, I think you'll see that message in early console log.
> >
> > In init/main.c:
> >
> > ----
> > #ifdef CONFIG_BOOT_CONFIG
> > /* Is bootconfig on command line? */
> > static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> > static size_t initargs_offs;
> > #else
> > ----
> > And
> > ----
> > static void __init setup_boot_config(void)
> > {
> > ...
> > strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> > err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
> > bootconfig_params);
> >
> > if (IS_ERR(err) || !bootconfig_found)
> > return;
> >
> > /* parse_args() stops at the next param of '--' and returns an address */
> > if (err)
> > initargs_offs = err - tmp_cmdline;
> >
> > if (!data) {
> > pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> > return;
> > }
> > ----
> >
> > Thus, if CONFIG_BOOT_CONFIG_FORCE=y, the process passes the below check
> >
> > if (IS_ERR(err) || !bootconfig_found)
> > return;
> >
> > But since we have an empty 'data', the error should be printed.
>
> And you are quite right, the runs without data files did get me this:
>
> 'bootconfig' found on command line, but no bootconfig found
>
> Please accept my apologies for my confusion.

No problem :), so should we skip this message if CONFIG_BOOT_CONFIG_FORCE=y,
because user may not pass 'bootconfig'?

Or, may be we can make it;

"Skip bootconfig, because no bootconfig data found."

so that user can notice they forget to set up bootconfig data?

Thank you,


>
> Thanx, Paul
>
> > Thank you,
> >
> > >
> > > Thanx, Paul
> > >
> > > > Thank you!
> > > >
> > > > >
> > > > > Gr{oetje,eeting}s,
> > > > >
> > > > > Geert
> > > > >
> > > > > --
> > > > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> > > > >
> > > > > In personal conversations with technical people, I call myself a hacker. But
> > > > > when I'm talking to journalists I just say "programmer" or something like that.
> > > > > -- Linus Torvalds
> > > >
> > > >
> > > > --
> > > > Masami Hiramatsu (Google) <[email protected]>
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>

2023-02-27 16:56:37

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Mon, Feb 27, 2023 at 08:16:32AM +0900, Masami Hiramatsu wrote:
> On Fri, 24 Feb 2023 17:19:10 -0800
> "Paul E. McKenney" <[email protected]> wrote:
>
> > On Sat, Feb 25, 2023 at 09:58:11AM +0900, Masami Hiramatsu wrote:
> > > On Fri, 24 Feb 2023 08:33:07 -0800
> > > "Paul E. McKenney" <[email protected]> wrote:
> > >
> > > > On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> > > > > Hi Geert,
> > > > >
> > > > > On Fri, 24 Feb 2023 09:31:50 +0100
> > > > > Geert Uytterhoeven <[email protected]> wrote:
> > > > >
> > > > > > Hi Paul,
> > > > > >
> > > > > > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > (or at least recommend to enable this)
> > > > > > >
> > > > > > > Like this?
> > > > > > >
> > > > > > > Thanx, Paul
> > > > > > >
> > > > > > > ------------------------------------------------------------------------
> > > > > > >
> > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > >
> > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > >
> > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > >
> > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > >
> > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > >
> > > > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > > > --- a/init/Kconfig
> > > > > > > +++ b/init/Kconfig
> > > > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > > > config BOOT_CONFIG_FORCE
> > > > > > > bool "Force unconditional bootconfig processing"
> > > > > > > depends on BOOT_CONFIG
> > > > > > > + default y if BOOT_CONFIG_EMBED
> > > > > > > help
> > > > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > > > >
> > > > > > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > > > > > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> > > > > >
> > > > > > After this change, an all{mod,yes}config kernel has:
> > > > > >
> > > > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > > > >
> > > > > > Will this actually work? I haven't tried booting such a kernel yet.
> > > > >
> > > > > Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> > > > > but do not add the bootconfig file to initrd. You may see below message
> > > > > on boot log, but kernel boots normally. :)
> > > > >
> > > > > 'bootconfig' found on command line, but no bootconfig found
> > > > >
> > > > > (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> > > > > will be shown without 'bootconfig' on command line.)
> > > >
> > > > I just tried it again, and for me it just silently ignores the bootconfig
> > > > setup. Which is what I recall happening when I tried it when creating
> > > > the patch.
> > > >
> > > > Here is the .config file pieces of interest:
> > > >
> > > > CONFIG_BOOT_CONFIG=y
> > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > >
> > > > Anyone else seeing something different?
> > >
> > > Hmm, from the code, I think you'll see that message in early console log.
> > >
> > > In init/main.c:
> > >
> > > ----
> > > #ifdef CONFIG_BOOT_CONFIG
> > > /* Is bootconfig on command line? */
> > > static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> > > static size_t initargs_offs;
> > > #else
> > > ----
> > > And
> > > ----
> > > static void __init setup_boot_config(void)
> > > {
> > > ...
> > > strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> > > err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
> > > bootconfig_params);
> > >
> > > if (IS_ERR(err) || !bootconfig_found)
> > > return;
> > >
> > > /* parse_args() stops at the next param of '--' and returns an address */
> > > if (err)
> > > initargs_offs = err - tmp_cmdline;
> > >
> > > if (!data) {
> > > pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> > > return;
> > > }
> > > ----
> > >
> > > Thus, if CONFIG_BOOT_CONFIG_FORCE=y, the process passes the below check
> > >
> > > if (IS_ERR(err) || !bootconfig_found)
> > > return;
> > >
> > > But since we have an empty 'data', the error should be printed.
> >
> > And you are quite right, the runs without data files did get me this:
> >
> > 'bootconfig' found on command line, but no bootconfig found
> >
> > Please accept my apologies for my confusion.
>
> No problem :), so should we skip this message if CONFIG_BOOT_CONFIG_FORCE=y,
> because user may not pass 'bootconfig'?
>
> Or, may be we can make it;
>
> "Skip bootconfig, because no bootconfig data found."
>
> so that user can notice they forget to set up bootconfig data?

Good point, the current message could be quite confusing. Me, I already
knew what was happening, so I just looked for the change in console-log
output. ;-)

How about something like this?

"No bootconfig data provided, so skipping bootconfig"

But as you say, keeping the current message in kernels that have been
built with CONFIG_BOOT_CONFIG_FORCE=n.

Thanx, Paul

> Thank you,
>
>
> >
> > Thanx, Paul
> >
> > > Thank you,
> > >
> > > >
> > > > Thanx, Paul
> > > >
> > > > > Thank you!
> > > > >
> > > > > >
> > > > > > Gr{oetje,eeting}s,
> > > > > >
> > > > > > Geert
> > > > > >
> > > > > > --
> > > > > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> > > > > >
> > > > > > In personal conversations with technical people, I call myself a hacker. But
> > > > > > when I'm talking to journalists I just say "programmer" or something like that.
> > > > > > -- Linus Torvalds
> > > > >
> > > > >
> > > > > --
> > > > > Masami Hiramatsu (Google) <[email protected]>
> > >
> > >
> > > --
> > > Masami Hiramatsu (Google) <[email protected]>
>
>
> --
> Masami Hiramatsu (Google) <[email protected]>

Subject: Re: [PATCH RFC bootconfig] Allow forcing unconditional bootconfig processing

On Mon, 27 Feb 2023 08:56:28 -0800
"Paul E. McKenney" <[email protected]> wrote:

> On Mon, Feb 27, 2023 at 08:16:32AM +0900, Masami Hiramatsu wrote:
> > On Fri, 24 Feb 2023 17:19:10 -0800
> > "Paul E. McKenney" <[email protected]> wrote:
> >
> > > On Sat, Feb 25, 2023 at 09:58:11AM +0900, Masami Hiramatsu wrote:
> > > > On Fri, 24 Feb 2023 08:33:07 -0800
> > > > "Paul E. McKenney" <[email protected]> wrote:
> > > >
> > > > > On Sat, Feb 25, 2023 at 01:13:06AM +0900, Masami Hiramatsu wrote:
> > > > > > Hi Geert,
> > > > > >
> > > > > > On Fri, 24 Feb 2023 09:31:50 +0100
> > > > > > Geert Uytterhoeven <[email protected]> wrote:
> > > > > >
> > > > > > > Hi Paul,
> > > > > > >
> > > > > > > On Sat, Jan 7, 2023 at 5:33 PM Paul E. McKenney <[email protected]> wrote:
> > > > > > > > On Sun, Jan 08, 2023 at 12:22:15AM +0900, Masami Hiramatsu wrote:
> > > > > > > > > BTW, maybe CONFIG_BOOT_CONFIG_EMBED is better to select this.
> > > > > > > > > (or at least recommend to enable this)
> > > > > > > >
> > > > > > > > Like this?
> > > > > > > >
> > > > > > > > Thanx, Paul
> > > > > > > >
> > > > > > > > ------------------------------------------------------------------------
> > > > > > > >
> > > > > > > > commit d09a1505c51a70da38b34ac38062977299aef742
> > > > > > > > Author: Paul E. McKenney <[email protected]>
> > > > > > > > Date: Sat Jan 7 08:09:22 2023 -0800
> > > > > > > >
> > > > > > > > bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED
> > > > > > > >
> > > > > > > > When a kernel is built with CONFIG_BOOT_CONFIG_EMBED=y, the intention
> > > > > > > > will normally be to unconditionally provide the specified kernel-boot
> > > > > > > > arguments to the kernel, as opposed to requiring a separately provided
> > > > > > > > bootconfig parameter. Therefore, make the BOOT_CONFIG_FORCE Kconfig
> > > > > > > > option default to y in kernels built with CONFIG_BOOT_CONFIG_EMBED=y.
> > > > > > > >
> > > > > > > > The old semantics may be obtained by manually overriding this default.
> > > > > > > >
> > > > > > > > Suggested-by: Masami Hiramatsu <[email protected]>
> > > > > > > > Signed-off-by: Paul E. McKenney <[email protected]>
> > > > > > > >
> > > > > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > > > > index 0fb19fa0edba9..97a0f14d9020d 100644
> > > > > > > > --- a/init/Kconfig
> > > > > > > > +++ b/init/Kconfig
> > > > > > > > @@ -1379,6 +1379,7 @@ config BOOT_CONFIG
> > > > > > > > config BOOT_CONFIG_FORCE
> > > > > > > > bool "Force unconditional bootconfig processing"
> > > > > > > > depends on BOOT_CONFIG
> > > > > > > > + default y if BOOT_CONFIG_EMBED
> > > > > > > > help
> > > > > > > > With this Kconfig option set, BOOT_CONFIG processing is carried
> > > > > > > > out even when the "bootconfig" kernel-boot parameter is omitted.
> > > > > > >
> > > > > > > Thanks for your patch, which is now commit 6ded8a28ed80e4cc
> > > > > > > ("bootconfig: Default BOOT_CONFIG_FORCE to y if BOOT_CONFIG_EMBED").
> > > > > > >
> > > > > > > After this change, an all{mod,yes}config kernel has:
> > > > > > >
> > > > > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > > > > >
> > > > > > > Will this actually work? I haven't tried booting such a kernel yet.
> > > > > >
> > > > > > Yeah, good question. It is same as when you boot the kernel with 'bootconfig'
> > > > > > but do not add the bootconfig file to initrd. You may see below message
> > > > > > on boot log, but kernel boots normally. :)
> > > > > >
> > > > > > 'bootconfig' found on command line, but no bootconfig found
> > > > > >
> > > > > > (Maybe it is better to fix the message, because if BOOT_CONFIG_FORCE=y, this
> > > > > > will be shown without 'bootconfig' on command line.)
> > > > >
> > > > > I just tried it again, and for me it just silently ignores the bootconfig
> > > > > setup. Which is what I recall happening when I tried it when creating
> > > > > the patch.
> > > > >
> > > > > Here is the .config file pieces of interest:
> > > > >
> > > > > CONFIG_BOOT_CONFIG=y
> > > > > CONFIG_BOOT_CONFIG_FORCE=y
> > > > > CONFIG_BOOT_CONFIG_EMBED=y
> > > > > CONFIG_BOOT_CONFIG_EMBED_FILE=""
> > > > >
> > > > > Anyone else seeing something different?
> > > >
> > > > Hmm, from the code, I think you'll see that message in early console log.
> > > >
> > > > In init/main.c:
> > > >
> > > > ----
> > > > #ifdef CONFIG_BOOT_CONFIG
> > > > /* Is bootconfig on command line? */
> > > > static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> > > > static size_t initargs_offs;
> > > > #else
> > > > ----
> > > > And
> > > > ----
> > > > static void __init setup_boot_config(void)
> > > > {
> > > > ...
> > > > strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> > > > err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
> > > > bootconfig_params);
> > > >
> > > > if (IS_ERR(err) || !bootconfig_found)
> > > > return;
> > > >
> > > > /* parse_args() stops at the next param of '--' and returns an address */
> > > > if (err)
> > > > initargs_offs = err - tmp_cmdline;
> > > >
> > > > if (!data) {
> > > > pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> > > > return;
> > > > }
> > > > ----
> > > >
> > > > Thus, if CONFIG_BOOT_CONFIG_FORCE=y, the process passes the below check
> > > >
> > > > if (IS_ERR(err) || !bootconfig_found)
> > > > return;
> > > >
> > > > But since we have an empty 'data', the error should be printed.
> > >
> > > And you are quite right, the runs without data files did get me this:
> > >
> > > 'bootconfig' found on command line, but no bootconfig found
> > >
> > > Please accept my apologies for my confusion.
> >
> > No problem :), so should we skip this message if CONFIG_BOOT_CONFIG_FORCE=y,
> > because user may not pass 'bootconfig'?
> >
> > Or, may be we can make it;
> >
> > "Skip bootconfig, because no bootconfig data found."
> >
> > so that user can notice they forget to set up bootconfig data?
>
> Good point, the current message could be quite confusing. Me, I already
> knew what was happening, so I just looked for the change in console-log
> output. ;-)
>
> How about something like this?
>
> "No bootconfig data provided, so skipping bootconfig"
>
> But as you say, keeping the current message in kernels that have been
> built with CONFIG_BOOT_CONFIG_FORCE=n.

That sounds good to me. OK, let me update that.

Thank you,

>
> Thanx, Paul
>
> > Thank you,
> >
> >
> > >
> > > Thanx, Paul
> > >
> > > > Thank you,
> > > >
> > > > >
> > > > > Thanx, Paul
> > > > >
> > > > > > Thank you!
> > > > > >
> > > > > > >
> > > > > > > Gr{oetje,eeting}s,
> > > > > > >
> > > > > > > Geert
> > > > > > >
> > > > > > > --
> > > > > > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> > > > > > >
> > > > > > > In personal conversations with technical people, I call myself a hacker. But
> > > > > > > when I'm talking to journalists I just say "programmer" or something like that.
> > > > > > > -- Linus Torvalds
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Masami Hiramatsu (Google) <[email protected]>
> > > >
> > > >
> > > > --
> > > > Masami Hiramatsu (Google) <[email protected]>
> >
> >
> > --
> > Masami Hiramatsu (Google) <[email protected]>


--
Masami Hiramatsu (Google) <[email protected]>