crosvm/cros_fdt/test-files/overlay.dtb
Jakob Vukalovic 12dead57f2 cros_fdt: Implement overlay filtering
For large overlay files, sometimes it is not neccessary to apply the
entire overlay, and only a few nodes must be applied instead. For
example, a large overlay file may contain nodes for all devices that can
be assigned to a VM via VFIO. However, in most cases only a small subset
of devices will actually be assigned, so only a small subset of the FDT
overlay must be applied.

This change implements device tree overlay filtering. Ie, it allows the
API user to choose which overlay nodes will be applied to the base.
It is possible to pass a set of symbols (node labels) to `apply_overlay`
function, which act as a filter for the device tree nodes.

This requires defining node labels (symbols) in DT source and compiling
DT overlays (`-@` option in dtc), so that the node symbols are exported
in `__symbols__` node.

Bug: b/296796644
Test: cd cros_fdt && cargo test
Change-Id: I2238cf08b85e1825f668f83d8edadd2446a28869
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4855967
Commit-Queue: Jakob Vukalović <jakobvukalovic@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-10 09:38:05 +00:00

848 B