Re: [PATCH v2 00/19] efi/x86: Avoid the need to mangle the EFI memory map
From: Ard Biesheuvel
Date: Tue Mar 24 2026 - 06:00:07 EST
On Thu, 19 Mar 2026, at 10:05, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@xxxxxxxxxx>
>
> At boot, x86 uses E820 tables, memblock tables and the EFI memory map to
> reason about which parts of system RAM are available to the OS, and
> which are reserved.
>
> While other EFI architectures treat the EFI memory map as immutable, the
> x86 boot code modifies it to keep track of memory reservations of boot
> services data regions, in order to distinguish which parts have been
> memblock_reserve()'d permanently, and which ones have been reserved only
> temporarily to work around buggy implementations of the EFI runtime
> service [SetVirtualAddressMap()] that reconfigures the VA space of the
> runtime services themselves.
>
> This method is mostly fine for marking entire regions as reserved, but
> it gets complicated when the code decides to split EFI memory map
> entries in order to mark some of it permanently reserved, and the rest
> of it temporarily reserved.
>
> Let's clean this up, by
> - marking permanent reservations of EFI boot services data memory as
> MEMBLOCK_RSRV_KERN
> - taking this marking into account when deciding whether or not a EFI
> boot services data region can be freed
> - dropping all of the EFI memory map insertion/splitting logic and the
> allocation/freeing logic, all of which have become redundant.
>
Please disregard this for now. Sashiko pointed out some fundamental issues in this series, and I think it might be better to take a different approach entirely.