Skip to contentSkip to conversation

Patch "efi/libstub/arm*: Pass latest memory map to the kernel" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jan 17, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

efi/libstub/arm*: Pass latest memory map to the kernel

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
efi-libstub-arm-pass-latest-memory-map-to-the-kernel.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From abfb7b686a3e5be27bf81db62f9c5c895b76f5d1 Mon Sep 17 00:00:00 2001

From: Ard Biesheuvel <[email protected]>
Date: Sat, 24 Dec 2016 13:59:23 +0000
Subject: efi/libstub/arm*: Pass latest memory map to the kernel

From: Ard Biesheuvel <[email protected]>

commit abfb7b686a3e5be27bf81db62f9c5c895b76f5d1 upstream.

As reported by James Morse, the current libstub code involving the annotated memory map only works somewhat correctly by accident, due to the fact that a pool allocation happens to be reused immediately, retaining its former contents on most implementations of the UEFI boot services.

Instead of juggling memory maps, which makes the code more complex than it needs to be, simply put placeholder values into the FDT for the memory map parameters, and only write the actual values after ExitBootServices() has been called.

Cc Jeffrey Hugo <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Matt Fleming <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Fixes ed9cc156c42f ("efi/libstub: Use efi_exit_boot_services() in FDT")
---
 drivers/firmware/efi/libstub/efistub.h |    8 ---
 drivers/firmware/efi/libstub/fdt.c     |   87 +++++++++++++++++++++------------
 2 files changed, 56 insertions(+), 39 deletions(-)
drivers/firmware/efi/libstub/efistub.h +0 -8
@@ -30,14 +30,6 @@ efi_status_t efi_file_close(void *handle
 
 unsigned long get_dram_base(efi_system_table_t *sys_table_arg);
 
-efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt,
-			unsigned long orig_fdt_size,
-			void *fdt, int new_fdt_size, char *cmdline_ptr,
-			u64 initrd_addr, u64 initrd_size,
-			efi_memory_desc_t *memory_map,
-			unsigned long map_size, unsigned long desc_size,
-			u32 desc_ver);
-
 efi_status_t allocate_new_fdt_and_exit_boot(efi_system_table_t *sys_table,
 					    void *handle,
 					    unsigned long *new_fdt_addr,
drivers/firmware/efi/libstub/fdt.c +56 -31

155 lines not on this page · raw message

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/efi-libstub-arm-pass-latest-memory-map-to-the-kernel.patch queue-4.9/efi-x86-prune-invalid-memory-map-entries-and-fix-boot-regression.patch queue-4.9/x86-efi-don-t-allocate-memmap-through-memblock-after-mm_init.patch