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

Breno Leitao
2026-04-01T14:57:32Z

On Wed, Apr 01, 2026 at 02:23:55PM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> 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@kernel.org>

Reviewed-by: Breno Leitao <leitao@debian.org>