[PATCH v3 06/15] lmb: notify of any changes to the LMB memory map

Simon Glass sjg at chromium.org
Mon Oct 14 17:50:42 CEST 2024


Hi Sughosh,

On Sun, 13 Oct 2024 at 04:56, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
>
> In U-Boot, LMB and EFI are two primary modules who provide memory
> allocation and reservation API's. Both these modules operate with the
> same regions of memory for allocations.

The primary means of allocating memory is malloc() !

I certainly don't want to see this language in a U-Boot commit. LMB is
mainly used for reserving space for images. EFI is used for allocating
memory in the EFI loader / booting EFI apps.

So how about:

In U-Boot, LMB is used primarily for reserving space for loaded images
and to avoid overwriting U-Boot's memory region. EFI has a
memory-allocation feature, used by EFI_LOADER.

Use the LMB memory map update
> event to notify other interested listeners about a change in it's

its

> memory map. This can then be used by the other module to keep track of
> available and used memory.

I think at this point, it is only EFI, so you should just say
EFI_LOADER (or EFI) here.
>
> There is no need to send these notifications when the LMB module is
> being unit-tested. Add a flag to the lmb structure to indicate if the
> memory map is being used for tests, and suppress sending any
> notifications when running these unit tests.

I don't quite see what the need is in any case, since even in your
series (without mind applied), EFI uses lmb to allocate its memory.
What problem is fixed with this patch?

Regards,
Simon


More information about the U-Boot mailing list