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)
Mon, Nov 18, 11:03 PM
Unknown Object (File)
Fri, Nov 15, 12:26 PM
Unknown Object (File)
Fri, Nov 15, 2:49 AM
Unknown Object (File)
Fri, Nov 15, 2:35 AM
Unknown Object (File)
Fri, Nov 15, 2:30 AM
Unknown Object (File)
Nov 14 2024, 12:06 AM
Unknown Object (File)
Nov 11 2024, 3:48 PM
Unknown Object (File)
Nov 11 2024, 11:06 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