Commit 7264e21fdead677687934eecda6ac98f37851acf

Authored by Heinrich Schuchardt
1 parent 89cb6a5dd6

efi_loader: call add_u_boot_and_runtime() on sandbox

On the sandbox we should mark the stack area as EFI runtime memory like we
do on any other architecture.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff

lib/efi_loader/efi_memory.c
... ... @@ -738,8 +738,10 @@
738 738 unsigned long uboot_stack_size = 16 * 1024 * 1024;
739 739  
740 740 /* Add U-Boot */
741   - uboot_start = (gd->start_addr_sp - uboot_stack_size) & ~EFI_PAGE_MASK;
742   - uboot_pages = (gd->ram_top - uboot_start) >> EFI_PAGE_SHIFT;
  741 + uboot_start = ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) -
  742 + uboot_stack_size) & ~EFI_PAGE_MASK;
  743 + uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) -
  744 + uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
743 745 efi_add_memory_map(uboot_start, uboot_pages, EFI_LOADER_DATA, false);
744 746  
745 747 #if defined(__aarch64__)
... ... @@ -767,8 +769,7 @@
767 769 {
768 770 efi_add_known_memory();
769 771  
770   - if (!IS_ENABLED(CONFIG_SANDBOX))
771   - add_u_boot_and_runtime();
  772 + add_u_boot_and_runtime();
772 773  
773 774 #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
774 775 /* Request a 32bit 64MB bounce buffer region */