[PATCH v2 00/14] Make EFI memory allocations synchronous with LMB

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Oct 8 21:41:23 CEST 2024


On 10/8/24 20:14, Sughosh Ganu wrote:
> This is part two of the series to have the EFI and LMB modules have a
> coherent view of memory. Part one of this goal was to change the LMB
> module to have a global and persistent memory map. Those patches have
> now been applied to the next branch.
>
> These patches are changing the EFI memory allocation API's such that
> they rely on the LMB module to allocate RAM memory. This fixes the
> current scenario where the EFI memory module has no visibility of the
> allocations/reservations made by the LMB module. One thing to note
> here is that this is limited to the RAM memory region, i.e. the
> EFI_CONVENTIONAL_MEMORY type. Any other memory type that is to be
> added to the EFI memory map, still gets handled by the EFI memory
> module.

LMB seems to have restrictions that EFI does not have:

__lmb_free() fails if the freed memory range extends over multiple
adjacent allocated regions.

FreePages() in the EFI specification does not require that all freed
pages have the same properties.

I don't think this will hit us with this series as we currently always
pass the same flags to LMB when allocating and LMB should be coalescing
adjacent allocations.

But if we will go forward and move the EFI memory map into LMB to avoid
double accounting we will have to rework __lmb_free().

Best regards

Heinrich


More information about the U-Boot mailing list