Page MenuHomeFreeBSD

fix UEFI boot on physical machines
ClosedPublic

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

Details

Summary

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
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22

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

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

Event Timeline

decui_microsoft.com retitled this revision from to fix UEFI boot on physical machines.
decui_microsoft.com updated this object.
decui_microsoft.com edited the test plan for this revision. (Show Details)
decui_microsoft.com updated this object.
sepherosa_gmail.com 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.