[U-Boot] [PATCH 1/1] efi_loader: remove efi_exit_caches()

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Jul 20 04:31:26 UTC 2019


On 7/19/19 9:06 PM, Peter Robinson wrote:
> On Fri, Jul 19, 2019 at 7:28 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>>
>> In GRUB before 2.04 a bug existed which did not allow booting some ARM32
>> boards if U-Boot did not disable caches, cf.
>> https://lists.linaro.org/pipermail/cross-distro/2019-July/000933.html
>>
>> In ExitBootServices() we were disabling the caches by calling
>> cleanup_before_linux(). This workaround is not needed anymore.
>
> Do we want to remove this straight away? A lot of distributions will
> take time to move to grub 2.04 because it's been a long time between
> grub releases so they'll have quite a patch delta to re-align to the
> new release. Fedora for example will rebase to grub 2.04 in Fedora 32
> which will start development end of August but won't be released until
> next year.

As described below this code does not remove any functionality that was
active in U-Boot v2019.04 or v2019.07.

I can see nothing in https://fedoraproject.org/wiki/Updates_Policy
stopping GRUB 2.04 from being made available for stable Fedora releases.

Best regards

Heinrich

>
>> The UEFI spec requires that caches are enabled but architecturally defined
>> caches should be disabled. But this requirement has to be fulfilled when
>> invoking StartImage() and not after calling ExitBootServices(). So there is
>> no reason for calling cleanup_before_linux() here.
>>
>> Since commit f69d63fae281 ("efi_loader: use efi_start_image() for
>> bootefi"), i.e. v2019.04, we have not been calling efi_exit_caches()
>> anymore which in turn would call cleanup_before_linux().
>>
>> Remove the obsolete function efi_exit_caches().
>>
>> Suggested-by: Alexander Graf <agraf at csgraf.de>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>>  lib/efi_loader/efi_boottime.c | 28 ----------------------------
>>  1 file changed, 28 deletions(-)
>>
>> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
>> index 4f6e8d1679..f84ee24416 100644
>> --- a/lib/efi_loader/efi_boottime.c
>> +++ b/lib/efi_loader/efi_boottime.c
>> @@ -39,14 +39,6 @@ LIST_HEAD(efi_register_notify_events);
>>  /* Handle of the currently executing image */
>>  static efi_handle_t current_image;
>>
>> -/*
>> - * 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).
>> - */
>> -static bool efi_is_direct_boot = true;
>> -
>>  #ifdef CONFIG_ARM
>>  /*
>>   * The "gd" pointer lives in a register on ARM and AArch64 that we declare
>> @@ -1906,21 +1898,6 @@ error:
>>         return EFI_EXIT(ret);
>>  }
>>
>> -/**
>> - * efi_exit_caches() - fix up caches for EFI payloads if necessary
>> - */
>> -static void efi_exit_caches(void)
>> -{
>> -#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
>> -       /*
>> -        * 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.
>> -        */
>> -       if (efi_is_direct_boot)
>> -               cleanup_before_linux();
>> -#endif
>> -}
>> -
>>  /**
>>   * efi_exit_boot_services() - stop all boot services
>>   * @image_handle: handle of the loaded image
>> @@ -1990,9 +1967,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
>>         /* Patch out unsupported runtime function */
>>         efi_runtime_detach();
>>
>> -       /* Fix up caches for EFI payloads if necessary */
>> -       efi_exit_caches();
>> -
>>         /* This stops all lingering devices */
>>         bootm_disable_interrupts();
>>
>> @@ -2893,8 +2867,6 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
>>         if (ret != EFI_SUCCESS)
>>                 return EFI_EXIT(EFI_INVALID_PARAMETER);
>>
>> -       efi_is_direct_boot = false;
>> -
>>         image_obj->exit_data_size = exit_data_size;
>>         image_obj->exit_data = exit_data;
>>
>> --
>> 2.20.1
>>
>



More information about the U-Boot mailing list