Assign domid 0 to the hwdom.  Normally, dom0less does not use domid 0.

This fixes using the Xen console which assumes domid 0 to use the
hypercall interface.

Signed-off-by: Jason Andryuk <jason.andr...@amd.com>
---
 xen/arch/arm/dom0less-build.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index e539bcc762..5a7871939b 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -969,6 +969,7 @@ void __init create_domUs(void)
     dt_for_each_child_node(chosen, node)
     {
         struct domain *d;
+        domid_t domid;
         struct xen_domctl_createdomain d_cfg = {
             .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
             .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
@@ -1121,7 +1122,12 @@ void __init create_domUs(void)
          * very important to use the pre-increment operator to call
          * domain_create() with a domid > 0. (domid == 0 is reserved for Dom0)
          */
-        d = domain_create(++max_init_domid, &d_cfg, flags);
+        if ( flags & CDF_hardware )
+            domid = 0;
+        else
+            domid = ++max_init_domid;
+
+        d = domain_create(domid, &d_cfg, flags);
         if ( IS_ERR(d) )
             panic("Error creating domain %s (rc = %ld)\n",
                   dt_node_name(node), PTR_ERR(d));
-- 
2.48.1


Reply via email to