Skip to content

efi: Permanent runtime EFI memmap support

Matt Fleming linux-efi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11x86/efi: Test for EFI_MEMMAP functionality when iterating EFI memmaparch/x86/kernel/setup.c drivers/firmware/efi/fake_mem.c+7 -80 replies
2/11x86/efi: Consolidate region mapping logicarch/x86/platform/efi/efi.c arch/x86/platform/efi/efi_64.c+43 -271 reply
3/11efi: Refactor efi_memmap_init_early() into arch-neutral codearch/x86/include/asm/efi.h arch/x86/platform/efi/efi.c arch/x86/platform/efi/quirks.c +4 more+98 -673 replies
4/11efi: Add efi_memmap_init_late() for permanent EFI memmaparch/x86/platform/efi/efi.c arch/x86/platform/efi/quirks.c drivers/firmware/efi/arm-runtime.c +2 more+130 -590 replies
5/11efi/fake_mem: Refactor main two code chunks into functionsdrivers/firmware/efi/fake_mem.c+134 -950 replies
6/11efi: Split out EFI memory map functions into new filedrivers/firmware/efi/Makefile drivers/firmware/efi/efi.c drivers/firmware/efi/fake_mem.c +2 more+284 -2670 replies
7/11efi: Add efi_memmap_install() for installing new EFI memory mapsdrivers/firmware/efi/fake_mem.c drivers/firmware/efi/memmap.c include/linux/efi.h+27 -70 replies
8/11efi: Allow drivers to reserve boot services foreverarch/x86/platform/efi/quirks.c drivers/firmware/efi/efi.c include/linux/efi.h+141 -110 replies
9/11efi/runtime-map: Use efi.memmap directly instead of a copyarch/x86/platform/efi/efi.c drivers/firmware/efi/runtime-map.c include/linux/efi.h+13 -660 replies
10/11efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()drivers/firmware/efi/esrt.c+4 -160 replies
11/11x86/efi-bgrt: Use efi_mem_reserve() to avoid copying image dataarch/x86/platform/efi/efi-bgrt.c+2 -111 reply

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by.

PatchBorislav PetkovArd BiesheuvelDave YoungJosh Triplett
SeriesT-b
1/11
2/11A-b
3/11T-b R-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/11] efi: Permanent runtime EFI memmap support

This series adds support for keeping the EFI memory map around at runtime for x86 (ARM and arm64 already have this support).

Additionally, drivers can now reserve EFI boot services regions such that they are not released back to the kernel during efi_free_boot_services().

With these two features it becomes possible to pass things like the EFI System Resource Table data structures across kexec reboot.

This series also includes a whole bunch of refactoring and cleanups to move code out of arch or driver-specific files into generic places.

I've given these patches some light testing, but it would be good if others could provide more given that this series touches so many different code paths.

ARM/arm64 folks, you're going to want to pay particular attention to PATCH 3 where I drop the read-only mapping of the EFI memory map since it causes problems for x86.

I am aware that we leak memory maps when new ones get installed, e.g. during __efi_enter_virtual_mode(), but that's an existing bug that requires everyone to allocate memory maps the same way before it can be fixed.

 arch/x86/include/asm/efi.h         |   1 -
 arch/x86/kernel/setup.c            |  13 +-
 arch/x86/platform/efi/efi-bgrt.c   |  13 +-
 arch/x86/platform/efi/efi.c        | 198 ++++++++++++-------------
 arch/x86/platform/efi/efi_64.c     |  20 ---
 arch/x86/platform/efi/quirks.c     | 123 ++++++++++++++--
 drivers/firmware/efi/Makefile      |   2 +-
 drivers/firmware/efi/arm-init.c    |  17 +--
 drivers/firmware/efi/arm-runtime.c |   4 +-
 drivers/firmware/efi/efi.c         |  64 ++++----
 drivers/firmware/efi/esrt.c        |  20 +--
 drivers/firmware/efi/fake_mem.c    | 125 ++--------------
 drivers/firmware/efi/memmap.c      | 292 +++++++++++++++++++++++++++++++++++++
 drivers/firmware/efi/runtime-map.c |  35 ++---
 include/linux/efi.h                |  34 ++++-
 15 files changed, 605 insertions(+), 356 deletions(-)
 create mode 100644 drivers/firmware/efi/memmap.c