Skip to contentSkip to conversation

EFI payload in 64 bit mode?

DISCUSSION Philip Oberfichtner 2 participants 2 messages Apr 24, 2024

lore
Share & tools
lore
#0 lore raw

Hi,

I'm wondering if it is currently possible to have U-Boot run in 64-bit mode as EFI payload.

TARGET_EFI_APP64 selects X86_64 to achieve this. TARGET_EFI_PAYLOAD does currently always switch 32-bit mode. Any hints what would have to be done to get it to run in 64-bit mode?

Thanks in advance,
Philip

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-22  Fax: +49-8142-66989-80   Email: [email protected]
=====================================================================
#1 lore raw
Quoted 5 lines · Philip Oberfichtner

Hi,

I'm wondering if it is currently possible to have U-Boot run in 64-bit mode as EFI payload.

Quoted 8 lines

TARGET_EFI_APP64 selects X86_64 to achieve this. TARGET_EFI_PAYLOAD does currently always switch 32-bit mode. Any hints what would have to be done to get it to run in 64-bit mode?

Thanks in advance,
Philip

There are two defconfigs:

efi-x86_payload64_defconfig
efi-x86_payload32_defconfig

efi-x86_payload64_defconfig builds a 64bit EFI binary. efi-x86_payload32_defconfig builds a 32bit EFI binary.

The essential difference is that one selects CONFIG_EFI_STUB_32BIT and the other CONFIG_EFI_STUB_64BIT.

U-Boot itself always runs at 32bit because CONFIG_X86_RUN_32BIT=y.

To allow running at 64bit you would need at least need to change:

* jump_to_uboot() needs to execute a 64bit call to main U-Boot
* CONFIG_X86_RUN_64BIT should not select SPL if TARGET_EFI_PAYLOAD
* the definition of the global data pointer needs to be adjusted

Best regards

Heinrich