From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
Chali Anis <chalianis1@gmail.com>
Subject: [PATCH master] bootm: require EFI boot when running as payload
Date: Tue, 14 Apr 2026 15:59:35 +0200 [thread overview]
Message-ID: <20260414135936.714776-1-a.fatoum@pengutronix.de> (raw)
An EFI-stubbed ARM64 Linux kernel can be optionally started as EFI
application via its PE entry point or it can be directly executed with
the normal boot protocol.
To support both in barebox, we have a global.bootm.efi parameter that
allows choosing either:
- required: only boot EFI executables via EFI
- available: attempt EFI boot for EFI executables if barebox support
is available
- disabled: never attempt EFI boot
With barebox support here meaning CONFIG_EFI_LOADER being enabled.
This fails to account for configurations that have only
CONFIG_EFI_PAYLOAD and that are actually running as EFI payload.
For those, we should always require EFI boot for EFI executables as
stating a kernel from within an EFI environment without exiting boot
services is not a good idea.
Thus change the check to IS_ENABLED(CONFIG_EFI_LOADER) || efi_is_payload().
IS_ENABLED(CONFIG_EFI_PAYLOAD) would be incorrect as we can enable EFI
payload support, but start barebox directly, not via its own EFI stub.
Fixes: 6119a5b54ed1 ("bootm: add global.bootm.efi toggle")
Reported-by: Chali Anis <chalianis1@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/bootm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/bootm.c b/common/bootm.c
index d43079bb81da..82b0f0bd0563 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -845,7 +845,7 @@ bool bootm_efi_check_image(struct image_handler *handler,
* and fallback to normal boot otherwise.
*/
if (data->efi_boot == BOOTM_EFI_AVAILABLE) {
- if (IS_ENABLED(CONFIG_EFI_LOADER))
+ if (IS_ENABLED(CONFIG_EFI_LOADER) || efi_is_payload())
data->efi_boot = BOOTM_EFI_REQUIRED;
else
data->efi_boot = BOOTM_EFI_DISABLED;
--
2.47.3
next reply other threads:[~2026-04-14 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 13:59 Ahmad Fatoum [this message]
2026-04-15 6:27 ` 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=20260414135936.714776-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=chalianis1@gmail.com \
/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