blob: 58a560094f706a37540d61b57e16dafc40f0a57c [file] [log] [blame] [view]
David Brazdil0dbb41f2019-09-09 18:03:35 +01001# Hafnium Manifest
2
3## Format
4
5The format of the manifest is a simple DeviceTree overlay:
6
7```
8/dts-v1/;
9/plugin/;
10
11&{/} {
12 hypervisor {
13 vm1 {
14 debug_name = "name";
15 };
16
17 vm2 {
18 debug_name = "name";
19 kernel_filename = "filename";
20 vcpu_count = <N>;
21 mem_size = <M>;
22 };
23 ...
24 };
25};
26```
27
28Note: `&{/}` is a syntactic sugar expanded by the DTC compiler. Make sure to
29use the DTC in `prebuilts/` as the version packaged with your OS may not support
30it yet.
31
32## Example
33
34The following manifest defines two secondary VMs, the first one with 1MB of
35memory, 2 CPUs and kernel image called `kernel0` (matches filename in Hafnium's
36[ramdisk](HafniumRamDisk.md)), while the second one has 2MB of memory, 4 CPUs
37and a kernel image called `kernel1`.
38
39```
40/dts-v1/;
41/plugin/;
42
43&{/} {
44 hypervisor {
45 vm1 {
46 debug_name = "primary VM";
47 };
48
49 vm2 {
50 debug_name = "secondary VM 1";
51 kernel_filename = "kernel0";
52 vcpu_count = <2>;
53 mem_size = <0x100000>;
54 };
55
56 vm3 {
57 debug_name = "secondary VM 2";
58 kernel_filename = "kernel1";
59 vcpu_count = <4>;
60 mem_size = <0x200000>;
61 };
62 };
63};
64```
65
66## Compiling
67
68Hafnium expects the manifest as part of the board FDT, i.e. DeviceTree in binary
69format (DTB).
70
71First, compile the manifest into a DTBO (binary overlay):
72```shell
73prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtbo <manifest_source_file>
74```
75
76Then overlay it with the DTB of your board:
77```shell
78prebuilts/linux-x64/dtc/fdtoverlay -i <board DTB> -o <output DTB> manifest.dtbo
79```