mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/2] efi: loader: release bootm OS staging buffer
@ 2026-06-11 21:22 Ahmad Fatoum
  2026-06-11 21:22 ` [PATCH master 2/2] efi: loader: bump memory map key on FreePages Ahmad Fatoum
  2026-06-15  7:48 ` [PATCH master 1/2] efi: loader: release bootm OS staging buffer Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-06-11 21:22 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The initial location of the OS image is currently kept reserved until
it's reclaimed after exiting boot services. This is unnecessary though
as the relevant parts of the PE are copied out anyway.

Therefore, free the original OS image to leave more space to the
decompresser.

Fixes: 229bc3b37e64 ("efi: loader: implement bootm handler")
Assisted-by: Codex:gpt-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 efi/loader/bootm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/efi/loader/bootm.c b/efi/loader/bootm.c
index e1f1d508c59e..a68db742e173 100644
--- a/efi/loader/bootm.c
+++ b/efi/loader/bootm.c
@@ -267,6 +267,14 @@ static int efi_loader_bootm(struct image_data *data)
 		goto out;
 	}
 
+	/*
+	 * efi_load_pe() copied the executable image into EFI-managed memory.
+	 * The bootm staging buffer is no longer needed, and keeping it in the
+	 * memory map can block payloads from using their normal load address.
+	 */
+	release_sdram_region(data->os_res);
+	data->os_res = NULL;
+
 	efiret = efi_set_load_options(handle, load_option_size, load_option);
 	if (efiret)
 		goto out;
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-15  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 21:22 [PATCH master 1/2] efi: loader: release bootm OS staging buffer Ahmad Fatoum
2026-06-11 21:22 ` [PATCH master 2/2] efi: loader: bump memory map key on FreePages Ahmad Fatoum
2026-06-15  7:48 ` [PATCH master 1/2] efi: loader: release bootm OS staging buffer Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox