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

Re: [LINUX PATCH v3] xen: add support for initializing xenstore later as HVM domain


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Fri, 29 Apr 2022 20:38:51 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ecMtXW53/xzCpVSwp4tjdVjzK/KMTTlyprf6mBmeHCk=; b=FYeK0CKYzLwEZTkPS60+jK+1uDIXHlzFuHkWTXRAajHb0/JvXm/lXB/d9uJRZrhb+f06rw/ySjG9sjIMMvJfx8HcUPFDfO0/MgeQEXMGs7EbTzpe0cpSAE5wGlfe/w8rns6UmKpXFCBf+5Zta0y5lcJ37BFXtNvBtl6YbHM7cizqJcJ9Zsj9flKJY9bQLQpC6LZoe2yEvN4ev9zA5rgvYp+20XVX4/BsaDbxL9v1I0C3VOmkREMxEKDWaWccn4TIzLLTnSIZxx8OffT53+pVupJQjOlc+fqlaK6JFw5OOR0G0xloB4uMBi31XukX0S5AQW5U3r0Zc+2DokNY/nRLiw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YSnQMKCrPdgJ54bqZCK47nHr7qx7eXIC0ijD+JWs5LrJ4Kt+Yqv5WEwuQGC0qY7VvVGTnfkmslCYO0kLIo8sXOBl9locPXWexz3qyKEgUWVyMbW3+1XrjHaU63DNZu+EL580is73E5IPFa1A23NpzcrB8IIg0d5sxRPVvN0C1ffNlSPHAnBei28Olpm5x3jJbktrle7kt94Zw1xaHj2MhroQ3VeTnqi0CGOxzY5q96ruTBy0PDt2f5wd3fJphXBWAfnupkiMOvb4kVcxtHeAXCVdlYLmsa0FpXYKiKjkgDQ50IuLt14UjMdvVxraG/J+2ruZnT4SmqM4i/ugiHPU+g==
  • Cc: Luca Miccio <lucmiccio@xxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, jgross@xxxxxxxx
  • Delivery-date: Sat, 30 Apr 2022 00:39:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 4/29/22 5:10 PM, Stefano Stabellini wrote:
From: Luca Miccio <lucmiccio@xxxxxxxxx>

When running as dom0less guest (HVM domain on ARM) the xenstore event
channel is available at domain creation but the shared xenstore
interface page only becomes available later on.

In that case, wait for a notification on the xenstore event channel,
then complete the xenstore initialization later, when the shared page
is actually available.

The xenstore page has few extra field. Add them to the shared struct.
One of the field is "connection", when the connection is ready, it is
zero. If the connection is not-zero, wait for a notification.

Signed-off-by: Luca Miccio <lucmiccio@xxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
CC: jgross@xxxxxxxx
CC: boris.ostrovsky@xxxxxxxxxx
---
Changes in v3:
- check for the connection field, if it is not zero, wait for event

Changes in v2:
- remove XENFEAT_xenstore_late_init
---
  drivers/xen/xenbus/xenbus_probe.c  | 86 +++++++++++++++++++++++-------
  include/xen/interface/io/xs_wire.h |  3 ++
  2 files changed, 70 insertions(+), 19 deletions(-)

diff --git a/drivers/xen/xenbus/xenbus_probe.c 
b/drivers/xen/xenbus/xenbus_probe.c
index fe360c33ce71..dc046d25789e 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -65,6 +65,7 @@
  #include "xenbus.h"
+static int xs_init_irq;
  int xen_store_evtchn;
  EXPORT_SYMBOL_GPL(xen_store_evtchn);
@@ -750,6 +751,17 @@ static void xenbus_probe(void)
  {
        xenstored_ready = 1;
+ if (!xen_store_interface) {
+               xen_store_interface = xen_remap(xen_store_gfn << XEN_PAGE_SHIFT,
+                                               XEN_PAGE_SIZE);
+               /*
+                * Now it is safe to free the IRQ used for xenstore late
+                * initialization. No need to unbind: it is about to be
+                * bound again.


This assumes knowledge of bind/unbind internals. I think we should unbind.


+                */
+               free_irq(xs_init_irq, &xb_waitq);
+       }
+



@@ -959,23 +988,42 @@ static int __init xenbus_init(void)
                 *
                 * Also recognize all bits set as an invalid value.


Is this comment still correct?


                 */
-               if (!v || !~v) {
+               if (!v) {
                        err = -ENOENT;
                        goto out_error;
                }
-               /* Avoid truncation on 32-bit. */
+               if (v == ~0ULL) {
+                       wait = true;
+               } else {
+                       /* Avoid truncation on 32-bit. */




 


Rackspace

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