1Dom0less
2========
3
4"Dom0less" is a set of Xen features that enable the deployment of a Xen
5system without an control domain (often referred to as "dom0"). Each
6feature can be used independently from the others, unless otherwise
7stated.
8
9Booting Multiple Domains from Device Tree
10-----------------------------------------
11
12This feature enables Xen to create a set of DomUs at boot time.
13Information about the DomUs to be created by Xen is passed to the
14hypervisor via Device Tree. Specifically, the existing Device Tree based
15Multiboot specification has been extended to allow for multiple domains
16to be passed to Xen. See docs/misc/arm/device-tree/booting.txt for more
17information about the Multiboot specification and how to use it.
18
19Currently, a control domain ("dom0") is still required, but in the
20future it will become unnecessary when all domains are created
21directly from Xen. Instead of waiting for the control domain to be fully
22booted and the Xen tools to become available, domains created by Xen
23this way are started right away in parallel. Hence, their boot time is
24typically much shorter.
25
26
27Configuration
28-------------
29
30### Loading binaries into memory ###
31
32U-Boot needs to load not just Xen, the device tree binary, the dom0 kernel and
33ramdisk. It also needs to load the kernel and ramdisk of any additional domains
34to boot. For example if this is the bootcmd for Xen and Dom0:
35
36    tftpb 0x1280000 xen.dtb
37    tftpb 0x0x80000 xen-Image
38    tftpb 0x1400000 xen.ub
39    tftpb 0x9000000 xen-rootfs.cpio.gz.u-boot
40
41    bootm 0x1400000 0x9000000 0x1280000
42
43If we want to add one DomU with Image-DomU as the DomU kernel
44and ramdisk-DomU as DomU ramdisk:
45
46    tftpb 0x1280000 xen.dtb
47    tftpb 0x80000 xen-Image
48    tftpb 0x1400000 xen.ub
49    tftpb 0x9000000 xen-rootfs.cpio.gz.u-boot
50
51    tftpb 0x2000000 Image-DomU
52    tftpb 0x3000000 ramdisk-DomU
53
54    bootm 0x1400000 0x9000000 0x1280000
55
56
57### Device Tree configuration ###
58
59In addition to loading the necessary binaries, we also need to advertise
60the presence of the additional VM and its configuration. It is done via
61device tree adding a node under /chosen as follows:
62
63    domU1 {
64        #address-cells = <1>;
65        #size-cells = <1>;
66        compatible = "xen,domain";
67        memory = <0 0x20000>;
68        cpus = <1>;
69        vpl011;
70
71        module@2000000 {
72            compatible = "multiboot,kernel", "multiboot,module";
73            reg = <0x2000000 0xffffff>;
74            bootargs = "console=ttyAMA0";
75        };
76
77        module@30000000 {
78            compatible = "multiboot,ramdisk", "multiboot,module";
79            reg = <0x3000000 0xffffff>;
80        };
81    };
82
83Where memory is the memory of the VM in KBs, cpus is the number of
84cpus. module@2000000 and module@3000000 advertise where the kernel and
85ramdisk are in memory.
86
87Note: the size specified should exactly match the size of the Kernel/initramfs.
88Otherwise, they may be unusable in Xen (for instance if they are compressed).
89
90See docs/misc/arm/device-tree/booting.txt for more information.
91
92Limitations
93-----------
94
95Domains started by Xen at boot time currently have the following
96limitations:
97
98- They cannot be properly shutdown or rebooted using xl. If one of them
99  crashes, the whole platform should be rebooted.
100
101- Some xl operations might not work as expected. xl is meant to be used
102  with domains that have been created by it. Using xl with domains
103  started by Xen at boot might not work as expected.
104
105- The GIC version is the native version. In absence of other
106  information, the GIC version exposed to the domains started by Xen at
107  boot is the same as the native GIC version.
108
109- No PV drivers. There is no support for PV devices at the moment. All
110  devices need to be statically assigned to guests.
111
112- Pinning vCPUs of domains started by Xen at boot can be
113  done from the control domain, using `xl vcpu-pin` as usual. It is not
114  currently possible to configure vCPU pinning without a control domain.
115  However, the NULL scheduler can be selected by passing `sched=null` to
116  the Xen command line. The NULL scheduler automatically assigns and
117  pins vCPUs to pCPUs, but the vCPU-pCPU assignments cannot be
118  configured.
119
120Notes
121-----
122
123- 'xl console' command will not attach to the domain's console in case
124  of dom0less. DomU are domains created by Xen (similar to Dom0) and
125  therefore they are all managed by Xen and some of the commands may not work.
126
127  A user is allowed to configure the key sequence to switch input.
128  Pressing the Xen "conswitch" (Ctrl-A by default) three times
129  switches input in case of dom0less mode.
130
131- Domains created by Xen will have no name at boot. Domain-0 has a name
132  thanks to the helper xen-init-dom0 called at boot by the initscript.
133  If you want to setup DomU name, then you will have to create the xenstore
134  node associated. By default DomU names are shown as '(null)' in the
135  xl domains list.
136