Page MenuHomeFreeBSD

efiloader: Setup FDT in autoload to fix overlays clobbering kenv
ClosedPublic

Authored by kevans on Aug 23 2018, 4:36 AM.
Tags
None
Referenced Files
F82236727: D16858.id47149.diff
Fri, Apr 26, 8:14 PM
F82236719: D16858.id47168.diff
Fri, Apr 26, 8:14 PM
F82236711: D16858.id.diff
Fri, Apr 26, 8:14 PM
Unknown Object (File)
Jan 25 2024, 5:53 PM
Unknown Object (File)
Dec 20 2023, 3:17 AM
Unknown Object (File)
Jul 5 2023, 12:25 AM
Subscribers
None

Details

Summary

manu found in the noted PR that overlays seemed to be clobbering the kenv and killing the boot. Further inspection revealed that one can fdt ls at the loader prompt for a successful boot, but autoboot breaks it.

In the autoboot case, first setup of FDT is happening in the middle of bi_load, which triggers loading of the DTBO from /boot.

This is bad, bad, bad. Files in the loader are loaded somewhere in the middle of the address space one after another. bi_load starts building the needed kernel bootinfo immediately after the highest-addr loaded file. File loads in the middle of bi_load suddenly clobber bootinfo and everything goes off the rails.

The solution to this is to use take advantage of arch_autoload to setup FDT in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in ubldr land, and is how it should have worked when overlay support was added to efiloader since fdt_setup_fdtp now has the potential to load files (courtesy of fdt_platform_load_dtb).

PR: 230804

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Aug 23 2018, 1:38 PM
This revision was automatically updated to reflect the committed changes.