1Dom0 kernel and ramdisk modules
2================================
3
4Xen is passed the dom0 kernel and initrd via a reference in the /chosen
5node of the device tree.
6
7Each node contains the following properties:
8
9- compatible
10
11	Must always include at least the generic compatiblity string:
12
13		"multiboot,module"
14
15	Optionally a more specific compatible string may be used in
16	addition to the above. One of:
17
18	- "multiboot,kernel"	-- the dom0 kernel
19	- "multiboot,ramdisk"	-- the dom0 ramdisk
20	- "xen,xsm-policy"	-- XSM policy blob
21
22	It is normally recommended to include a more specific
23	compatible string (if one applies) in addition to the generic
24	string (which must always be present).
25
26	Xen will assume that the first module which lacks a more
27	specific compatible string is a "multiboot,kernel".
28
29	Xen will examine each module, starting from the second
30	module that lacks a specific compatible string.  Xen will
31	check each such module for the XSM Magic number:
32
33	- For a module which has the XSM Magic number: it will be
34	  treated by Xen as if its compatible string was
35	  "xen,xsm-policy";
36
37	- For a module which does not have the XSM Magic: the second
38	  module lacking a compatible string will be treated by Xen as
39	  if its compatible string was "multiboot,ramdisk"; for the
40	  third and subsequent modules which lack a specific
41	  compatible string, Xen will not apply any special treatment.
42
43	This means if the ramdisk module is present and does not have the
44	compatible string "multiboot,ramdisk", then it must always be the
45	second module.
46
47	Note: This XSM Magic detection behavior was introduced by Xen 4.7.
48	Xen 4.6 (and downwards) still requires the XSM module to have the
49	compatible string "xen,xsm-policy".
50
51	Xen 4.4 supported a different set of legacy compatible strings
52	which remain supported such that systems supporting both 4.4
53	and later can use a single DTB.
54	However when booting Xen using UEFI, the legacy compatible
55	strings are not supported.
56
57	- "xen,multiboot-module" equivalent to "multiboot,module"
58	- "xen,linux-zimage"     equivalent to "multiboot,kernel"
59	- "xen,linux-initrd"     equivalent to "multiboot,ramdisk"
60
61	For compatibility with Xen 4.4 the more specific "xen,linux-*"
62	names are non-optional and must be included.
63
64- reg
65
66	Specifies the physical address of the module in RAM and the
67	length of the module.
68
69- bootargs (optional)
70
71	Command line associated with this module. See below for the
72	priority of this field vs. other mechanisms of specifying the
73	bootargs for the kernel.
74
75- xen,uefi-binary (UEFI boot only)
76
77	String property that specifies the file name to be loaded by the UEFI
78	boot for this module. If this is specified, there is no need to specify
79	the reg property because it will be created by the UEFI stub on boot.
80	This option is needed only when UEFI boot is used, the node needs to be
81	compatible with multiboot,kernel or multiboot,ramdisk.
82
83Examples
84========
85
86A boot module of unspecified type:
87
88	module@0xc0000000 {
89		compatible = "multiboot,module";
90		reg = <0xc0000000 0x1234>;
91		bootargs = "...";
92	};
93
94A boot module containing a ramdisk:
95
96	module@0xd0000000 {
97		compatible = "multiboot,ramdisk", "multiboot,module";
98		reg = <0xd0000000 0x5678>;
99	};
100
101The previous examples are compatible with Xen 4.5+ only.
102
103To be compatible with Xen 4.4 as well use the legacy names:
104
105	module@0xd0000000 {
106		compatible = "xen,linux-initrd", "xen,multiboot-module";
107		reg = <0xd0000000 0x5678>;
108	};
109
110Command lines
111=============
112
113Xen also checks for properties directly under /chosen to find suitable command
114lines for Xen and Dom0. The logic is the following:
115
116 - If xen,xen-bootargs is present, it will be used for Xen.
117 - If xen,dom0-bootargs is present, it will be used for Dom0.
118 - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
119   bootargs will be used for Xen.
120 - If a kernel boot module is present and has a bootargs property then
121   the top-level bootargs will used for Xen.
122 - If no Xen specific properties are present, bootargs is for Dom0.
123 - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
124   bootargs will be used for Dom0.
125
126Most of these cases is to make booting with Xen-unaware bootloaders easier.
127For those you would hardcode the Xen commandline in the DTB under
128/chosen/xen,xen-bootargs and would let the bootloader set the Dom0 command
129line by writing bootargs (as for native Linux).
130A Xen-aware bootloader would set xen,xen-bootargs for Xen, xen,dom0-bootargs
131for Dom0 and bootargs for native Linux.
132
133
134UEFI boot and DT
135================
136
137When Xen is booted using UEFI, it doesn't read the configuration file if any
138multiboot module is specified. To force Xen to load the configuration file, the
139boolean property xen,uefi-cfg-load must be declared in the /chosen node.
140
141
142Creating Multiple Domains directly from Xen
143===========================================
144
145It is possible to have Xen create other domains, in addition to dom0,
146out of the information provided via device tree. A kernel and initrd
147(optional) need to be specified for each guest.
148
149For each domain to be created there needs to be one node under /chosen
150with the following properties:
151
152- compatible
153
154    For domUs: "xen,domain"
155
156- memory
157
158	A 64-bit integer specifying the amount of kilobytes of RAM to
159    allocate to the guest.
160
161- cpus
162
163    An integer specifying the number of vcpus to allocate to the guest.
164
165- llc-colors
166    A string specifying the LLC color configuration for the guest.
167    Refer to docs/misc/cache_coloring.rst for syntax. This option is applicable
168    only to Arm64 guests.
169
170- capabilities
171    Optional.  A 32-bit integer representing a bit field of domain capabilities
172    for a disaggregated system.  A traditional dom0 has all of these
173    capabilities, and a domU has none of them.
174
175    0x1 DOMAIN_CAPS_CONTROL  - A privileged, control domain
176    0x2 DOMAIN_CAPS_HARDWARE - The hardware domain - there can be only 1
177    0x4 DOMAIN_CAPS_XENSTORE - The xenstore domain - there can be only 1
178
179    The default is no capabilities.
180
181- vpl011
182
183    An empty property to enable/disable a virtual pl011 for the guest to
184    use. The virtual pl011 uses SPI number 0 (see GUEST_VPL011_SPI).
185    Please note that the SPI used for the virtual pl011 could clash with the
186    physical SPI of a physical device assigned to the guest.
187
188- nr_spis
189
190    Optional. A 32-bit integer specifying the number of SPIs (Shared
191    Peripheral Interrupts) to allocate for the domain. If nr_spis is
192    missing, the max number of SPIs supported by the physical GIC is
193    used, or GUEST_VPL011_SPI+1 if vpl011 is enabled, whichever is
194    greater.
195
196- #address-cells and #size-cells
197
198    Both #address-cells and #size-cells need to be specified because
199    both sub-nodes (described shortly) have reg properties.
200
201- direct-map
202
203    Only available when statically allocated memory is used for the domain.
204    An empty property to request the memory of the domain to be
205    direct-map (guest physical address == physical address).
206
207- domain-cpupool
208
209    Optional. Handle to a xen,cpupool device tree node that identifies the
210    cpupool where the guest will be started at boot.
211
212- sve
213
214    Optional. The `sve` property enables Arm SVE usage for the domain and sets
215    the maximum SVE vector length, the option is applicable only to Arm64
216    guests.
217    A value equal to 0 disables the feature, this is the default value.
218    Specifying this property with no value, means that the SVE vector length
219    will be set equal to the maximum vector length supported by the platform.
220    Values above 0 explicitly set the maximum SVE vector length for the domain,
221    allowed values are from 128 to maximum 2048, being multiple of 128.
222    Please note that when the user explicitly specifies the value, if that value
223    is above the hardware supported maximum SVE vector length, the domain
224    creation will fail and the system will stop, the same will occur if the
225    option is provided with a non zero value, but the platform doesn't support
226    SVE.
227
228- trap-unmapped-accesses
229
230    Optional. An integer that configures handling of accesses to unmapped
231    address ranges.
232    If set to 0, guest accesses will read all bits as ones, e.g 0xFFFFFFFF
233    for a 32bit access and writes will be ignored.
234    If set to 1, guest accesses will trap.
235
236    The default is 1 when trap-unmapped-accesses is absent.
237
238- xen,enhanced
239
240    A string property. Possible property values are:
241
242    - "enabled" (or missing property value)
243    Xen PV interfaces, including grant-table and xenstore, will be
244    enabled for the VM.
245
246    - "legacy"
247    Same as above, but the way the xenstore page is allocated is not
248    compatible with static-mem guests. On the other hand, it works with
249    older Linux kernels.
250
251    - "disabled"
252    Xen PV interfaces are disabled.
253
254    - "no-xenstore"
255    All default Xen PV interfaces, including grant-table will be enabled but
256    xenstore will be disabled for the VM.
257
258    If the xen,enhanced property is present with no value, it defaults
259    to "enabled". If the xen,enhanced property is not present, PV
260    interfaces are disabled.
261
262    In the future other possible property values might be added to
263    enable only selected interfaces.
264
265- xen,domain-p2m-mem-mb
266
267    Optional. A 32-bit integer specifying the amount of megabytes of RAM
268    used for the domain P2M pool. This is in-sync with the shadow_memory
269    option in xl.cfg. Leaving this field empty in device tree will lead to
270    the default size of domain P2M pool, i.e. 1MB per guest vCPU plus 4KB
271    per MB of guest RAM plus 512KB for guest extended regions.
272
273- max_grant_version
274
275    Optional. A 32-bit integer specifying the maximum grant table version
276    the domain is allowed to use (valid values are 1 or 2). If this property
277    is missing, the value specified by Xen command line parameter gnttab=max-ver
278    (or its default value if unspecified, i.e. 1) is used.
279
280- max_grant_frames
281
282    Optional. A 32-bit integer specifying the maximum number of grant frames
283    the domain is allowed to have. If this property is missing, the value
284    specified by Xen command line parameter gnttab_max_frames (or its default
285    value if unspecified, i.e. 64) is used.
286
287- max_maptrack_frames
288
289    Optional. A 32-bit integer specifying the maximum number of grant maptrack
290    frames the domain is allowed to have. If this property is missing, the
291    value specified by Xen command line parameter gnttab_max_maptrack_frames
292    (or its default value if unspecified, i.e. 1024) is used.
293
294- passthrough
295
296    A string property specifying whether IOMMU mappings are enabled for the
297    domain and hence whether it will be enabled for passthrough hardware.
298    Possible property values are:
299
300    - "enabled"
301    IOMMU mappings are enabled for the domain. Note that this option is the
302    default if the user provides the device partial passthrough device tree
303    for the domain.
304
305    - "disabled"
306    IOMMU mappings are disabled for the domain and so hardware may not be
307    passed through. This option is the default if this property is missing
308    and the user does not provide the device partial device tree for the domain.
309
310Under the "xen,domain" compatible node, one or more sub-nodes are present
311for the DomU kernel and ramdisk.
312
313The kernel sub-node has the following properties:
314
315- compatible
316
317    "multiboot,kernel", "multiboot,module"
318
319- reg
320
321    Specifies the physical address of the kernel in RAM and its
322    length.
323
324- bootargs (optional)
325
326    Command line parameters for the guest kernel.
327
328- xen,uefi-binary (UEFI boot only)
329
330    String property that specifies the file name to be loaded by the UEFI boot
331    for this module. If this is specified, there is no need to specify the reg
332    property because it will be created by the UEFI stub on boot.
333    This option is needed only when UEFI boot is used.
334
335The ramdisk sub-node has the following properties:
336
337- compatible
338
339    "multiboot,ramdisk", "multiboot,module"
340
341- reg
342
343    Specifies the physical address of the ramdisk in RAM and its
344    length.
345
346- xen,uefi-binary (UEFI boot only)
347
348    String property that specifies the file name to be loaded by the UEFI boot
349    for this module. If this is specified, there is no need to specify the reg
350    property because it will be created by the UEFI stub on boot.
351    This option is needed only when UEFI boot is used.
352
353Under the "xen,domain" compatible node, it is possible optionally to add
354one or more sub-nodes to configure vCPU affinity. The vCPU affinity
355sub-node has the following properties:
356
357- compatible
358
359    "xen,vcpu"
360
361- id
362
363    A 32-bit integer that specifies the vCPU id. 0 is the first vCPU.
364    The last vCPU is cpus-1, where "cpus" is the number of vCPUs
365    specified with the "cpus" property under the "xen,domain" node.
366    Each "xen,vcpu" node must have a unique vCPU id.
367
368- hard-affinity
369
370    Optional. A string specifying the hard affinity configuration for the
371    vCPU: a comma-separated list of pCPUs or ranges of pCPUs is used.
372    Ranges are hyphen-separated intervals (such as `0-4`) and are inclusive
373    on both sides. The numbers refer to logical pCPU ids.
374
375
376Example
377=======
378
379chosen {
380    domU1 {
381        compatible = "xen,domain";
382        #address-cells = <0x2>;
383        #size-cells = <0x1>;
384        memory = <0 131072>;
385        cpus = <2>;
386        vpl011;
387
388        vcpu0 {
389            compatible = "xen,vcpu";
390            id = <0>;
391            hard-affinity = "0-3";
392        };
393
394        vcpu1 {
395            compatible = "xen,vcpu";
396            id = <1>;
397            hard-affinity = "1,4-7";
398        };
399
400        module@0x4a000000 {
401            compatible = "multiboot,kernel", "multiboot,module";
402            reg = <0x0 0x4a000000 0xffffff>;
403            bootargs = "console=ttyAMA0 init=/bin/sh";
404        };
405
406        module@0x4b000000 {
407            compatible = "multiboot,ramdisk", "multiboot,module";
408            reg = <0x0 0x4b000000 0xffffff>;
409        };
410    };
411
412    domU2 {
413        compatible = "xen,domain";
414        #address-cells = <0x2>;
415        #size-cells = <0x1>;
416        memory = <0 65536>;
417        cpus = <1>;
418
419        module@0x4c000000 {
420            compatible = "multiboot,kernel", "multiboot,module";
421            reg = <0x0 0x4c000000 0xffffff>;
422            bootargs = "console=ttyAMA0 init=/bin/sh";
423        };
424
425        module@0x4d000000 {
426            compatible = "multiboot,ramdisk", "multiboot,module";
427            reg = <0x0 0x4d000000 0xffffff>;
428        };
429    };
430};
431
432
433Device Assignment
434=================
435
436Device Assignment (Passthrough) is supported by adding another module,
437alongside the kernel and ramdisk, with the device tree fragment
438corresponding to the device node to assign to the guest.
439
440The dtb sub-node should have the following properties:
441
442- compatible
443
444    "multiboot,device-tree" and "multiboot,module"
445
446- reg
447
448    Specifies the physical address of the device tree binary fragment
449    RAM and its length.
450
451- xen,uefi-binary (UEFI boot only)
452
453    String property that specifies the file name to be loaded by the UEFI boot
454    for this module. If this is specified, there is no need to specify the reg
455    property because it will be created by the UEFI stub on boot.
456    This option is needed only when UEFI boot is used.
457
458As an example:
459
460        module@0xc000000 {
461            compatible = "multiboot,device-tree", "multiboot,module";
462            reg = <0x0 0xc000000 0xffffff>;
463        };
464
465The DTB fragment is loaded at 0xc000000 in the example above. It should
466follow the convention explained in docs/misc/arm/passthrough.txt. The
467DTB fragment will be added to the guest device tree, so that the guest
468kernel will be able to discover the device.
469
470
471Static Allocation
472=============
473
474Static Allocation refers to system or sub-system(domains) for which memory
475areas are pre-defined by configuration using physical address ranges.
476
477Memory can be statically allocated to a domain using the property "xen,static-
478mem" defined in the domain configuration. The number of cells for the address
479and the size must be defined respectively by the parent node properties
480"#address-cells" and "#size-cells".
481
482The property 'memory' is still needed and should match the amount of memory
483given to the guest. Currently, it either comes from static memory or lets Xen
484allocate from heap. *Mixing* is not supported.
485
486The static memory will be mapped in the guest at the usual guest memory
487addresses (GUEST_RAM0_BASE, GUEST_RAM1_BASE) defined by
488xen/include/public/arch-arm.h.
489
490Below is an example on how to specify the static memory region in the
491device-tree:
492
493    / {
494        chosen {
495            #address-cells = <0x1>;
496            #size-cells = <0x1>;
497            ...
498            domU1 {
499                compatible = "xen,domain";
500                cpus = <2>;
501                memory = <0x0 0x80000>;
502                xen,static-mem = <0x30000000 0x20000000>;
503                ...
504            };
505        };
506    };
507
508This will reserve a 512MB region starting at the host physical address
5090x30000000 to be exclusively used by DomU1.
510
511Static Event Channel
512====================
513The event channel communication will be established statically between two
514domains (dom0 and domU also). Event channel connection information between
515domains will be passed to Xen via the device tree node. The event channel
516will be created and established in Xen before the domain started. The domain
517does not need to do any operation to establish a connection. Domain only
518needs hypercall EVTCHNOP_send(local port) to send notifications to the
519remote guest.
520
521There is no need to describe the static event channel info in the domU device
522tree. Static event channels are only useful in fully static configurations,
523and in those configurations, the domU device tree dynamically generated by Xen
524is not needed.
525
526To enable the event-channel interface for domU guests include the
527xen,enhanced = "no-xenstore" property in the domU Xen device tree node.
528
529Under the "xen,domain" compatible node for domU, there needs to be sub-nodes
530with compatible "xen,evtchn" that describe the event channel connection
531between two domUs. For dom0, there needs to be sub-nodes with compatible
532"xen,evtchn" under the chosen node.
533
534The static event channel node has the following properties:
535
536- compatible
537
538    "xen,evtchn"
539
540- xen,evtchn
541
542    The property is tuples of two numbers
543    (local-evtchn link-to-foreign-evtchn) where:
544
545    local-evtchn is an integer value that will be used to allocate local port
546    for a domain to send and receive event notifications to/from the remote
547    domain. Maximum supported value is 2^17 for FIFO ABI and 4096 for 2L ABI.
548    It is recommended to use low event channel IDs.
549
550    link-to-foreign-evtchn is a single phandle to a remote evtchn to which
551    local-evtchn will be connected.
552
553Example
554=======
555
556chosen {
557
558    /* One sub-node per local event channel. This sub-node is for Dom0. */
559    ec1: evtchn@1 {
560         compatible = "xen,evtchn-v1";
561         /* local-evtchn link-to-foreign-evtchn */
562         xen,evtchn = <0xa &ec2>;
563    };
564
565    domU1 {
566        compatible = "xen,domain";
567        #address-cells = <0x2>;
568        #size-cells = <0x1>;
569        xen,enhanced = "no-xenstore";
570
571        /* One sub-node per local event channel */
572        ec2: evtchn@2 {
573            compatible = "xen,evtchn-v1";
574            /* local-evtchn link-to-foreign-evtchn */
575            xen,evtchn = <0xa &ec1>;
576        };
577
578        ec3: evtchn@3 {
579            compatible = "xen,evtchn-v1";
580            xen,evtchn = <0xb &ec5>;
581        };
582
583        ec4: evtchn@4 {
584            compatible = "xen,evtchn-v1";
585            xen,evtchn = <0xc &ec6>;
586        };
587    };
588
589    domU2 {
590        compatible = "xen,domain";
591        #address-cells = <0x2>;
592        #size-cells = <0x1>;
593        xen,enhanced = "no-xenstore";
594
595        /* One sub-node per local event channel */
596        ec5: evtchn@5 {
597            compatible = "xen,evtchn-v1";
598            /* local-evtchn link-to-foreign-evtchn */
599            xen,evtchn = <0xb &ec3>;
600        };
601
602        ec6: evtchn@6 {
603            compatible = "xen,evtchn-v1";
604            xen,evtchn = <0xd &ec4>;
605        };
606    };
607};
608
609Static Heap Memory
610==================
611
612The static heap memory refers to parts of RAM reserved in the beginning of
613boot time for heap. The memory is reserved by configuration in the device
614tree using physical address ranges.
615
616The static heap memory declared in the device tree defines the memory areas
617that will be reserved to be used exclusively as heap.
618
619- For Arm32, since there are separated heaps, the static heap will be used
620for both domheap and xenheap. The admin should make sure that the static
621heap region should contain enough memory below 4GB to cater 32-bit DMA.
622
623- For Arm64, since there is a single heap, the defined static heap areas
624shall always go to the heap allocator.
625
626The static heap memory is an optional feature and can be enabled by adding
627below device tree property.
628
629- xen,static-heap
630
631    Property under the top-level "chosen" node. It specifies the address
632    and size of Xen static heap memory. Number of address and size cells
633    for the "xen,static-heap" property is determined by the root node
634    "#address-cells" and "#size-cells". Note that at least a 64KB alignment
635    is required.
636
637Below is an example on how to specify the static heap in device tree:
638
639    / {
640        #address-cells = <0x2>;
641        #size-cells = <0x2>;
642        ...
643        chosen {
644            xen,static-heap = <0x0 0x30000000 0x0 0x40000000>;
645            ...
646        };
647    };
648
649RAM starting from the host physical address 0x30000000 of 1GB size will
650be reserved as static heap.
651
652Static Shared Memory
653====================
654
655The static shared memory device tree nodes allow users to statically set up
656shared memory on dom0less system, enabling domains to do shm-based
657communication.
658
659- compatible
660
661    "xen,domain-shared-memory-v1"
662
663- xen,shm-id
664
665    An arbitrary string that represents the unique identifier of the shared
666    memory region, with a strict limit on the number of characters(\0 included),
667    `MAX_SHM_ID_LENGTH(16)`. e.g. "xen,shm-id = "my-shared-mem-1"".
668
669- xen,shared-mem
670
671    An array takes a physical address, which is the base address of the
672    shared memory region in host physical address space, a size, and a guest
673    physical address, as the target address of the mapping.
674    e.g. xen,shared-mem = < [host physical address] [guest address] [size] >;
675    Note that if a domain is direct-mapped, i.e. the Dom0 and the Dom0less
676    DomUs with `direct-map` device tree property, the static shared memory
677    should also be direct-mapped (host physical address == guest address).
678
679    It shall also meet the following criteria:
680    1) If the SHM ID matches with an existing region, the address range of the
681    region shall also exactly match.
682    2) If the SHM ID does not match with any other existing region, it should
683    also not overlap with any other regions.
684
685    The number of cells for the host address (and size) is the same as the
686    guest pseudo-physical address and they are inherited from the parent node.
687
688    Host physical address is optional, when missing Xen decides the location.
689    e.g. xen,shared-mem = < [guest address] [size] >;
690
691- role (Optional)
692
693    A string property specifying the ownership of a shared memory region,
694    the value must be one of the following: "owner", or "borrower"
695    A shared memory region could be explicitly backed by one domain, which is
696    called "owner domain", and all the other domains who are also sharing
697    this region are called "borrower domain".
698    If not specified, the default value is "borrower" and owner is
699    DOMID_IO, a system domain.
700
701As an example:
702
703chosen {
704    #address-cells = <0x1>;
705    #size-cells = <0x1>;
706    xen,xen-bootargs = "console=dtuart dtuart=serial0 bootscrub=0";
707
708    ......
709
710    /* this is for Dom0 */
711    dom0-shared-mem@10000000 {
712        compatible = "xen,domain-shared-memory-v1";
713        role = "owner";
714        xen,shm-id = "my-shared-mem-0";
715        xen,shared-mem = <0x10000000 0x10000000 0x10000000>;
716    };
717
718    domU1 {
719        compatible = "xen,domain";
720        #address-cells = <0x1>;
721        #size-cells = <0x1>;
722        memory = <0 131072>;
723        cpus = <2>;
724        vpl011;
725
726        /*
727         * shared memory region "my-shared-mem-0" is shared
728         * between Dom0 and DomU1.
729         */
730        domU1-shared-mem@10000000 {
731            compatible = "xen,domain-shared-memory-v1";
732            role = "borrower";
733            xen,shm-id = "my-shared-mem-0";
734            xen,shared-mem = <0x10000000 0x50000000 0x10000000>;
735        };
736
737        /*
738         * shared memory region "my-shared-mem-1" is shared between
739         * DomU1 and DomU2.
740         */
741        domU1-shared-mem@50000000 {
742            compatible = "xen,domain-shared-memory-v1";
743            xen,shm-id = "my-shared-mem-1";
744            xen,shared-mem = <0x50000000 0x60000000 0x20000000>;
745        };
746
747        /*
748         * shared memory region "my-shared-mem-2" is shared between
749         * DomU1 and DomU2.
750         */
751        domU1-shared-mem-2 {
752            compatible = "xen,domain-shared-memory-v1";
753            xen,shm-id = "my-shared-mem-2";
754            role = "owner";
755            xen,shared-mem = <0x80000000 0x20000000>;
756        };
757
758        ......
759
760    };
761
762    domU2 {
763        compatible = "xen,domain";
764        #address-cells = <0x1>;
765        #size-cells = <0x1>;
766        memory = <0 65536>;
767        cpus = <1>;
768
769        /*
770         * shared memory region "my-shared-mem-1" is shared between
771         * domU1 and domU2.
772         */
773        domU2-shared-mem@50000000 {
774            compatible = "xen,domain-shared-memory-v1";
775            xen,shm-id = "my-shared-mem-1";
776            xen,shared-mem = <0x50000000 0x70000000 0x20000000>;
777        };
778
779        domU2-shared-mem-2 {
780            compatible = "xen,domain-shared-memory-v1";
781            xen,shm-id = "my-shared-mem-2";
782            role = "borrower";
783            xen,shared-mem = <0x90000000 0x20000000>;
784        };
785
786        ......
787    };
788};
789
790This is an example with two static shared memory regions.
791
792For the static shared memory region identified as "my-shared-mem-0", host
793physical address starting at 0x10000000 of 256MB will be reserved to be
794shared between Dom0 and DomU1. It will get mapped at 0x10000000 in Dom0 guest
795physical address space, and at 0x50000000 in DomU1 guest physical address space.
796Dom0 is explicitly defined as the owner domain, and DomU1 is the borrower domain.
797
798For the static shared memory region identified as "my-shared-mem-1", host
799physical address starting at 0x50000000 of 512MB will be reserved to be
800shared between DomU1 and DomU2. It will get mapped at 0x60000000 in DomU1 guest
801physical address space, and at 0x70000000 in DomU2 guest physical address space.
802DomU1 and DomU2 are both the borrower domain, the owner domain is the default
803owner domain DOMID_IO.
804
805For the static shared memory region "my-shared-mem-2", since host physical
806address is not provided by user, Xen will automatically allocate 512MB
807from heap as static shared memory to be shared between DomU1 and DomU2.
808The automatically allocated static shared memory will get mapped at
8090x80000000 in DomU1 guest physical address space, and at 0x90000000 in DomU2
810guest physical address space. DomU1 is explicitly defined as the owner domain,
811and DomU2 is the borrower domain.
812