Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
6199 commits behind the upstream repository.
  • Alexander Graf's avatar
    a148920e
    efi_loader: Fix efi_exit gd clobbering · a148920e
    Alexander Graf authored
    
    Commit f494950b (efi_loader: call __efi_exit_check in efi_exit) added a call
    to __efi_exit_check inside efi_exit to account for the fact that we're exiting
    the efi_exit function via a longjmp call.
    
    However, __efi_exit_check also swizzles gd to the application gd while the
    longjmp will put us back into EFI context, so we need the efi (u-boot) gd.
    
    This patch fixes that up by explicitly setting gd back to efi_gd before
    doing the longjmp. It also adds a few comments on why it does that.
    
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    a148920e
    History
    efi_loader: Fix efi_exit gd clobbering
    Alexander Graf authored
    
    Commit f494950b (efi_loader: call __efi_exit_check in efi_exit) added a call
    to __efi_exit_check inside efi_exit to account for the fact that we're exiting
    the efi_exit function via a longjmp call.
    
    However, __efi_exit_check also swizzles gd to the application gd while the
    longjmp will put us back into EFI context, so we need the efi (u-boot) gd.
    
    This patch fixes that up by explicitly setting gd back to efi_gd before
    doing the longjmp. It also adds a few comments on why it does that.
    
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
efi_boottime.c 31.78 KiB