[0/2] bootconfig: Support early options in embedded config

Message ID 20231121231342.193646-1-oss@malat.biz
Headers
Series bootconfig: Support early options in embedded config |

Message

Petr Malat Nov. 21, 2023, 11:13 p.m. UTC
  These 2 patches add a support for specifying early options in embedded
bootconfig and merging embedded and initrd bootconfig into one.

To allow handling of early options, it's necessary to eliminate allocations
from embedded bootconfig handling, which can be done by parsing the config
data in place and allocating xbc_nodes array statically.

Later, when initrd is available, it either replaces embedded data or is
appended to them. To append initrd data, it's necessary to relocate already
parsed data to a bigger memory chunk, but that's not a problem, because
xbc_node structure uses offsets and not absolute pointers.

Also, update the documentation to make users aware early options can't be
configured in the initrd.
  

Comments

Paul E. McKenney Nov. 22, 2023, 11:34 p.m. UTC | #1
On Wed, Nov 22, 2023 at 12:13:40AM +0100, Petr Malat wrote:
> These 2 patches add a support for specifying early options in embedded
> bootconfig and merging embedded and initrd bootconfig into one.
> 
> To allow handling of early options, it's necessary to eliminate allocations
> from embedded bootconfig handling, which can be done by parsing the config
> data in place and allocating xbc_nodes array statically.
> 
> Later, when initrd is available, it either replaces embedded data or is
> appended to them. To append initrd data, it's necessary to relocate already
> parsed data to a bigger memory chunk, but that's not a problem, because
> xbc_node structure uses offsets and not absolute pointers.
> 
> Also, update the documentation to make users aware early options can't be
> configured in the initrd.

Nice!!!

For the series:

Tested-by: Paul E. McKenney <paulmck@kernel.org>

(My setup isn't friendly with initrd bootconfig, so I tested this only for
the embedded bootconfig parameters.)

							Thanx, Paul
  
Masami Hiramatsu (Google) Nov. 23, 2023, 1:58 a.m. UTC | #2
Hi Petr,

Thanks for the patch.

On Wed, 22 Nov 2023 00:13:40 +0100
Petr Malat <oss@malat.biz> wrote:

> These 2 patches add a support for specifying early options in embedded
> bootconfig and merging embedded and initrd bootconfig into one.
> 
> To allow handling of early options, it's necessary to eliminate allocations
> from embedded bootconfig handling, which can be done by parsing the config
> data in place and allocating xbc_nodes array statically.

Hm, my concern is that this can introduce some sort of overhead to parse
the bootconfig.

> 
> Later, when initrd is available, it either replaces embedded data or is
> appended to them. To append initrd data, it's necessary to relocate already
> parsed data to a bigger memory chunk, but that's not a problem, because
> xbc_node structure uses offsets and not absolute pointers.

However, as you did on this series, it is OK that it does an additional parse
for the initrd bootconfig (do not parse twice)

Let me comment your patch.

Thanks!

> 
> Also, update the documentation to make users aware early options can't be
> configured in the initrd.
> 
>