]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: require at least 128 KiB of stack space
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 17 Feb 2026 07:46:55 +0000 (08:46 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 14 Mar 2026 07:09:16 +0000 (08:09 +0100)
The UEFI specification requires at least 128 KiB stack space. Consider this
value as a prerequisite for CONFIG_EFI_LOADER.

Mention the requirement in the CONFIG_STACK_SPACE description and decribe
that the UEFI sub-system uses CONFIG_STACK_SPACE when defining the memory
map.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Kconfig
lib/efi_loader/Kconfig

diff --git a/Kconfig b/Kconfig
index a50b4c8c68a99a40a140d30d1178a1ff74c4b59a..b52331d6ff25ad3e5f43707719f78c3a5daa2090 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -615,9 +615,11 @@ config STACK_SIZE
        default 0x4000 if ARCH_STM32
        default 0x1000000
        help
-         Define Max stack size that can be used by U-Boot. This value is used
-         by the UEFI sub-system. On some boards initrd_high is calculated as
-         base stack pointer minus this stack size.
+         Define Max stack size that can be used by U-Boot. The UEFI sub-system
+         considers this value when setting up the memory map. The UEFI
+         specification requires 128 KiB or more of available stack space. On
+         some boards initrd_high is calculated as base stack pointer minus this
+         stack size.
 
 config SYS_MEM_TOP_HIDE
        hex "Exclude some memory from U-Boot / OS information"
index 579eed65880144dad2f062a30d2de624bbb2fea8..2d8581b57bbd234d974af69b9279b6a52b9d55d1 100644 (file)
@@ -15,6 +15,8 @@ config EFI_LOADER
        # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
        depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
        depends on !EFI_APP
+       # The EFI specification requires 128 KiB or more of stack space
+       depends on STACK_SIZE >= 0x20000
        default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
        select EFI
        select CHARSET