Skip to contentSkip to conversation

FAILED: patch "[PATCH] efi: libstub: drop pointless get_memory_map() call" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Oct 16, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

d80ca810f096 ("efi: libstub: drop pointless get_memory_map() call") cd33a5c1d53e ("efi/libstub: Remove 'sys_table_arg' from all function prototypes") 8173ec7905b5 ("efi/libstub: Drop sys_table_arg from printk routines") c3710de5065d ("efi/libstub/x86: Drop __efi_early() export and efi_config struct") dc29da14ed94 ("efi/libstub: Unify the efi_char16_printk implementations") 2fcdad2a80a6 ("efi/libstub: Get rid of 'sys_table_arg' macro parameter") afc4cc71cf78 ("efi/libstub/x86: Avoid thunking for native firmware calls") f958efe97596 ("efi/libstub: Distinguish between native/mixed not 32/64 bit") 1786e8301164 ("efi/libstub: Extend native protocol definitions with mixed_mode aliases") 2732ea0d5c0a ("efi/libstub: Use a helper to iterate over a EFI handle array") 58ec655a7573 ("efi/libstub: Remove unused __efi_call_early() macro") 8de8788d2182 ("efi/gop: Unify 32/64-bit functions")
44c84b4ada73 ("efi/gop: Convert GOP structures to typedef and clean up some types") 8d62af177812 ("efi/gop: Remove bogus packed attribute from GOP structures") 4911ee401b7c ("x86/efistub: Disable paging at mixed mode entry") 818c7ce72477 ("efi/libstub/random: Initialize pointer variables to zero for mixed mode") 9fa76ca7b8bd ("efi: Fix efi_loaded_image_t::unload type")
ff397be685e4 ("efi/gop: Fix memory leak in __gop_query32/64()") dbd89c303b44 ("efi/gop: Return EFI_SUCCESS if a usable GOP was found") 6fc3cec30dfe ("efi/gop: Return EFI_NOT_FOUND if there are no usable GOPs")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From d80ca810f096ff66f451e7a3ed2f0cd9ef1ff519 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Thu, 15 Sep 2022 19:00:24 +0200
Subject: [PATCH] efi: libstub: drop pointless get_memory_map() call

Currently, the non-x86 stub code calls get_memory_map() redundantly, given that the data it returns is never used anywhere. So drop the call.

Cc <[email protected]> # v4.14+
Fixes 24d7c494ce46 ("efi/arm-stub: Round up FDT allocation to mapping size")
drivers/firmware/efi/libstub/fdt.c +0 -8
index fe567be0f118..804f542be3f2 100644
@@ -280,14 +280,6 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
 		goto fail;
 	}
 
-	/*
-	 * Now that we have done our final memory allocation (and free)
-	 * we can get the memory map key needed for exit_boot_services().
-	 */
-	status = efi_get_memory_map(&map);
-	if (status != EFI_SUCCESS)
-		goto fail_free_new_fdt;
-
 	status = update_fdt((void *)fdt_addr, fdt_size,
 			    (void *)*new_fdt_addr, MAX_FDT_SIZE, cmdline_ptr,
 			    initrd_addr, initrd_size);