Bug 235714 - Intermittent Boot Failure: bi_load_efi_data: GetMemoryMap error 5
Summary: Intermittent Boot Failure: bi_load_efi_data: GetMemoryMap error 5
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: Normal Affects Some People
Assignee: Rebecca Cran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-13 13:15 UTC by Damien
Modified: 2019-03-10 23:33 UTC (History)
2 users (show)

See Also:


Attachments
Boot failure: bi_load_efi_data: GetMemoryMap error 5 (487.78 KB, image/jpeg)
2019-02-13 13:15 UTC, Damien
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Damien 2019-02-13 13:15:01 UTC
Created attachment 201983 [details]
Boot failure: bi_load_efi_data: GetMemoryMap error 5

After commencing loading of the kernel, system fails to proceed through boot, stopping at bi_load_efi_data: GetMemoryMap error 5.  Please see attachment for further details.
Comment 1 Damien 2019-02-16 08:01:33 UTC
I should have added that this is on a Lenovo T480 on Intel Integrated Graphics.
Comment 2 Dmitri Goutnik freebsd_committer freebsd_triage 2019-02-16 11:56:28 UTC
See bug #210244
Comment 3 Rebecca Cran freebsd_committer freebsd_triage 2019-03-07 00:05:33 UTC
Thanks for the bug report. I just fixed this in r344839 - https://svnweb.freebsd.org/base?view=revision&revision=344839 .
Comment 4 Damien 2019-03-07 02:36:31 UTC
(In reply to Rebecca Cran from comment #3)
Saw that you added calling GetMemoryMap in a loop.  Does this mean that the root cause is in a fault UEFI implementation?

Thanks,
Comment 5 Rebecca Cran freebsd_committer freebsd_triage 2019-03-08 00:24:32 UTC
Damien: no, the UEFI firmware implementation is correct. The problem that calling it in a loop solves is the case where allocating memory for the memory map causes the memory map to become fragmented, which requires more memory to hold it.

Hopefully by allocating 10 more descriptors than GetMemoryMap tells us we need we avoid looping, but the loop is there to be sure.
Comment 6 Damien 2019-03-09 04:44:32 UTC
Thanks Rebecca,

Has your change been pushed to SVN 13-CURRENT?  I just synced and rebuilt kernel and world and I still get the error.
Comment 7 Rebecca Cran freebsd_committer freebsd_triage 2019-03-09 05:13:15 UTC
Yes, it's been pushed to 13-CURRENT but you'll need to update your ESP manually: it isn't currently updated during an installworld.

To update the ESP, mount it (e.g. /dev/ada0p1) as msdosfs and copy /boot/loader.efi to either efi/boot/bootx64.efi or efi/freebsd/loader.efi, whichever exists.
Comment 8 Damien 2019-03-10 23:33:25 UTC
(In reply to Rebecca Cran from comment #7)
I have rebooted 3 times without issue at this point after updating the ESP.