History log of /freebsd-11-stable/stand/fdt/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
356771 16-Jan-2020 kevans

MFC r356538: stand/fdt: Scale blob size better as overlays apply

Currently, our overlay blob will grow to include the size of the complete
overlay blob we're applying. This doesn't scale very well with a lot of
overlays- they tend to include a lot of overhead, and they will generally
only add a fraction of their total size to the blob they're being applied
to.

To combat this, pack the blob as we apply new overlays and keep track of how
many overlays we've applied. Only ubldr has any fixups to be applied after
overlays, so we only need to re-pad the blob in ubldr. Presumably the
allocation won't fail since we just did a lot worse in trying to apply
overlays and succeeded.

I have no intention of removing the padding in make_dtb.sh. There might be
an argument to be had over whether it should be configurable, since ubldr
*is* the only loader that actually has fixups to be applied and we can do
this at runtime, but I'm not too concerned about this.

This diff has been sitting in Phabricator for a year and a half, but I've
decided to flush it as it does make sure that we're scaling the blob
appropriately and leave room at the end for fixups in case of some freak
circumstance where applying overlays leaves us with a blob of insufficient
size.

346480 21-Apr-2019 kevans

MFC r338262, r339334, r339796, r340240, r340857, r340917, r341007

r338262:
stand: fdt: Drop some write-only assignments/variables and leaked bits

Generally straightforward enough; a copy of argv[1] was being made in
command_fdt_internal, solely used for a comparison within the
handler-search, then promptly leaked.

r339334:
loader.efi: add poweroff command

Add poweroff command to make life a bit easier.

r339796:
Simplify the EFI delay() function by calling BS->Stall()

r340240:
loader: ptable_open() check for ptable_cd9660read result is wrong

The ptable_*read() functions return NULL on read errors (and partition table
closed as an side effect). The ptable_open must check the return value and
act properly.

r340857:
Nuke out buffer overflow safety marker code, it duplicates similar code in
the malloc()/free() as well as having potential of softening the handling
in case error is detected down to a mere warning as compared to hard panic
in free().

r340917:
Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.

r341007:
Bump the date of pxeboot(8) manual page for r340917.

PR: 123484, 232483

346302 16-Apr-2019 kevans

MFC r346132: stand: refactor overlay loading a little bit

It was pointed out that manually loading a .dtb to be used rather than
relying on platform-specific method for loading .dtb will result in overlays
not being applied. This was true because overlay loading was hacked into
fdt_platform_load_dtb, rather than done in a way more independent from how
the .dtb is loaded.

Instead, push overlay loading (for now) out into an
fdt_platform_load_overlays. This method easily allows ubldr to pull in any
fdt_overlays specified in the ub env, and omits overlay-checking on
platforms where they're not tested and/or not desired (e.g. powerpc). If we
eventually stop caring about fdt_overlays from ubenv (if we ever cared),
this method should get chopped out in favor of just calling
fdt_load_dtb_overlays() directly.

339161 03-Oct-2018 kevans

MFC r338219, r338250: FDT in Loader fixes

r338219:
fdt_fixups: relocate the /chosen node after applying fixups

As indicated by the comment, any fixups applied (which might include
overlays) can invalidate the previously located node by adding nodes or
setting/adding properties. The later fdt_setprop of fixup-applied property
would then fail because of the bad/wrong node offset.

This would have generally been harmless, but potentially caused multiple
applications of fixups and caused a little bit of bloat.

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

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).

332131 06-Apr-2018 kevans

MFC r329345: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds

OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC
for the toolchain to be added (bogusly) when building on amd64. Pull
all relevant defs back into defs.mk and delete bsd.stand.mk.

This saves about 15-20k on i386 loader and zfsloader which when
combined with Lua give us a lot more stack space in those constrained
environments.

329183 12-Feb-2018 kevans

MFC Loader Fixes Final: r327612,r327703,r327704,r327878,r327879,r327881,
r328007,r328029,r328030,r328031,r328061,r328156,r328169,r328288,r328289,
r328290,r328291,r328292,r328411,r328536,r328603,r328614,r328642,r328769,
r328779,r328780,r328781,r328782,r328783,r328806,r328808,r328826,r328835,
r328911,r328986,r328987,r328990,r328999,r329000,r329019,r329050,r329054,
r329060

r327612: Invent new #defines for the biospci_{read,write}_config function

r327703: Define __dmadat after #include'ing ufsread.c.

r327704: Fix printf missing format variables warnings.

r327878: Add GUID for UEFI boot manager variables.

r327879: Report the boot order and where we are in that boot order.

r327881: Allow this file to be included

r328007: Fix booting on some arm64 systems after r327879 by fixing the call
to utf8_to_ucs2

r328029: When returning an error and freeing allocated memory from
ucs2_to_utf8, NULL the return pointer.

r328030: Check the return value from utf8_to_ucs2 instead of whether or not
uv is NULL.

r328031: Need to free uv after we're done using it.

r328061: utf8_to_ucs2() should check for malloc failure

r328156: stand: Move sections around to fix stand/ build with ld.lld on
armv7

r328169: Remove extra copy of bootinfo.c. It's a bit rotted copy of the one
in efi/loader.

r328288: Fix some resource leaks.

r328289: Don't leak memory when displaying help.

r328290: On malloc failure, be sure to close the include file that triggered
it.

r328291: getenv does not return tainted data in the boot loader. Attempt to
clue Coverity into that fact.

r328292: There's no tainted data here, tag it as such to avoid false
positives.

r328411: loader.efi: add missing EFI GUIDs

r328536: loader: support for mixed-endianness ELF/loader and POWER8

r328603: Add missing non-POWERPC case to give the scr value something
non-zero.

r328614: Move libstand.3 to libsa.3. Update libsa.3 to include functions

r328642: Break out the interpreters (simple and forth) w/o ifdefs.

r328769: Centralize several variables.

r328779: Retire pnp.4th and the code needed only for 4th words used here.

r328780: These 4th words were an attempt to allow integration into the boot
loader scripts. However, that path won't be taken after all it
seems.

r328781: Remove pcibios forth support.

r328782: Now that we no longer conditionally compile some files outside of
ficl

r328783: Invent new LDR_INTERP for the loader interpreter to use.

r328806: We need more heap space to properly load newer powerpc kernels.

r328808: Implement strcoll as strcmp.

r328826: Make cross-endian loader changes apply only to powerpc

r328835: Fix regression introduced in r328806, preventing boot on many
platforms.

r328911: Ignore relocation tables for non-memory-resident sections.

r328986: Fix relative location of USB sources after recent move.

r328987: A more definitions to kernel emulation shim in order to build
stand/usb.

r328990: Move the stand/usb test loader into its own directory.

r328999: Fix indentation to FreeBSD standard for interp files

r329000: Move simple interpreter 'perform' into interp.c and call it

r329019: Move to tabs for indentation and to 8-space notches, per style(9).

r329050: Fix build of userboot.so

r329054: Set script.lang in the environment to either 'forth' or 'simple' to
reflect what scripting language was compiled into the loader.

r329060: loader: fix endianness conversion

PR: 225323


/freebsd-11-stable/ObsoleteFiles.inc
/freebsd-11-stable/stand/arm/uboot/Makefile
/freebsd-11-stable/stand/arm/uboot/ldscript.arm
/freebsd-11-stable/stand/common/boot.c
/freebsd-11-stable/stand/common/bootstrap.h
/freebsd-11-stable/stand/common/commands.c
/freebsd-11-stable/stand/common/install.c
/freebsd-11-stable/stand/common/interp.c
/freebsd-11-stable/stand/common/interp_backslash.c
/freebsd-11-stable/stand/common/interp_forth.c
/freebsd-11-stable/stand/common/interp_parse.c
/freebsd-11-stable/stand/common/interp_simple.c
/freebsd-11-stable/stand/common/load_elf.c
/freebsd-11-stable/stand/common/load_elf_obj.c
/freebsd-11-stable/stand/common/misc.c
/freebsd-11-stable/stand/common/pnp.c
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi/boot1/Makefile
/freebsd-11-stable/stand/efi/boot1/boot1.c
/freebsd-11-stable/stand/efi/fdt/Makefile
/freebsd-11-stable/stand/efi/include/efi.h
/freebsd-11-stable/stand/efi/include/efiapi.h
/freebsd-11-stable/stand/efi/libefi/Makefile
/freebsd-11-stable/stand/efi/libefi/efichar.c
/freebsd-11-stable/stand/efi/libefi/env.c
/freebsd-11-stable/stand/efi/loader/Makefile
/freebsd-11-stable/stand/efi/loader/arch/arm/ldscript.arm
/freebsd-11-stable/stand/efi/loader/arch/i386/bootinfo.c
/freebsd-11-stable/stand/efi/loader/main.c
Makefile
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl/Makefile
/freebsd-11-stable/stand/forth/Makefile
/freebsd-11-stable/stand/forth/loader.4th
/freebsd-11-stable/stand/forth/pcibios.4th
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/geli/Makefile
/freebsd-11-stable/stand/i386/boot0/Makefile
/freebsd-11-stable/stand/i386/btx/btx/Makefile
/freebsd-11-stable/stand/i386/btx/btxldr/Makefile
/freebsd-11-stable/stand/i386/btx/lib/Makefile
/freebsd-11-stable/stand/i386/cdboot/Makefile
/freebsd-11-stable/stand/i386/kgzldr/Makefile
/freebsd-11-stable/stand/i386/libfirewire/Makefile
/freebsd-11-stable/stand/i386/libfirewire/firewire.c
/freebsd-11-stable/stand/i386/libi386/Makefile
/freebsd-11-stable/stand/i386/libi386/biospci.c
/freebsd-11-stable/stand/i386/libi386/comconsole.c
/freebsd-11-stable/stand/i386/libi386/libi386.h
/freebsd-11-stable/stand/i386/loader/Makefile
/freebsd-11-stable/stand/i386/mbr/Makefile
/freebsd-11-stable/stand/i386/pmbr/Makefile
/freebsd-11-stable/stand/kshim/bsd_kernel.h
/freebsd-11-stable/stand/libsa/Makefile
/freebsd-11-stable/stand/libsa/environment.c
/freebsd-11-stable/stand/libsa/libsa.3
/freebsd-11-stable/stand/libsa/libstand.3
/freebsd-11-stable/stand/libsa/stand.h
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/mips/beri/boot2/Makefile
/freebsd-11-stable/stand/mips/beri/boot2/boot2.c
/freebsd-11-stable/stand/mips/beri/loader/Makefile
/freebsd-11-stable/stand/mips/beri/loader/exec.c
/freebsd-11-stable/stand/mips/uboot/Makefile
/freebsd-11-stable/stand/ofw/common/main.c
/freebsd-11-stable/stand/ofw/libofw/Makefile
/freebsd-11-stable/stand/ofw/libofw/elf_freebsd.c
/freebsd-11-stable/stand/ofw/libofw/libofw.h
/freebsd-11-stable/stand/ofw/libofw/ofw_copy.c
/freebsd-11-stable/stand/ofw/libofw/ofw_memory.c
/freebsd-11-stable/stand/ofw/libofw/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/boot1.chrp/Makefile
/freebsd-11-stable/stand/powerpc/kboot/Makefile
/freebsd-11-stable/stand/powerpc/kboot/conf.c
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.S
/freebsd-11-stable/stand/powerpc/kboot/host_syscall.h
/freebsd-11-stable/stand/powerpc/kboot/hostdisk.c
/freebsd-11-stable/stand/powerpc/kboot/kerneltramp.S
/freebsd-11-stable/stand/powerpc/kboot/main.c
/freebsd-11-stable/stand/powerpc/kboot/metadata.c
/freebsd-11-stable/stand/powerpc/kboot/ppc64_elf_freebsd.c
/freebsd-11-stable/stand/powerpc/ofw/Makefile
/freebsd-11-stable/stand/powerpc/ofw/ldscript.powerpc
/freebsd-11-stable/stand/powerpc/uboot/Makefile
/freebsd-11-stable/stand/sparc64/boot1/Makefile
/freebsd-11-stable/stand/sparc64/loader/Makefile
/freebsd-11-stable/stand/uboot/fdt/Makefile
/freebsd-11-stable/stand/uboot/lib/Makefile
/freebsd-11-stable/stand/usb/Makefile.test
/freebsd-11-stable/stand/usb/bsd_usbloader_test.c
/freebsd-11-stable/stand/usb/test
/freebsd-11-stable/stand/usb/usbcore.mk
/freebsd-11-stable/stand/userboot/test/Makefile
/freebsd-11-stable/stand/userboot/userboot/Makefile
/freebsd-11-stable/stand/zfs/Makefile
/freebsd-11-stable/sys/kern/link_elf_obj.c
329152 12-Feb-2018 kevans

MFC r328505,r328659: stand/fdt improvements

r328505: stand/fdt: Check /compatible property on overlay if it exists

r328659: stand/fdt: Rip out FDT VA tracking

329146 12-Feb-2018 kevans

MFC r326038,r326069,r326072: More stand simplification and fixes

r326038: Move some more common stuff up to Makefile.inc.

r326069: Fix gptzfsboot for cases with GELI.

r326072: Unbreak riscv build in universe.

329145 12-Feb-2018 kevans

MFC r325834,r325997,326502: Move sys/boot to stand/

This is effectively a direct commit to stable/11, due to differences between
stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often
accompanied by kernel changes. Many of these were also risc-v updates that
likely had many more dependencies to MFC.

Because of this, sys/boot/fdt/dts remains as-is while everything else in
sys/boot relocates to stand/.

r325834: Move sys/boot to stand. Fix all references to new location

r325997: Remove empty directories.

r326502: Document the sys/boot -> stand move in hier.7 and the top-level README.


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/Makefile.inc1
/freebsd-11-stable/README
/freebsd-11-stable/lib/libefivar/Makefile
/freebsd-11-stable/release/powerpc/generate-hfs.sh
/freebsd-11-stable/release/tools/vmimage.subr
/freebsd-11-stable/share/examples/bootforth/README
/freebsd-11-stable/share/examples/etc/make.conf
/freebsd-11-stable/share/man/man5/make.conf.5
/freebsd-11-stable/share/man/man7/hier.7
/freebsd-11-stable/share/man/man8/diskless.8
/freebsd-11-stable/stand
/freebsd-11-stable/stand/Makefile
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.arm
/freebsd-11-stable/stand/Makefile.arm64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/Makefile.mips
/freebsd-11-stable/stand/Makefile.pc98
/freebsd-11-stable/stand/Makefile.powerpc
/freebsd-11-stable/stand/Makefile.sparc64
/freebsd-11-stable/stand/arm
/freebsd-11-stable/stand/arm64
/freebsd-11-stable/stand/common
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi
/freebsd-11-stable/stand/fdt
/freebsd-11-stable/stand/fdt.mk
Makefile
Makefile.depend
fdt_loader_cmd.c
fdt_platform.h
help.fdt
/freebsd-11-stable/stand/ficl
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl32
/freebsd-11-stable/stand/forth
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/forth/support.4th
/freebsd-11-stable/stand/geli
/freebsd-11-stable/stand/i386
/freebsd-11-stable/stand/i386/Makefile.inc
/freebsd-11-stable/stand/kshim
/freebsd-11-stable/stand/libsa
/freebsd-11-stable/stand/libsa32
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/man
/freebsd-11-stable/stand/mips
/freebsd-11-stable/stand/ofw
/freebsd-11-stable/stand/pc98
/freebsd-11-stable/stand/pc98/Makefile.inc
/freebsd-11-stable/stand/powerpc
/freebsd-11-stable/stand/sparc64
/freebsd-11-stable/stand/uboot
/freebsd-11-stable/stand/uboot.mk
/freebsd-11-stable/stand/usb
/freebsd-11-stable/stand/userboot
/freebsd-11-stable/stand/userboot/ficl
/freebsd-11-stable/stand/userboot/libstand
/freebsd-11-stable/stand/userboot/zfs
/freebsd-11-stable/stand/zfs
/freebsd-11-stable/stand/zfs32
/freebsd-11-stable/sys/Makefile
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.mips
/freebsd-11-stable/sys/boot/Makefile.pc98
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm
/freebsd-11-stable/sys/boot/arm64
/freebsd-11-stable/sys/boot/common
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/fdt/Makefile.depend
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/fdt/fdt_platform.h
/freebsd-11-stable/sys/boot/fdt/help.fdt
/freebsd-11-stable/sys/boot/ficl
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl32
/freebsd-11-stable/sys/boot/forth
/freebsd-11-stable/sys/boot/geli
/freebsd-11-stable/sys/boot/i386
/freebsd-11-stable/sys/boot/kshim
/freebsd-11-stable/sys/boot/libsa
/freebsd-11-stable/sys/boot/libsa32
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man
/freebsd-11-stable/sys/boot/mips
/freebsd-11-stable/sys/boot/ofw
/freebsd-11-stable/sys/boot/pc98
/freebsd-11-stable/sys/boot/powerpc
/freebsd-11-stable/sys/boot/sparc64
/freebsd-11-stable/sys/boot/uboot
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/usb
/freebsd-11-stable/sys/boot/userboot
/freebsd-11-stable/sys/boot/zfs
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/contrib/dev/acpica/acpica_prep.sh
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/tools/bootparttest/Makefile
/freebsd-11-stable/tools/tools/zfsboottest/Makefile
/freebsd-11-stable/usr.sbin/bhyveload/Makefile