Skip to content

RFC EFI boot stub memory map fix

Linn Crosetto linux-efi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4efi: Decouple efi_memmap_init() and do_add_efi_memmap()arch/x86/platform/efi/efi.c+26 -180 replies
2/4efi: Add memory_setup function efi_memory_setup()arch/x86/platform/efi/efi.c include/linux/efi.h+9 -00 replies
3/4efi: Add efi_memmap_needed()arch/x86/platform/efi/efi.c include/linux/efi.h+8 -00 replies
4/4x86: Fix EFI boot stub for large memory mapsarch/x86/boot/compressed/eboot.c arch/x86/kernel/setup.c+6 -610 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] EFI boot stub memory map fix

I realize the EFI stub for ARM patches are in flight,

https://lkml.org/lkml/2013/8/9/554

and overlap with some of the files but I wanted to send these out for comment.

This series fixes a problem with EFI memory maps larger than 128 entries when booting using the EFI boot stub, which results in overflowing the e820_map in boot_params and an eventual halt when checking the map size in sanitize_e820_map().

The fix implemented is to add the EFI memory map from setup_arch() via a memory_setup hook.

Two options were considered:

1. Use the SETUP_E820_EXT setup_data type to add the extra entries.

2. Create a memory_setup function to be enabled when the EFI memory map is needed.

Option 2 appeared to be the cleaner solution, reducing duplication with existing code, given a reasonable mechanism for determining when to replace the default memory_setup function.

Linn Crosetto (4):
efi: Decouple efi_memmap_init() and do_add_efi_memmap()
efi: Add memory_setup function efi_memory_setup()
efi: Add efi_memmap_needed()
x86: Fix EFI boot stub for large memory maps

 arch/x86/boot/compressed/eboot.c | 64 ++--------------------------------------
 arch/x86/kernel/setup.c          |  3 ++
 arch/x86/platform/efi/efi.c      | 51 +++++++++++++++++++++++---------
 include/linux/efi.h              |  2 ++
 4 files changed, 45 insertions(+), 75 deletions(-)
Signature · 1 line
1.7.11.3