Re: [tip: x86/urgent] x86/setup: Always reserve the first 1M of RAM
From: Mike Rapoport
Date: Fri Mar 03 2023 - 04:10:49 EST
Hi Andy,
On Wed, Mar 01, 2023 at 07:51:43PM -0800, Andy Lutomirski wrote:
> On Thu, Jun 3, 2021, at 11:01 AM, tip-bot2 for Mike Rapoport wrote:
> >
> > x86/setup: Always reserve the first 1M of RAM
> >
...
> + /*
> + * Unconditionally reserve the entire fisrt 1M, see comment in
> + * setup_arch().
> + */
> + memblock_reserve(0, SZ_1M);
>
>
> But this runs even if we just failed to allocate a trampoline on the
> first try, again dooming the kernel to panic.
>
> I real the commit message and the linked bug, and I'm having trouble
> finding evidence of anything actually fixed by this patch. Can we just
> revert it? If not, it would be nice to get a fixup patch that genuinely
> cleans this up -- the whole structure of the code (first, try to allocate
> trampoline, then free boot services, then try again) isn't really
> conducive to a model where we *don't* free boot services < 1M.
Currently, the second attempt to set_real_mode_mem() in
efi_free_boot_services() does not allocate from memblock anyway but reuses
memory freed from EFI services. Could be that failure to boot caused by
another failing reservation?
> Discovered by my delightful laptop, which does not boot with this patch applied.
Do you have early_printk() visible?
> --Andy
--
Sincerely yours,
Mike.