[Xen-devel] [PATCH] Improve Dom0-less documentation

Viktor Mitin posted 1 patch 4 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190708123545.19406-1-viktor.mitin.19@gmail.com
docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
[Xen-devel] [PATCH] Improve Dom0-less documentation
Posted by Viktor Mitin 4 years, 9 months ago
Updated configuration example according to arm64
and added more cases about known xl limitations.

Signed-off-by: Viktor Mitin <viktor_mitin@epam.com>
---
 docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/docs/features/dom0less.pandoc b/docs/features/dom0less.pandoc
index e076e3739e..961813696f 100644
--- a/docs/features/dom0less.pandoc
+++ b/docs/features/dom0less.pandoc
@@ -62,19 +62,19 @@ device tree adding a node under /chosen as follows:
 
     domU1 {
         compatible = "xen,domain";
-        memory = <0x20000>;
+        memory = <0x0 0x20000>;
         cpus = 1;
         vpl011;
 
         module@2000000 {
             compatible = "multiboot,kernel", "multiboot,module";
-            reg = <0x2000000 0xffffff>;
+            reg = <0x0 0x2000000 0x0 0xffffff>;
             bootargs = "console=ttyAMA0";
         };
 
         module@30000000 {
             compatible = "multiboot,ramdisk", "multiboot,module";
-            reg = <0x3000000 0xffffff>;
+            reg = <0x0 0x3000000 0x0 0xffffff>;
         };
     };
 
@@ -90,12 +90,25 @@ Limitations
 Domains started by Xen at boot time currently have the following
 limitations:
 
-- They cannot be properly shutdown or rebooted using xl. If one of them
-  crashes, the whole platform should be rebooted.
-
 - Some xl operations might not work as expected. xl is meant to be used
-  with domains that have been created by it. Using xl with domains
-  started by Xen at boot might not work as expected.
+  with domains that have been created by it:
+
+    -> Using xl with domains started by Xen at boot might not work
+       as expected.
+
+    -> They cannot be properly shutdown or rebooted using xl.
+       If one of them crashes, the whole platform should be rebooted.
+
+    -> 'xl console' command will not switch console input.
+       Type 'CTRL-a' three times to switch input in case of dom0less mode.
+
+    -> 'xl list' prints the list of domains.
+       However DomU names are shown as '(null)' in the list. For example:
+
+        root@dom0:~# xl list
+        Name                         ID   Mem VCPUs      State   Time(s)
+        Domain-0                      0   256     4     r-----       6.2
+        (null)                        1   256     1     -b----       1.7
 
 - The GIC version is the native version. In absence of other
   information, the GIC version exposed to the domains started by Xen at
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] Improve Dom0-less documentation
Posted by Julien Grall 4 years, 9 months ago
Hello,

On 7/8/19 1:35 PM, Viktor Mitin wrote:
> Updated configuration example according to arm64
> and added more cases about known xl limitations.

dom0less is not an arm64 specific feature. It also works on arm32, and 
therefore the docs should work for both cases. However...

> 
> Signed-off-by: Viktor Mitin <viktor_mitin@epam.com>
> ---
>   docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
>   1 file changed, 21 insertions(+), 8 deletions(-)
> 
> diff --git a/docs/features/dom0less.pandoc b/docs/features/dom0less.pandoc
> index e076e3739e..961813696f 100644
> --- a/docs/features/dom0less.pandoc
> +++ b/docs/features/dom0less.pandoc
> @@ -62,19 +62,19 @@ device tree adding a node under /chosen as follows:
>   
>       domU1 {
>           compatible = "xen,domain";
> -        memory = <0x20000>;
> +        memory = <0x0 0x20000>; >           cpus = 1;
>           vpl011;
>   
>           module@2000000 {
>               compatible = "multiboot,kernel", "multiboot,module";
> -            reg = <0x2000000 0xffffff>;
> +            reg = <0x0 0x2000000 0x0 0xffffff>;

... nothing on arm64 impose #address-cells = 2 and #size-cells = 2. The 
problem here is the two properties are missing in the node domU1.

>               bootargs = "console=ttyAMA0";
>           };
>   
>           module@30000000 {
>               compatible = "multiboot,ramdisk", "multiboot,module";
> -            reg = <0x3000000 0xffffff>;
> +            reg = <0x0 0x3000000 0x0 0xffffff>;
>           };
>       };
>   
> @@ -90,12 +90,25 @@ Limitations
>   Domains started by Xen at boot time currently have the following
>   limitations:
>   
> -- They cannot be properly shutdown or rebooted using xl. If one of them
> -  crashes, the whole platform should be rebooted.
> -
>   - Some xl operations might not work as expected. xl is meant to be used
> -  with domains that have been created by it. Using xl with domains
> -  started by Xen at boot might not work as expected.
> +  with domains that have been created by it:
> +
> +    -> Using xl with domains started by Xen at boot might not work
> +       as expected.
> +
> +    -> They cannot be properly shutdown or rebooted using xl.
> +       If one of them crashes, the whole platform should be rebooted.
> +
> +    -> 'xl console' command will not switch console input.

