Page MenuHomeFreeBSD

fix UEFI boot on physical machines

Authored by on Mar 6 2017, 3:47 AM.



loader.efi: fix recent UEFI-boot regression on physical machines

This patch fixes my recent patch
"loader.efi: reduce the size of the staging area if necessary", which
causes EFI-boot failure on physical machines:

on the host there is a 1MB LoaderData memory range, which splits
the big Conventional Memory range into a small one (15MB) and a
big one: the small one is too small to hold the staging area.

We can actually use the LoaderData range safely, because when
amd64_tramp -> efi_copy_finish() starts to run, we're almost at
the very end of the efi loader code and we're going to "return"
to the kernel entry, so we're pretty sure we won't access any loader
data any more.

For people who are interested in the details: please see

PS, some people reported the regression happened to FreeBSD VM
runing on Bhyve in EFI mode too. This patch should resolve the issue
too, though I don't have such a setup to test.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline retitled this revision from to fix UEFI boot on physical machines. updated this object. edited the test plan for this revision. (Show Details) updated this object. edited edge metadata.
This revision is now accepted and ready to land.Mar 6 2017, 9:19 AM
This revision was automatically updated to reflect the committed changes.