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

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Mar 11 11:44:24 UTC 2019


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.

Best regards

Heinrich



More information about the U-Boot mailing list