'xl console' does not switch input. The command will attach to the 
domain's console.

But I would not view this as a restriction, they are domains created by 
Xen (similar to Dom0) and therefore they are all managed by Xen and some 
of the commands may not work.

> +       Type 'CTRL-a' three times to switch input in case of dom0less mod

This is confusing to read. You will switch input to the next "domain". 
This could be Xen or one of the domain.

Also, a user is allowed to configure the key sequence to switch input.
So it would be better to write something like: "pressing the Xen
"conswitch" (Ctrl-A by default) three times"

> +
> +    -> 'xl list' prints the list of domains.
> +       However DomU names are shown as '(null)' in the list. For example:

This is not specific to 'xl list'. Domains created by Xen will have no 
name at boot. Domain-0 has a name thanks to the helper xen-init-dom0 
called at boot by the initscript.

If you want to have name here, then you will have to create the xenstore 
node associated.

> +
> +        root@dom0:~# xl list
> +        Name                         ID   Mem VCPUs      State   Time(s)
> +        Domain-0                      0   256     4     r-----       6.2
> +        (null)                        1   256     1     -b----       1.7
>   
>   - The GIC version is the native version. In absence of other
>     information, the GIC version exposed to the domains started by Xen at
> 

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] Improve Dom0-less documentation
Posted by Viktor Mitin 4 years, 9 months ago
On Mon, Jul 8, 2019 at 6:45 PM Julien Grall <julien.grall@arm.com> wrote:
>
> Hello,
Hello Julien,

>
> On 7/8/19 1:35 PM, Viktor Mitin wrote:
> > Updated configuration example according to arm64
> > and added more cases about known xl limitations.
>
> dom0less is not an arm64 specific feature. It also works on arm32, and
> therefore the docs should work for both cases. However...
>
There is one issue with it, please see below.

