diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-10-16 15:36:38 +1100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-11-06 13:28:50 +1100 |
commit | ecda95906930b808b9dca663bb956fd91fb3fea5 (patch) | |
tree | b09e26411804f3c7555b41636589742e44bb5aa6 /lib | |
parent | f8d999c7d9ab44eb86f32f4ada7f98d52364bbf1 (diff) | |
download | SLOF-ecda95906930b808b9dca663bb956fd91fb3fea5.zip SLOF-ecda95906930b808b9dca663bb956fd91fb3fea5.tar.gz SLOF-ecda95906930b808b9dca663bb956fd91fb3fea5.tar.bz2 |
fdt: Implement "fdt-fetch" method for client interface
The guest kernel fetches the device tree via the client interface,
calling it for every node and property, and traversing the entire tree
twice - first to build strings blob, second - to build struct blob.
On top of that there is also not so efficient implementation of
the "getprop" method - it calls slow "get-property" which does full
search for a property.
As the result, on a 256 CPU + 256 Intel E1000 virtual devices,
the guest's flatten_device_tree() takes roughly 8.5sec.
However now we have a FDT rendering helper in SLOF which takes about 350ms
to render the FDT. This implements a client interface call to allow
the guest to read it during early boot and save time.
The produced DTB is almost the same as the guest kernel would have
produced itself - the differences are:
1. SLOF creates an empty reserved map; the guest can easily fix
it up later;
2. SLOF only reuses 40 most popular strings; the guest reuses everything
it can - on a 256CPU + 256 PCI devices guest, the difference is about
20KB for 350KB FDT blob.
Note, that the guest also ditches the "name" property just like SLOF
does:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/prom_init.c?h=v4.13#n2302
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
If the guest tries "fdt-fetch" and SLOF does not have it, than SLOF
prints an error:
===
copying OF device tree...
fdt-fetch NOT FOUNDBuilding dt strings...
Building dt structure...
===
and the guest continues with the old method. We could suppress SLOF error
for such unlikely situation though.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions