aboutsummaryrefslogtreecommitdiff
path: root/lib/libhvcall/hvcall.code
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2017-10-19 14:58:30 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-11-06 13:28:49 +1100
commite6fc84652c9c0073f9183cbbc261ae7700f5e1e7 (patch)
tree61bc2727b8a73379e203a031c7d867d07797fc7e /lib/libhvcall/hvcall.code
parent7b61ea3e5c8bf1b9790a94339031f0f2b2726cbb (diff)
downloadSLOF-e6fc84652c9c0073f9183cbbc261ae7700f5e1e7.zip
SLOF-e6fc84652c9c0073f9183cbbc261ae7700f5e1e7.tar.gz
SLOF-e6fc84652c9c0073f9183cbbc261ae7700f5e1e7.tar.bz2
fdt: Pass the resulting device tree to QEMU
This creates flatten device tree and passes it to QEMU via a custom hypercall right before jumping to RTAS. This preloads strings with 40 property names from CPU and PCI device nodes and the strings lookup only searches within these. Test results on a guest with 256 CPUs and 256 virtual Intel E1000 devices running on a POWER8 box: FDTsize=366024 Strings=15888 Struct=350080 Reused str=12457 242 ms A simple guest (one CPU, no PCI) with this patch as is: FDTsize=15940 Strings=3148 Struct=12736 Reused str=84 7 ms While we are here, fix the version handling in fdt-init. It only matters a little for the fdt-debug==1 case though. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v6: * fix memory sizes for free-mem * store correct chosen-cpu to the header (used to be just 0) * fdt-skip-string uses zcount now and works 30% faster * moved to a new file - fdt-fl.fs v5: * applied latest comments from Segher * s/fdt-property/fdt-copy-property/, s/fdt-properties/fdt-copy-properties/ * reduced the temporary buffers to 1MB each as the guest uses 1MB in total anyway * do not pass root phandle to fdt-flatten-tree, it fetches it from device-tree itself * reworked fdt-copy-properties to use for-all-words proposed by Segher v4: * reworked fdt-properties, works lot faster * do not store "name" properties as nodes have names already v3: * fixed stack handling after hcall returned * fixed format versions in both rendering and parsing paths * rebased on top of removed unused hvcalls * renamed used variables to have fdtfl- prefixes as there are already some for parsing the initial dt v2: * fixed comments from review * added strings cache * changed last_compat_vers from 0x17 to 0x16 as suggested by dwg --- I tested the blob by storing it from QEMU to a file and decompiling it.
Diffstat (limited to 'lib/libhvcall/hvcall.code')
-rw-r--r--lib/libhvcall/hvcall.code5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
index 744469f..5918c90 100644
--- a/lib/libhvcall/hvcall.code
+++ b/lib/libhvcall/hvcall.code
@@ -123,3 +123,8 @@ PRIM(check_X2d_and_X2d_patch_X2d_sc1)
patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins);
MIRP
+
+PRIM(hv_X2d_update_X2d_dt)
+ unsigned long dt = TOS.u;
+ TOS.u = hv_generic(KVMPPC_H_UPDATE_DT, dt);
+MIRP