[U-Boot] [PATCH v4 1/1] efi_loader: Patch non-runtime code out at ExitBootServices already

Jonathan Gray jsg at jsg.id.au
Tue Mar 12 14:16:05 UTC 2019


On Mon, Mar 11, 2019 at 12:44:24PM +0100, Heinrich Schuchardt wrote:
> On 3/11/19 9:03 AM, Ard Biesheuvel wrote:
> > On Mon, 11 Mar 2019 at 01:16, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> >>
> >> From: Alexander Graf <agraf at suse.de>
> >>
> >> While discussing something compeltely different, Ard pointed out
> >> that it might be legal to omit calling SetVirtualAddressMap altogether.
> >>
> >> There is even a patch on the Linux Kernel Mailing List that implements
> >> such behavior by now:
> >>
> >>   https://patchwork.kernel.org/patch/10782393/
> >>
> >> While that sounds great, we currently rely on the SetVirtualAddressMap
> >> call to remove all references to code that would not work outside of
> >> boot services.
> >>
> >> So let's patch out those bits already on the call to ExitBootServices,
> >> so that we can successfully run even when an OS chooses to omit
> >> any call to SetVirtualAddressMap.
> >>
> >> Reported-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> >> Signed-off-by: Alexander Graf <agraf at suse.de>
> >>
> >> OpenBSD is not calling SetVirtualAddressMap on ARM 32 bit.
> >>
> > 
> > I take it this means that OpenBSD does not support runtime services at
> > all on 32-bit ARM?
> 
> References to runtime services exist, e.g.:
> 
> sys/arch/armv7/stand/efiboot/efiboot.c:666:
> EFI_CALL(RS->ResetSystem, EfiResetShutdown, EFI_SUCCESS, 0, NULL);
> 
> But from what I see at first glance it seems to be for the interactive
> console before booting the kernel.

Runtime services are used on OpenBSD/arm64 to be able to access the
rtc on amd seattle machines.  Not currently used by the kernel on any
other platform (including amd64).

> 
> Best regards
> 
> Heinrich
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


More information about the U-Boot mailing list