1# Hafnium Manifest
2
3## Format
4
5The format of the manifest is a simple DeviceTree overlay:
6
7```
8/dts-v1/;
9
10/ {
11	hypervisor {
12		compatible = "hafnium,hafnium";
13
14		ffa_tee_enabled;
15
16		vm1 {
17			debug_name = "name";
18			kernel_filename = "vmlinuz";
19			ramdisk_filename = "initrd.img";
20		};
21
22		vm2 {
23			debug_name = "name";
24			kernel_filename = "filename";
25			vcpu_count = <N>;
26			mem_size = <M>;
27		};
28		...
29	};
30};
31```
32
33## Example
34
35The following manifest defines a primary VM with two secondary VMs. The first
36secondary VM has 1MB of memory, 2 CPUs and kernel image called `kernel0`
37(matches filename in Hafnium's [ramdisk](HafniumRamDisk.md)). The second has 2MB
38of memory, 4 CPUs and, by omitting the `kernel_filename` property, a kernel
39preloaded into memory. The primary VM is given all remaining memory, the same
40number of CPUs as the hardware, a kernel image called `vmlinuz` and a ramdisk
41`initrd.img`. Secondaries cannot have a ramdisk. FF-A memory sharing with the
42TEE is enabled.
43
44```
45/dts-v1/;
46
47/ {
48	hypervisor {
49		compatible = "hafnium,hafnium";
50
51		ffa_tee_enabled;
52
53		vm1 {
54			debug_name = "primary VM";
55			kernel_filename = "vmlinuz";
56			ramdisk_filename = "initrd.img";
57
58			smc_whitelist = <
59				0x04000000
60				0x3200ffff
61				>;
62		};
63
64		vm2 {
65			debug_name = "secondary VM 1";
66			kernel_filename = "kernel0";
67			vcpu_count = <2>;
68			mem_size = <0x100000>;
69
70			smc_whitelist_permissive;
71		};
72
73		vm3 {
74			debug_name = "secondary VM 2";
75			vcpu_count = <4>;
76			mem_size = <0x200000>;
77		};
78	};
79};
80```
81
82## FF-A partition
83Partitions wishing to follow the FF-A specification must respect the
84format specified by the [TF-A binding document](https://trustedfirmware-a.readthedocs.io/en/latest/components/ffa-manifest-binding.html).
85
86## Compiling
87
88Hafnium expects the manifest inside its [RAM disk](HafniumRamDisk.md),
89in DeviceTree's binary format (DTB).
90
91Compile the manifest's source file into a DTB with:
92```shell
93prebuilts/linux-x64/dtc/dtc -I dts -O dtb --out-version 17 -o manifest.dtb <manifest_source_file>
94```
95