Page MenuHomeFreeBSD

fix UEFI boot on physical machines
ClosedPublic

Authored by decui_microsoft.com on Mar 6 2017, 3:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 4, 3:19 AM
Unknown Object (File)
Sat, May 31, 4:47 PM
Unknown Object (File)
Tue, May 27, 6:55 PM
Unknown Object (File)
Sun, May 11, 7:58 AM
Unknown Object (File)
May 7 2025, 10:40 PM
Unknown Object (File)
May 5 2025, 6:21 AM
Unknown Object (File)
Apr 23 2025, 9:59 PM
Unknown Object (File)
Apr 12 2025, 1:38 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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable