Re: [PATCH 15/15] riscv: disable the EFI PECOFF header for M-mode

From: Christoph Hellwig
Date: Wed Aug 21 2019 - 03:12:09 EST


On Tue, Aug 20, 2019 at 09:14:41PM -0700, Troy Benjegerdes wrote:
>
>
> > On Aug 13, 2019, at 8:47 AM, Christoph Hellwig <hch@xxxxxx> wrote:
> >
> > No point in bloating the kernel image with a bootloader header if
> > we run bare metal.
>
> I would say the same for S-mode. EFI booting should be an option, not
> a requirement. I have M-mode U-boot working with bootelf to start BBL,
> and at some point, Iâm hoping we can have a M-mode linux kernel be
> the SBI provider for S-mode kernels, which seem most logical to me
> to start using the vmlinux elf binaries using something like kexec()

Strictly speaking we could just add another option for the header so
that you could also disable it for S-mode. But then again the header
is not very harmful, as you don't have to use it. It just eats up
a little more kernel space. And as that aspace is very tight for my
M-mode target (the Kendryte KD210) and it is totally pointless for
M-mode I just remove it there.

The idea of using M-mode Linux as the SBI sounds cool.