[U-Boot] x86: EFI: boot fails at exit_boot_services - Was: Stuck trying to build a non-qemu EFI payload
Stoppa, Igor
igor.stoppa at intel.com
Thu Aug 20 11:44:14 CEST 2015
Hi Bin, Simon,
On 18 August 2015 at 15:47, Stoppa, Igor <igor.stoppa at intel.com> wrote:
> Hi,
> I have verified that I can reproduce a working build of U-Boot as
> x86-64bit EFI payload for Qemu: I can boot it, interact with various
> filesystems of both real and emulated disks, etc.
>
>
> Now I would like to build and boot it for a real board, still as EFI payload.
>
> The docs/README.efi file states:
>
>> U-Boot is packaged up and loaded in its entirety by EFI. Once
>> started, U-Boot changes to 32-bit mode (currently) and takes over the
>> machine. You can use devices, boot a kernel, etc.
>
> My test device is a a D4250WYK NUC with a 4th generation Core i5
> Haswell processor.
> I tried booting it with an USB stick that I prepared and tested with qemu.
> The build is based on the qemu-x86_defconfig, plus the EFI settings
> needed for generating a 64 bit payload.
>
> On qemu I can reach the U-Boot shell and run commands, however on the
> NUC it stops at
> the message "U-Boot EFI Payload", which is printed by the stub.
I've added traces to my setup and somewhat narrowed down the place
where it gets stuck.
It happens much earlier than I thought: I was expecting it would get
stuck during the handover from the stub to the real U-Boot, after the
jump_to_uboot call, instead it never reaches that point.
On the NUC I get a system hang at the first
ret = boot->exit_boot_services(image, key);
in efi_main. I traced it with some putc().
My assumption was that, even if the payload is configured for QEmu,
rather than for the real board I am using, the loading should be
successful anyway, because it relies on the EFI API.
Is my assumption in correct?
I noticed something (unrelated?) regarding exit_boot_services:
There's a comment in the efi_stub.c file, stating:
/*
* Unfortunately it happens that we cannot exit boot services
* the first time. But the second time it work. I don't know
* why but this seems to be a repeatable problem. To get
* around it, just try again.
*/
But, with Qemu, "exit_boot_services" always work at the first attempt:
the execution never enters the braces containing that comment.
--
thanks, igor
More information about the U-Boot
mailing list