Re: [PATCH v2 3/5] x86/efi: Defer the call to efi_memattr_init()

From: Breno Leitao

Date: Wed Apr 01 2026 - 11:02:09 EST


On Wed, Apr 01, 2026 at 02:23:55PM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@xxxxxxxxxx>
>
> efi_memattr_init() should call efi_mem_reserve() rather than
> memblock_reserve() to preserve the memory contents of the region when
> the EFI memory attributes table is loaded by the firmware.
>
> However, efi_mem_reserve() can only be called later during the boot on
> x86, due to the fact that it may need to memblock_alloc() memory for the
> EFI memory map.
>
> So move the call to efi_memattr_init() to a later stage when building
> for x86_64.
>
> Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>