Re: [PATCH v3 1/2] x86/setup: consolidate early memory reservations

From: Baoquan He
Date: Wed Mar 03 2021 - 06:06:00 EST


On 03/02/21 at 05:17pm, Mike Rapoport wrote:
> On Tue, Mar 02, 2021 at 09:04:09PM +0800, Baoquan He wrote:
...
> > > +static void __init early_reserve_memory(void)
> > > +{
> > > + /*
> > > + * Reserve the memory occupied by the kernel between _text and
> > > + * __end_of_kernel_reserve symbols. Any kernel sections after the
> > > + * __end_of_kernel_reserve symbol must be explicitly reserved with a
> > > + * separate memblock_reserve() or they will be discarded.
> > > + */
> > > + memblock_reserve(__pa_symbol(_text),
> > > + (unsigned long)__end_of_kernel_reserve - (unsigned long)_text);
> > > +
> > > + /*
> > > + * Make sure page 0 is always reserved because on systems with
> > > + * L1TF its contents can be leaked to user processes.
> > > + */
> > > + memblock_reserve(0, PAGE_SIZE);
> > > +
> > > + early_reserve_initrd();
> > > +
> > > + if (efi_enabled(EFI_BOOT))
> > > + efi_memblock_x86_reserve_range();
> > > +
> > > + memblock_x86_reserve_range_setup_data();
> >
> > This patch looks good to me, thanks for the effort.
> >
> > While at it, wondering if we can rename the above function to
> > memblock_reserve_setup_data() just as its e820 counterpart
> > e820__reserve_setup_data(), adding 'x86' to a function under arch/x86
> > seems redundant.
>
> I'd rather keep these names for now. First, it's easier to dig to them in the git
> history and second, I'm planning more changes in this area and these names
> are as good as FIXME: to remind what still needs to be checked :)

I see, thanks for explanation.