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