Re: [PATCH 1/2] efi: Fix reservation of unaccepted memory table
From: Mike Rapoport
Date: Sat Feb 14 2026 - 10:52:05 EST
On Fri, Feb 13, 2026 at 05:20:14PM +0000, Kiryl Shutsemau wrote:
> On Fri, Feb 13, 2026 at 08:46:55AM -0800, Dave Hansen wrote:
> > On 2/13/26 08:14, Kiryl Shutsemau wrote:
> > >> The memblock code seems to be able to handle arbitrary alignment just fine.
> > > Memblock will track it, but, as the comment says, anything smaller than
> > > page size will not be mapped, but we need the table to be accessible by
> > > kernel.
> >
> > That seems really, really fragile.
> >
> > We should first make sure this is intentional memblock behavior and not
> > a bug before we go add more hacks on top of it.
> >
> > Why would you even present a byte-level reservation interface if it is
> > free to just silently ignore some of the ranges by rounding them off later?
Heh, it's x86's choice of memblock iterator that's rounding the ranges ;)
Maybe I miss some context, but my understanding is that for crash kernels
the unaccepted table is E820_TYPE_RESERVED and those are never added to
memblock.memory by e820 code, hence the call to memblock_add() in
reserve_unaccepted().
When x86 creates page tables, init_range_memory_mapping() walks
memblock.memory with for_each_mem_pfn_range() that rounds ranges that are
not page-aligned, which is normally fine, because it would mean that we
miss some partial pages that are divided between E820_RAM and
E820_SOMETHING_ELSE.
And Kiryl's intention to round up unaccepted to page boundary seems correct
to me.
> My guess that multiple memblock_add() calls might add up to the full
> page size.
I'm not following here. Can you explain what do you mean?
Multiple memblock_add() calls to adjacent ranges will coalesce into one
larger range. But I don't see how is that related.
>
> --
> Kiryl Shutsemau / Kirill A. Shutemov
--
Sincerely yours,
Mike.