[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/5] xen/arm: configure dom0less domain for enabling xenstore after boot



Hi Stefano,

On 23/03/2022 01:18, Stefano Stabellini wrote:
On Sat, 29 Jan 2022, Julien Grall wrote:
On 28/01/2022 21:33, Stefano Stabellini wrote:
+    rc = evtchn_alloc_unbound(&alloc, true);
+    if ( rc )
+    {
+        printk("Failed allocating event channel for domain\n");
+        return rc;
+    }
+
+    d->arch.hvm.params[HVM_PARAM_STORE_EVTCHN] = alloc.port;
+
+    return 0;
+}
+
   static int __init construct_domU(struct domain *d,
                                    const struct dt_device_node *node)
   {
@@ -3014,7 +3043,19 @@ static int __init construct_domU(struct domain *d,
           return rc;
         if ( kinfo.vpl011 )
+    {
           rc = domain_vpl011_init(d, NULL);
+        if ( rc < 0 )
+            return rc;
+    }
+
+    if ( kinfo.dom0less_enhanced )
+    {
+        rc = alloc_xenstore_evtchn(d);
+        if ( rc < 0 )
+            return rc;
+        d->arch.hvm.params[HVM_PARAM_STORE_PFN] = ~0ULL;

I think it would be easy to allocate the page right now. So what prevent us to
do it right now?

Because (as you noted as a comment to the following patch) as soon as
d->arch.hvm.params[HVM_PARAM_STORE_PFN] is set the guest can continue
with the initialization and will expect the right data to be set on the
page.

I think you misunderstood my question. From my understanding, at the moment, Linux would break with your proposal. So you need to modify the kernel in order to support what you are doing.

IOW, we have room to decide the approach here.

Xenstore protocol has a way to allow (re)connection (see docs/mics/xenstore-ring.txt). This feature looks quite suited to what you are trying to do here (we want to delay the connection).

The main advantage with this approach is the resources allocation for Xenstore will be done in the place and the work in Linux could be re-used for non-dom0less domain.

Have you explored it?

In other words: it is not enough to have the pfn allocated, we
also need xenstore to initialize it. At that point, it is better to do
both later from init-dom0less.c.
See above. My main concern with your proposal is the allocation is split and this making more difficult to understand the initialization. Could you write some documentation how everything is meant to work?

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.