* [PATCH master] bootm: require EFI boot when running as payload
@ 2026-04-14 13:59 Ahmad Fatoum
2026-04-15 6:27 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-04-14 13:59 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum, Chali Anis
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH master] bootm: require EFI boot when running as payload
2026-04-14 13:59 [PATCH master] bootm: require EFI boot when running as payload Ahmad Fatoum
@ 2026-04-15 6:27 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-04-15 6:27 UTC (permalink / raw)
To: barebox, Ahmad Fatoum; +Cc: Chali Anis
On Tue, 14 Apr 2026 15:59:35 +0200, Ahmad Fatoum wrote:
> 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:
>
> [...]
Applied, thanks!
[1/1] bootm: require EFI boot when running as payload
https://git.pengutronix.de/cgit/barebox/commit/?id=b40f7d8795e7 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-15 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-14 13:59 [PATCH master] bootm: require EFI boot when running as payload Ahmad Fatoum
2026-04-15 6:27 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox