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)
Sat, Mar 23, 8:11 AM
Unknown Object (File)
Fri, Mar 15, 6:15 PM
Unknown Object (File)
Feb 22 2024, 8:11 PM
Unknown Object (File)
Feb 16 2024, 3:51 PM
Unknown Object (File)
Jan 23 2024, 11:36 PM
Unknown Object (File)
Jan 22 2024, 1:34 PM
Unknown Object (File)
Jan 15 2024, 3:12 AM
Unknown Object (File)
Jan 15 2024, 2:40 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

Lint
Lint Skipped
Unit
Tests Skipped