diff mbox series

[v3,07/15] efi_memory: do not add U-Boot memory to the memory map

Message ID 20241013105522.391414-8-sughosh.ganu@linaro.org
State Superseded
Headers show
Series Make EFI memory allocations synchronous with LMB | expand

Commit Message

Sughosh Ganu Oct. 13, 2024, 10:55 a.m. UTC
The memory region occupied by U-Boot is reserved by LMB, and gets
added to the EFI memory map through a call from the LMB module. Remove
this superfluous addition to the EFI memory map.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
---
Changes since V2: New patch

 lib/efi_loader/efi_memory.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Ilias Apalodimas Oct. 14, 2024, 10 a.m. UTC | #1
On Sun, 13 Oct 2024 at 13:56, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> The memory region occupied by U-Boot is reserved by LMB, and gets
> added to the EFI memory map through a call from the LMB module. Remove
> this superfluous addition to the EFI memory map.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V2: New patch
>
>  lib/efi_loader/efi_memory.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index 41501e9d41..16e64987af 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -870,16 +870,6 @@ static void add_u_boot_and_runtime(void)
>  {
>         unsigned long runtime_start, runtime_end, runtime_pages;
>         unsigned long runtime_mask = EFI_PAGE_MASK;
> -       unsigned long uboot_start, uboot_pages;
> -       unsigned long uboot_stack_size = CONFIG_STACK_SIZE;
> -
> -       /* Add U-Boot */
> -       uboot_start = ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) -
> -                      uboot_stack_size) & ~EFI_PAGE_MASK;
> -       uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) -
> -                      uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
> -       efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE,
> -                             false);
>
>  #if defined(__aarch64__)
>         /*
> --
> 2.34.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Simon Glass Oct. 14, 2024, 3:50 p.m. UTC | #2
Hi Sughosh,

On Sun, 13 Oct 2024 at 04:56, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> The memory region occupied by U-Boot is reserved by LMB, and gets
> added to the EFI memory map through a call from the LMB module. Remove
> this superfluous addition to the EFI memory map.

Without the patch before (which so far I don't see the need for), this
code is needed.

>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> ---
> Changes since V2: New patch
>
>  lib/efi_loader/efi_memory.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index 41501e9d41..16e64987af 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -870,16 +870,6 @@ static void add_u_boot_and_runtime(void)
>  {
>         unsigned long runtime_start, runtime_end, runtime_pages;
>         unsigned long runtime_mask = EFI_PAGE_MASK;
> -       unsigned long uboot_start, uboot_pages;
> -       unsigned long uboot_stack_size = CONFIG_STACK_SIZE;
> -
> -       /* Add U-Boot */
> -       uboot_start = ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) -
> -                      uboot_stack_size) & ~EFI_PAGE_MASK;
> -       uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) -
> -                      uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
> -       efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE,
> -                             false);
>
>  #if defined(__aarch64__)
>         /*
> --
> 2.34.1
>

Regards,
Simon
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 41501e9d41..16e64987af 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -870,16 +870,6 @@  static void add_u_boot_and_runtime(void)
 {
 	unsigned long runtime_start, runtime_end, runtime_pages;
 	unsigned long runtime_mask = EFI_PAGE_MASK;
-	unsigned long uboot_start, uboot_pages;
-	unsigned long uboot_stack_size = CONFIG_STACK_SIZE;
-
-	/* Add U-Boot */
-	uboot_start = ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) -
-		       uboot_stack_size) & ~EFI_PAGE_MASK;
-	uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) -
-		       uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
-	efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE,
-			      false);
 
 #if defined(__aarch64__)
 	/*