Currently, on certain Xilinx platforms, an issue has been
identified, manifesting as follows:

Starting kernel ...

efi_free_pool: illegal free 0x0000000077830040
efi_free_pool: illegal free 0x000000007782d040
efi_free_pool: illegal free 0x000000007782c040

The issue arises when the ramdisk image is relocated, placing
it within the previously allocated EFI memory region( as EFI 
is established quite early in U-Boot). Consequently, when 
attempting to release memory in the EFI memory region during 
the handover process to the kernel,we encounter memory violations.

Highlighting that EFI remains active primarily during the 
booting of an EFI application, and the lmb persists while 
configuring images for the boot process. Since we aren't 
utilizing the EFI memory region during the boot process, 
there is no adverse impact even in the event of a violation.

Currently, there is an ongoing discussion regarding the handling
strategies of three memory allocators: malloc, lmb, and EFI. This
discussion is documented in the email chain
titled "Proposal: U-Boot memory management."

Therefore, it is advisable to suppress the print message during
the boot process for now.

Signed-off-by: Tejas Bhumkar <tejas.arvind.bhum...@amd.com> 
---
 lib/efi_loader/efi_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index edfad2d95a..821fe7616e 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -713,7 +713,7 @@ efi_status_t efi_free_pool(void *buffer)
        /* Check that this memory was allocated by efi_allocate_pool() */
        if (((uintptr_t)alloc & EFI_PAGE_MASK) ||
            alloc->checksum != checksum(alloc)) {
-               printf("%s: illegal free 0x%p\n", __func__, buffer);
+               debug("%s: illegal free 0x%p\n", __func__, buffer);
                return EFI_INVALID_PARAMETER;
        }
        /* Avoid double free */
-- 
2.27.0

Reply via email to