From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH master 1/2] efi: loader: release bootm OS staging buffer
Date: Thu, 11 Jun 2026 23:22:00 +0200 [thread overview]
Message-ID: <20260611212206.4103255-1-a.fatoum@barebox.org> (raw)
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
next reply other threads:[~2026-06-11 21:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 21:22 Ahmad Fatoum [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260611212206.4103255-1-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox