]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r356538: stand/fdt: Scale blob size better as overlays apply
authorKyle Evans <kevans@FreeBSD.org>
Thu, 16 Jan 2020 03:11:25 +0000 (03:11 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Thu, 16 Jan 2020 03:11:25 +0000 (03:11 +0000)
commitc7aeea047562b6b3f74bf679734e6f2008de41b1
tree493a929b4bd07bbde2846dcaac08d8bf96428f41
parent880898e2c6cc2a3c9f23fd9d1d0a2612522219e3
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.
stand/fdt/fdt_loader_cmd.c
stand/fdt/fdt_platform.h
stand/uboot/fdt/uboot_fdt.c