[U-Boot] [RFC] efi_loader: efi_exit_caches()
Alexander Graf
agraf at suse.de
Sun Sep 23 11:55:38 UTC 2018
On 23.09.18 13:35, Heinrich Schuchardt wrote:
> Hello Alex,
>
> function efi_exit_caches() is called by efi_exit_boot_services(). It
> calls cleanup_before_linux() if efi_direct_boot is set.
>
> Comments in the code say
>
> <cite>
> If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
> we need to do trickery with caches. Since we don't want to break the EFI
> aware boot path, only apply hacks when loading exiting directly
> (breaking direct Linux EFI booting along the way - oh well).
>
> GRUB on 32bit ARM needs to have caches disabled before jumping into
> a zImage, but does not know of all cache layers. Give it a hand.
> </cite>
>
> Why should this requirement depend on whether GRUB is loaded directly or
> via iPXE or the EFI Shell?
Because that's the most common execution path. I'm not saying it's
correct, but it was the only hack I could think of that at least solved
90% of the problem.
> And why would we want to kill loading Linux directly via bootefi?
See above. The most common execution path for me at least was to go
grub->Linux and that path broke because .. well ... because grub was
broken basically :).
> Why should GRUB-efi load an operating system via anything but the EFI stub?
See above - at the time the hack got implemented we barely had an efi
stub on armv7. This has been upstream for ~2 years now, so we can start
to depend on it.
Also, armv7 grub only very recently (2 months ago) gained support for
running UEFI Linux:
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=d0c070179d4d78c297364e41ece54fd7755c4b58
As soon as that trickles into distros, I'd love to just remove all the
hackery you've found ;).
> I would like to eliminate the variable efi_is_direct_boot and let
> do_bootefi() call efi_start_image() removing the current code duplication.
>
> The current implementation of efi_start_image() is incomplete as it does
> not keep track of the currently running image (see the specification of
> the UnloadImage() and Exit() services for the reason why we need this).
> I would hesitate to program this in multiple places.
>
> This coding in question was introduced with one of your first EFI patches:
> bee91169f5b2 ("efi_loader: Add boot time services")
Feel free to remove it, I'll make sure we have the grub UEFI code path
in our distro then and add something to release notes to make sure
others find it too.
Alex
More information about the U-Boot
mailing list