From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, julien@xen.org, Bertrand.Marquis@arm.com,
Luca Miccio <lucmiccio@gmail.com>,
Stefano Stabellini <stefano.stabellini@xilinx.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [XEN PATCH 5/7] xen/arm: configure dom0less domain for enabling xenstore after boot
Date: Fri, 7 Jan 2022 16:49:10 -0800 [thread overview]
Message-ID: <20220108004912.3820176-5-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2201071614090.2060010@ubuntu-linux-20-04-desktop>
From: Luca Miccio <lucmiccio@gmail.com>
If "xen,enhanced" is enabled, then add to dom0less domains:
- the hypervisor node in device tree
- the xenstore event channel
The xenstore event channel is also used for the first notification to
let the guest know that xenstore has become available.
Signed-off-by: Luca Miccio <lucmiccio@gmail.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
---
xen/arch/arm/domain_build.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 96a94fa434..fafa921aa8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -27,6 +27,7 @@
#include <asm/setup.h>
#include <asm/cpufeature.h>
#include <asm/domain_build.h>
+#include <xen/event.h>
#include <xen/irq.h>
#include <xen/grant_table.h>
@@ -2619,6 +2620,8 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
int ret;
kinfo->phandle_gic = GUEST_PHANDLE_GIC;
+ kinfo->gnttab_start = GUEST_GNTTAB_BASE;
+ kinfo->gnttab_size = GUEST_GNTTAB_SIZE;
addrcells = GUEST_ROOT_ADDRESS_CELLS;
sizecells = GUEST_ROOT_SIZE_CELLS;
@@ -2693,6 +2696,13 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
goto err;
}
+ if ( kinfo->enhanced )
+ {
+ ret = make_hypervisor_node(d, kinfo, addrcells, sizecells);
+ if ( ret )
+ goto err;
+ }
+
ret = fdt_end_node(kinfo->fdt);
if ( ret < 0 )
goto err;
@@ -2959,6 +2969,22 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
return 0;
}
+static int alloc_xenstore_evtchn(struct domain *d)
+{
+ struct evtchn *chn;
+
+ chn = _evtchn_alloc_unbound(d, hardware_domain->domain_id);
+ if ( !chn )
+ {
+ printk("Failed allocating event channel for domain\n");
+ return -ENOMEM;
+ }
+
+ d->arch.hvm.params[HVM_PARAM_STORE_EVTCHN] = chn->port;
+
+ return 0;
+}
+
static int __init construct_domU(struct domain *d,
const struct dt_device_node *node)
{
@@ -3012,7 +3038,14 @@ 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.enhanced )
+ rc = alloc_xenstore_evtchn(d);
return rc;
}
@@ -3068,6 +3101,7 @@ void __init create_domUs(void)
panic("Error creating domain %s\n", dt_node_name(node));
d->is_console = true;
+ d->arch.is_dom0less = true;
if ( construct_domU(d, node) != 0 )
panic("Could not set up domain %s\n", dt_node_name(node));
--
2.25.1
next prev parent reply other threads:[~2022-01-08 0:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 0:49 [XEN PATCH 0/7] dom0less PV drivers Stefano Stabellini
2022-01-08 0:49 ` [XEN PATCH 1/7] xen: introduce XENFEAT_xenstore_late_init Stefano Stabellini
2022-01-08 3:41 ` Julien Grall
2022-01-10 22:55 ` Stefano Stabellini
2022-01-11 11:01 ` David Vrabel
2022-01-11 22:52 ` Stefano Stabellini
2022-01-10 9:46 ` Jan Beulich
2022-01-10 23:08 ` Stefano Stabellini
2022-01-11 7:14 ` Jan Beulich
2022-01-11 22:51 ` Stefano Stabellini
2022-01-08 0:49 ` [XEN PATCH 2/7] xen: introduce _evtchn_alloc_unbound Stefano Stabellini
2022-01-10 10:25 ` Jan Beulich
2022-01-11 22:49 ` Stefano Stabellini
2022-01-12 7:42 ` Jan Beulich
2022-01-13 0:45 ` Stefano Stabellini
2022-01-08 0:49 ` [XEN PATCH 3/7] tools: add a late_init argument to xs_introduce_domain Stefano Stabellini
2022-01-08 2:35 ` Marek Marczykowski-Górecki
2022-01-13 0:49 ` Stefano Stabellini
2022-01-08 3:46 ` Julien Grall
2022-01-08 0:49 ` [XEN PATCH 4/7] xen: introduce xen,enhanced dom0less property Stefano Stabellini
2022-01-11 3:31 ` Volodymyr Babchuk
2022-01-11 23:03 ` Stefano Stabellini
2022-01-08 0:49 ` Stefano Stabellini [this message]
2022-01-08 0:49 ` [XEN PATCH 6/7] xenstored: do_introduce: handle the late_init case Stefano Stabellini
2022-01-08 2:39 ` Marek Marczykowski-Górecki
2022-01-13 0:51 ` Stefano Stabellini
2022-01-08 3:54 ` Julien Grall
2022-01-10 22:48 ` Stefano Stabellini
2022-01-08 0:49 ` [XEN PATCH 7/7] tools: add example application to initialize dom0less PV drivers Stefano Stabellini
2022-01-08 4:02 ` Julien Grall
2022-01-10 22:57 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220108004912.3820176-5-sstabellini@kernel.org \
--to=sstabellini@kernel.org \
--cc=Bertrand.Marquis@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=julien@xen.org \
--cc=lucmiccio@gmail.com \
--cc=stefano.stabellini@xilinx.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.