Re: [PATCH v3 08/17] x86/efi: Allow ranges_to_free array to grow beyond initial size

Mike Rapoport
2026-04-28T08:38:48Z

On Thu, Apr 23, 2026 at 05:20:33PM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> In order to avoid the need to mangle the EFI memory map, which is being
> done to keep track of which boot services data regions are really reallyo

typo: really reallyo

> reserved, and which ones are only reserved temporarily, this information
> needs to be recorded in a different manner.
>
> The temporary ranges_to_free array is a suitable candidate, as it is
> specifically intended to capture which boot services data regions should
> be handed back to the page allocator once deferred struct page
> initialization is done.
>
> This requires that boot services data regions are intersected with the
> memblock reserved list, and this may result in more ranges_to_free
> elements than the current upper bound of the number of EFI memory map
> entries.
>
> So reallocate the array when running out of slots.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
> arch/x86/platform/efi/quirks.c | 40 ++++++++++++++++----
> 1 file changed, 32 insertions(+), 8 deletions(-)

--
Sincerely yours,
Mike.