Hi,
On 07/07/18 00:12, Stefano Stabellini wrote:
Extend the existing device tree based multiboot protocol to include
information regarding multiple domains to boot.
Signed-off-by: Stefano Stabellini <stefa...@xilinx.com>
---
Changes in v2:
- lower case kernel
- rename mem to memory
- mandate cpus and memory
- replace domU-kernel with kernel and domU-ramdisk with ramdisk
- rename xen,domU with xen,domain
- add info about dom0
- switch memory and cpus to integers
- remove defaults
- add vpl011
---
docs/misc/arm/device-tree/booting.txt | 108 ++++++++++++++++++++++++++++++++++
1 file changed, 108 insertions(+)
diff --git a/docs/misc/arm/device-tree/booting.txt
b/docs/misc/arm/device-tree/booting.txt
index ce2d0dc..5c3b8da 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -119,3 +119,111 @@ For those you would hardcode the Xen commandline in the
DTB under
line by writing bootargs (as for native Linux).
A Xen-aware bootloader would set xen,xen-bootargs for Xen, xen,dom0-bootargs
for Dom0 and bootargs for native Linux.
+
+
+Creating Multiple Domains directly from Xen
+===========================================
+
+It is possible to have Xen create other domains, in addition to dom0,
+out of the information provided via device tree. A kernel and initrd
+(optional) need to be specified for each guest.
+
+For each domain to be created there needs to be one node under /chosen
+with the following properties:
+
+- compatible
+
+ For domUs: "xen,domain"
+ For dom0: "xen,domain", "xen,initial-domain"
Looking briefly at the code, I don't see any support of
"xen,initial-domain". Did I miss anything?
But, it is a bit strange to put that in compatible. Shouldn't this be a
property?
+
+- memory
+
+ An integer specifying the amount of megabytes of RAM to allocate to
+ the guest.
I would define this a KB. With Dom0less it would be easy to spawn a
guest with less than a MB of memory. What matter is the amount of memory
should be page-aligned.
+
+- cpus
+
+ An integer specifying the number of vcpus to allocate to the guest.
+
+- vpl011
+
+ An integer to enable/disable a virtual pl011 for the guest to use.
The interrupt is a bit confusing here. What value will enable? What
value will disable?
I think you can just make an empty property.
+
+- #address-cells and #size-cells
+
+ Both #address-cells and #size-cells need to be specified because
+ both sub-nodes (described shortly) have reg properties.
+
+Under the "xen,domain" compatible node, one or more sub-nodes are present
+for the DomU kernel and ramdisk.
+
+The kernel sub-node has the following properties:
+
+- compatible
+
+ "multiboot,kernel"
+
+- reg
+
+ Specifies the physical address of the kernel in RAM and its
+ length.
+
+- bootargs (optional)
+
+ Command line parameters for the guest kernel.
+
+The ramdisk sub-node has the following properties:
+
+- compatible
+
+ "multiboot,ramdisk"
+
+- reg
+
+ Specifies the physical address of the ramdisk in RAM and its
+ length.
+
+
+Example
+=======
+
+chosen {
+ domU1 {
+ compatible = "xen,domain";
+ #address-cells = <0x2>;
+ #size-cells = <0x1>;
+ memory = <128>;
+ cpus = <2>;
+ vpl011 = <1>;
+
+ module@0x4a000000 {
+ compatible = "multiboot,kernel";
+ reg = <0x0 0x4a000000 0xffffff>;
+ bootargs = "console=ttyAMA0 init=/bin/sh";
+ };
+
+ module@0x4b000000 {
+ compatible = "multiboot,ramdisk";
+ reg = <0x0 0x4b000000 0xffffff>;
+ };
+ };
+
+ domU2 {
+ compatible = "xen,domain";
+ #address-cells = <0x2>;
+ #size-cells = <0x1>;
+ memory = <64>;
+ cpus = <1>;
+
+ module@0x4c000000 {
+ compatible = "multiboot,kernel";
+ reg = <0x0 0x4c000000 0xffffff>;
+ bootargs = "console=ttyAMA0 init=/bin/sh";
+ };
+
+ module@0x4d000000 {
+ compatible = "multiboot,ramdisk";
+ reg = <0x0 0x4d000000 0xffffff>;
+ };
+ };
+};
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel