mbox series

[v5,0/3] x86/boot: Introduce the kernel_info et consortes

Message ID 20191104151354.28145-1-daniel.kiper@oracle.com (mailing list archive)
Headers show
Series x86/boot: Introduce the kernel_info et consortes | expand

Message

Daniel Kiper Nov. 4, 2019, 3:13 p.m. UTC
Hi,

Due to very limited space in the setup_header this patch series introduces new
kernel_info struct which will be used to convey information from the kernel to
the bootloader. This way the boot protocol can be extended regardless of the
setup_header limitations. Additionally, the patch series introduces some
convenience features like the setup_indirect struct and the
kernel_info.setup_type_max field.

Daniel

 Documentation/x86/boot.rst             | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/boot/Makefile                 |   2 +-
 arch/x86/boot/compressed/Makefile      |   4 +-
 arch/x86/boot/compressed/kaslr.c       |  12 ++++++
 arch/x86/boot/compressed/kernel_info.S |  22 ++++++++++
 arch/x86/boot/header.S                 |   3 +-
 arch/x86/boot/tools/build.c            |   5 +++
 arch/x86/include/uapi/asm/bootparam.h  |  16 +++++++-
 arch/x86/kernel/e820.c                 |  11 +++++
 arch/x86/kernel/kdebugfs.c             |  20 +++++++--
 arch/x86/kernel/ksysfs.c               |  30 ++++++++++----
 arch/x86/kernel/setup.c                |   4 ++
 arch/x86/mm/ioremap.c                  |  11 +++++
 13 files changed, 298 insertions(+), 16 deletions(-)

Daniel Kiper (3):
      x86/boot: Introduce the kernel_info
      x86/boot: Introduce the kernel_info.setup_type_max
      x86/boot: Introduce the setup_indirect

Comments

H. Peter Anvin Nov. 5, 2019, 9:40 p.m. UTC | #1
On 2019-11-04 07:13, Daniel Kiper wrote:
> Hi,
> 
> Due to very limited space in the setup_header this patch series introduces new
> kernel_info struct which will be used to convey information from the kernel to
> the bootloader. This way the boot protocol can be extended regardless of the
> setup_header limitations. Additionally, the patch series introduces some
> convenience features like the setup_indirect struct and the
> kernel_info.setup_type_max field.
> 
> Daniel
> 

Looks great!  Ship it!

Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>

	-hpa
Borislav Petkov Nov. 6, 2019, 5:03 p.m. UTC | #2
On Mon, Nov 04, 2019 at 04:13:51PM +0100, Daniel Kiper wrote:
> Hi,
> 
> Due to very limited space in the setup_header this patch series introduces new
> kernel_info struct which will be used to convey information from the kernel to
> the bootloader. This way the boot protocol can be extended regardless of the
> setup_header limitations. Additionally, the patch series introduces some
> convenience features like the setup_indirect struct and the
> kernel_info.setup_type_max field.

That's all fine and dandy but I'm missing an example about what that'll
be used for, in practice.

Thx.
H. Peter Anvin Nov. 6, 2019, 5:56 p.m. UTC | #3
On November 6, 2019 9:03:33 AM PST, Borislav Petkov <bp@alien8.de> wrote:
>On Mon, Nov 04, 2019 at 04:13:51PM +0100, Daniel Kiper wrote:
>> Hi,
>> 
>> Due to very limited space in the setup_header this patch series
>introduces new
>> kernel_info struct which will be used to convey information from the
>kernel to
>> the bootloader. This way the boot protocol can be extended regardless
>of the
>> setup_header limitations. Additionally, the patch series introduces
>some
>> convenience features like the setup_indirect struct and the
>> kernel_info.setup_type_max field.
>
>That's all fine and dandy but I'm missing an example about what that'll
>be used for, in practice.
>
>Thx.

For one thing, we already have people asking for more than 4 GiB worth of initramfs, and especially with initramfs that huge it would make a *lot* of sense to allow loading it in chunks without having to concatenate them. I have been asking for a long time for initramfs creators to split the kernel-dependent and kernel independent parts into separate initramfs modules.
Borislav Petkov Nov. 6, 2019, 7:43 p.m. UTC | #4
On Wed, Nov 06, 2019 at 09:56:48AM -0800, hpa@zytor.com wrote:
> For one thing, we already have people asking for more than 4 GiB
> worth of initramfs, and especially with initramfs that huge it would
> make a *lot* of sense to allow loading it in chunks without having to
> concatenate them.

Yeah, tglx gave me his use case on IRC where they have the rootfs in the
initrd and how they would hit the limit when the rootfs has a bunch of
debug libs etc tools, which would blow up its size.

> I have been asking for a long time for initramfs creators to split the
> kernel-dependent and kernel independent parts into separate initramfs
> modules.

Right.

Thx.
Daniel Kiper Nov. 7, 2019, 11:31 a.m. UTC | #5
On Wed, Nov 06, 2019 at 09:56:48AM -0800, hpa@zytor.com wrote:
> On November 6, 2019 9:03:33 AM PST, Borislav Petkov <bp@alien8.de> wrote:
> >On Mon, Nov 04, 2019 at 04:13:51PM +0100, Daniel Kiper wrote:
> >> Hi,
> >>
> >> Due to very limited space in the setup_header this patch series introduces new
> >> kernel_info struct which will be used to convey information from the kernel to
> >> the bootloader. This way the boot protocol can be extended regardless of the
> >> setup_header limitations. Additionally, the patch series introduces some
> >> convenience features like the setup_indirect struct and the
> >> kernel_info.setup_type_max field.
> >
> >That's all fine and dandy but I'm missing an example about what that'll
> >be used for, in practice.
> >
> >Thx.
>
> For one thing, we already have people asking for more than 4 GiB worth
> of initramfs, and especially with initramfs that huge it would make a
> *lot* of sense to allow loading it in chunks without having to
> concatenate them. I have been asking for a long time for initramfs
> creators to split the kernel-dependent and kernel independent parts
> into separate initramfs modules.

Another user of this patchset is the TrenchBoot project on which we are
working on. We have to introduce separate entry point for Intel TXT MLE
startup code. That is why we need the kernel_info struct.

Daniel