mbox series

[0/3] x86/setup: always resrve the first 1M of RAM

Message ID 20210601075354.5149-1-rppt@kernel.org
Headers show
Series x86/setup: always resrve the first 1M of RAM | expand

Message

Mike Rapoport June 1, 2021, 7:53 a.m. UTC
From: Mike Rapoport <rppt@linux.ibm.com>

Hi,

Commit a799c2bd29d1 ("x86/setup: Consolidate early memory reservations")
changed the way early memory reservations are made and caused a regression
for users that set CONFIG_X86_RESERVE_LOW to 640K in their kernel
configuration [1] because there was no room for the real mode trampoline.

My initial suggestion was to reduce the limit of CONFIG_X86_RESERVE_LOW
from 640K to 512K [2], but in the end it seems simpler to always reserve
the first 1M of RAM after the real mode trampoline is allocated.

The first patch in the series contains the rework of early memory
reservations so that first 64K will be reserved very early before memblock
allocations  are possible and the remaining memory under 1M would be
reserved after the real mode trampoline is allocated. This patch also
update freeing of EFI boot services so that memory under 1M will remain
reserved which is also required for crash kernel [3].

The second and the third patches are cleanups that remove pieces that are
not longer required after the first patch is applied.

Randy, Hugh, I'd appreciate if you give this a whirl on your old Sandy
Bridge laptops as it changes again the way trim_snb_memory() works.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=213177
[2] https://lore.kernel.org/lkml/20210526081100.12239-1-rppt@kernel.org
[3] https://lore.kernel.org/lkml/20210531090023.16471-1-lijiang@redhat.com/#r

Mike Rapoport (3):
  x86/setup: always reserve the first 1M of RAM
  x86/setup: remove CONFIG_X86_RESERVE_LOW and reservelow options
  x86/crash: remove crash_reserve_low_1M()

 .../admin-guide/kernel-parameters.txt         |  5 --
 arch/x86/Kconfig                              | 29 ---------
 arch/x86/include/asm/crash.h                  |  6 --
 arch/x86/kernel/crash.c                       | 13 ----
 arch/x86/kernel/setup.c                       | 59 +++++++------------
 arch/x86/platform/efi/quirks.c                | 12 ++++
 arch/x86/realmode/init.c                      | 14 +++--
 7 files changed, 41 insertions(+), 97 deletions(-)


base-commit: c4681547bcce777daf576925a966ffa824edd09d