Re: [PATCH v7 00/12] EFI Specific Purpose Memory Support

From: Dan Williams
Date: Wed Oct 16 2019 - 11:34:11 EST


On Tue, Oct 15, 2019 at 11:55 PM Ard Biesheuvel
<ard.biesheuvel@xxxxxxxxxx> wrote:
>
> On Wed, 16 Oct 2019 at 03:13, Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> >
> > Changes since v6 [1]:
> > - Collect Ard's ack / review on patches 5-7, but not on patch 4 since it
> > needed a non-trivial rework for linker error reported by the 0day robot.
> >
> > - Fixup "efi: Common enable/disable infrastructure for EFI soft
> > reservation" with a new dependency on CONFIG_EFI_STUB for
> > CONFIG_EFI_SOFT_RESERVE since the efi_soft_reserve_enabled() helper is
> > only built with EFI_STUB=y and the support depends on early reservations
> > to keep the kernel text from landing in the reservation.
>
> As far as I know, GRUB on x86 still boots without the EFI stub by
> default (i.e., using the 'linux' command instead of the 'linuxefi'
> command), so even if you build the stub, it is not going to be called
> in many cases. Is that going to be a problem?

It only becomes a problem if kaslr decides to land the kernel on top
of the soft-reservation. However, I think it's ok to say that if you
need the reservation to be honored in all circumstances, arrange to
boot in EFI mode.

>
> > This also
> > moved the IS_ENABLED(CONFIG_EFI_SOFT_RESERVE) check into the header so
> > that the stub does not try to link to __efi_soft_reserve_enabled() in
> > the EFI_STUB=n case.
> >
> > - Rework "x86/efi: EFI soft reservation to E820 enumeration" to always
> > add the full EFI memory map when EFI_MEMORY_SP ranges are found. This
> > simplifies the logic to just add the full EFI map rather than try to
> > tease out just the EFI_MEMORY_SP ranges. (Ard)
> >
> > [1]: https://lore.kernel.org/lkml/157066227329.1059972.5659620631541203458.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
> >
> > ---
> > Merge notes:
> >
> > Hi Ingo,
> >
> > I'm still looking for Ard's ack on the revised patch 4, but otherwise
> > feel like this is ready for your consideration.
> >
>
> Patch 4 looks fine to me,
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>

Thanks for the help.