> >
> > Signed-off-by: Viktor Mitin <viktor_mitin@epam.com>
> > ---
> >   docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
> >   1 file changed, 21 insertions(+), 8 deletions(-)
> >
> > diff --git a/docs/features/dom0less.pandoc b/docs/features/dom0less.pandoc
> > index e076e3739e..961813696f 100644
> > --- a/docs/features/dom0less.pandoc
> > +++ b/docs/features/dom0less.pandoc
> > @@ -62,19 +62,19 @@ device tree adding a node under /chosen as follows:
> >
> >       domU1 {
> >           compatible = "xen,domain";
> > -        memory = <0x20000>;
> > +        memory = <0x0 0x20000>; >           cpus = 1;
> >           vpl011;
> >
> >           module@2000000 {
> >               compatible = "multiboot,kernel", "multiboot,module";
> > -            reg = <0x2000000 0xffffff>;
> > +            reg = <0x0 0x2000000 0x0 0xffffff>;
>
> ... nothing on arm64 impose #address-cells = 2 and #size-cells = 2. The
> problem here is the two properties are missing in the node domU1.

The next issue was observed with arm64 (arm32 was not tested).
The reg properties inside 'module' nodes are ok either with additional '0x0'
or with #address-cells = 2 and #size-cells = 2.

However, the 'memory' property does not work without additional '0x0'
and #address-cells = 2 and #size-cells = 2 don't affect it.
The next code fails without '0x0'. This was the reason why I added '0x0'
and not #address-cells = 2 and #size-cells = 2. Now it is clear that
we need to use
#address-cells and #size-cells anyway, however, I'm not sure about
memory property.
Should it be with extra zero anyway for both cases arm32 and arm64?

memory = <0x0 0x20000>;

    rc = dt_property_read_u64(node, "memory", &mem);
    if ( !rc )
    {
        printk("Error building DomU: cannot read \"memory\" property\n");
        return -EINVAL;
    }


> >               bootargs = "console=ttyAMA0";
> >           };
> >
> >           module@30000000 {
> >               compatible = "multiboot,ramdisk", "multiboot,module";
> > -            reg = <0x3000000 0xffffff>;
> > +            reg = <0x0 0x3000000 0x0 0xffffff>;
> >           };
> >       };
> >
> > @@ -90,12 +90,25 @@ Limitations
> >   Domains started by Xen at boot time currently have the following
> >   limitations:
> >
> > -- They cannot be properly shutdown or rebooted using xl. If one of them
> > -  crashes, the whole platform should be rebooted.
> > -
> >   - Some xl operations might not work as expected. xl is meant to be used
> > -  with domains that have been created by it. Using xl with domains
> > -  started by Xen at boot might not work as expected.
> > +  with domains that have been created by it:
> > +
> > +    -> Using xl with domains started by Xen at boot might not work
> > +       as expected.
> > +
> > +    -> They cannot be properly shutdown or rebooted using xl.
> > +       If one of them crashes, the whole platform should be rebooted.
> > +
> > +    -> 'xl console' command will not switch console input.
>
> 'xl console' does not switch input. The command will attach to the
> domain's console.
>
> But I would not view this as a restriction, they are domains created by
> Xen (similar to Dom0) and therefore they are all managed by Xen and some
> of the commands may not work.
>
> > +       Type 'CTRL-a' three times to switch input in case of dom0less mod
>
> This is confusing to read. You will switch input to the next "domain".
> This could be Xen or one of the domain.
>
> Also, a user is allowed to configure the key sequence to switch input.
> So it would be better to write something like: "pressing the Xen
> "conswitch" (Ctrl-A by default) three times"
>
Ok, I will add new section 'Notes' with this information if no objections.

> > +
> > +    -> 'xl list' prints the list of domains.
> > +       However DomU names are shown as '(null)' in the list. For example:
>
> This is not specific to 'xl list'. Domains created by Xen will have no
> name at boot. Domain-0 has a name thanks to the helper xen-init-dom0
> called at boot by the initscript.
>
> If you want to have name here, then you will have to create the xenstore
> node associated.
>
Will put this information to notes section as well.

> > +
> > +        root@dom0:~# xl list
> > +        Name                         ID   Mem VCPUs      State   Time(s)
> > +        Domain-0                      0   256     4     r-----       6.2
> > +        (null)                        1   256     1     -b----       1.7
> >
> >   - The GIC version is the native version. In absence of other
> >     information, the GIC version exposed to the domains started by Xen at
> >
>
> Cheers,
>
> --
> Julien Grall

Thanks

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] Improve Dom0-less documentation
Posted by Julien Grall 4 years, 9 months ago
Hi,

