Date: Mon, 25 Feb 2019 20:58:18 -0600 From: Kyle Evans <kevans@freebsd.org> To: Rebecca Cran <rebecca@bluestop.org> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: i386 EFI booting is broken (ExitBootServices called in two places) Message-ID: <CACNAnaFLb4ssSks%2BPirYozNcCpoLURoO3_AyG-Hx-yqFHYcgaQ@mail.gmail.com> In-Reply-To: <e823176d-943d-148f-a358-d7b9ebe56d0c@bluestop.org> References: <e823176d-943d-148f-a358-d7b9ebe56d0c@bluestop.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 25, 2019 at 8:18 PM Rebecca Cran <rebecca@bluestop.org> wrote: > > I've been working on some EFI changes, and in the process found that > i386 booting is broken. On real hardware - my MinnowBoard Turbot - the > loader hangs when calling ExitBootServices, while in a VM I get a panic > saying "exec returned". > > The problem appears to be that ExitBootServices is called twice: > elf32_exec in arch/i386/efimd.c calls bi_load which calls > bi_load_efi_data in bootinfo.c - which calls ExitBootServices the first > time. Then elf32_exec keeps going, and after printing "Start @ 0x....." > calls ldr_enter which tries to call ExitBootServices again - this time > with a mapkey whose value is zero since it never attempts to fetch the > memory map. I'm guessing that subsequently causes the exec to fail. > efimd.c should be garbage collected and the ldr_enter called removed. r328169 removed the copy of bootinfo that demonstrated the expected ordering: bi_load returned ldr_bootinfo(), then elf32_exec finished it off with ldr_enter. These details are captured in MI bootinfo bits nowadays and none of this is of use in the current world.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaFLb4ssSks%2BPirYozNcCpoLURoO3_AyG-Hx-yqFHYcgaQ>