On 7/9/19 8:23 AM, Viktor Mitin wrote:
> On Mon, Jul 8, 2019 at 6:45 PM Julien Grall <julien.grall@arm.com> wrote:
>>
>> Hello,
> Hello Julien,
> 
>>
>> On 7/8/19 1:35 PM, Viktor Mitin wrote:
>>> Updated configuration example according to arm64
>>> and added more cases about known xl limitations.
>>
>> dom0less is not an arm64 specific feature. It also works on arm32, and
>> therefore the docs should work for both cases. However...
>>
> There is one issue with it, please see below.
> 
>>>
>>> Signed-off-by: Viktor Mitin <viktor_mitin@epam.com>
>>> ---
>>>    docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
>>>    1 file changed, 21 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/docs/features/dom0less.pandoc b/docs/features/dom0less.pandoc
>>> index e076e3739e..961813696f 100644
>>> --- a/docs/features/dom0less.pandoc
>>> +++ b/docs/features/dom0less.pandoc
>>> @@ -62,19 +62,19 @@ device tree adding a node under /chosen as follows:
>>>
>>>        domU1 {
>>>            compatible = "xen,domain";
>>> -        memory = <0x20000>;
>>> +        memory = <0x0 0x20000>; >           cpus = 1;
>>>            vpl011;
>>>
>>>            module@2000000 {
>>>                compatible = "multiboot,kernel", "multiboot,module";
>>> -            reg = <0x2000000 0xffffff>;
>>> +            reg = <0x0 0x2000000 0x0 0xffffff>;
>>
>> ... nothing on arm64 impose #address-cells = 2 and #size-cells = 2. The
>> problem here is the two properties are missing in the node domU1.
> 
> The next issue was observed with arm64 (arm32 was not tested).
> The reg properties inside 'module' nodes are ok either with additional '0x0'
> or with #address-cells = 2 and #size-cells = 2.
> 
> However, the 'memory' property does not work without additional '0x0'
> and #address-cells = 2 and #size-cells = 2 don't affect it.
> The next code fails without '0x0'. This was the reason why I added '0x0'
> and not #address-cells = 2 and #size-cells = 2. Now it is clear that
> we need to use
> #address-cells and #size-cells anyway, however, I'm not sure about
> memory property.
> Should it be with extra zero anyway for both cases arm32 and arm64?
> 
> memory = <0x0 0x20000>;

Per the documentation (docs/misc/arm/device-tree/booting.txt):

"- memory

A 64-bit integer specifying the amount of kilobytes of RAM to
allocate to the guest.
"

So memory is always a 64-bit integer and therefore is described using 2 
cells.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] Improve Dom0-less documentation
Posted by Viktor Mitin 4 years, 9 months ago
Hi,
On Tue, Jul 9, 2019 at 3:15 PM Julien Grall <julien.grall@arm.com> wrote:
>
> Hi,
>
> On 7/9/19 8:23 AM, Viktor Mitin wrote:
> > On Mon, Jul 8, 2019 at 6:45 PM Julien Grall <julien.grall@arm.com> wrote:
> >>
> >> Hello,
> > Hello Julien,
> >
> >>
> >> On 7/8/19 1:35 PM, Viktor Mitin wrote:
> >>> Updated configuration example according to arm64
> >>> and added more cases about known xl limitations.
> >>
> >> dom0less is not an arm64 specific feature. It also works on arm32, and
> >> therefore the docs should work for both cases. However...
> >>
> > There is one issue with it, please see below.
> >
> >>>
> >>> Signed-off-by: Viktor Mitin <viktor_mitin@epam.com>
> >>> ---
> >>>    docs/features/dom0less.pandoc | 29 +++++++++++++++++++++--------
> >>>    1 file changed, 21 insertions(+), 8 deletions(-)
> >>>
> >>> diff --git a/docs/features/dom0less.pandoc b/docs/features/dom0less.pandoc
> >>> index e076e3739e..961813696f 100644
> >>> --- a/docs/features/dom0less.pandoc
> >>> +++ b/docs/features/dom0less.pandoc
> >>> @@ -62,19 +62,19 @@ device tree adding a node under /chosen as follows:
> >>>
> >>>        domU1 {
> >>>            compatible = "xen,domain";
> >>> -        memory = <0x20000>;
> >>> +        memory = <0x0 0x20000>; >           cpus = 1;
> >>>            vpl011;
> >>>
> >>>            module@2000000 {
> >>>                compatible = "multiboot,kernel", "multiboot,module";
> >>> -            reg = <0x2000000 0xffffff>;
> >>> +            reg = <0x0 0x2000000 0x0 0xffffff>;
> >>
> >> ... nothing on arm64 impose #address-cells = 2 and #size-cells = 2. The
> >> problem here is the two properties are missing in the node domU1.
> >
> > The next issue was observed with arm64 (arm32 was not tested).
> > The reg properties inside 'module' nodes are ok either with additional '0x0'
> > or with #address-cells = 2 and #size-cells = 2.
> >
> > However, the 'memory' property does not work without additional '0x0'
> > and #address-cells = 2 and #size-cells = 2 don't affect it.
> > The next code fails without '0x0'. This was the reason why I added '0x0'
> > and not #address-cells = 2 and #size-cells = 2. Now it is clear that
> > we need to use
> > #address-cells and #size-cells anyway, however, I'm not sure about
> > memory property.
> > Should it be with extra zero anyway for both cases arm32 and arm64?
> >
> > memory = <0x0 0x20000>;
>
> Per the documentation (docs/misc/arm/device-tree/booting.txt):
>
> "- memory
>
> A 64-bit integer specifying the amount of kilobytes of RAM to
> allocate to the guest.
> "
>
> So memory is always a 64-bit integer and therefore is described using 2
> cells.

Clear. Will change memory property in example to be with extra 0x0.

Thanks

> Cheers,
>
> --
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel