From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, jgross@suse.com,
Bertrand.Marquis@arm.com, julien@xen.org,
Volodymyr_Babchuk@epam.com, Luca Miccio <lucmiccio@gmail.com>,
Stefano Stabellini <stefano.stabellini@xilinx.com>,
Bertrand Marquis <bertrand.marquis@arm.com>
Subject: [PATCH v4 6/9] xen/arm: configure dom0less domain for enabling xenstore after boot
Date: Thu, 31 Mar 2022 17:38:44 -0700 [thread overview]
Message-ID: <20220401003847.38393-6-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2203311735380.2910984@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>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
---
Changes in v3:
- use evtchn_alloc_unbound
Changes in v2:
- set HVM_PARAM_STORE_PFN to ~0ULL at domain creation
- in alloc_xenstore_evtchn do not call _evtchn_alloc_unbound
---
xen/arch/arm/domain_build.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index b22fe95d92..a8ad95ce40 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -28,6 +28,7 @@
#include <asm/cpufeature.h>
#include <asm/domain_build.h>
#include <xsm/xsm.h>
+#include <xen/event.h>
#include <xen/irq.h>
#include <xen/grant_table.h>
@@ -2806,6 +2807,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;
@@ -2880,6 +2883,13 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
goto err;
}
+ if ( kinfo->dom0less_enhanced )
+ {
+ ret = make_hypervisor_node(d, kinfo, addrcells, sizecells);
+ if ( ret )
+ goto err;
+ }
+
ret = fdt_end_node(kinfo->fdt);
if ( ret < 0 )
goto err;
@@ -3146,6 +3156,25 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
return 0;
}
+static int __init alloc_xenstore_evtchn(struct domain *d)
+{
+ evtchn_alloc_unbound_t alloc;
+ int rc;
+
+ alloc.dom = d->domain_id;
+ alloc.remote_dom = hardware_domain->domain_id;
+ rc = evtchn_alloc_unbound(&alloc);
+ 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)
{
@@ -3210,6 +3239,14 @@ static int __init construct_domU(struct domain *d,
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;
+ }
+
return rc;
}
--
2.25.1
next prev parent reply other threads:[~2022-04-01 0:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 0:38 [PATCH v4 0/9] dom0less PV drivers Stefano Stabellini
2022-04-01 0:38 ` [PATCH v4 1/9] xen/dt: dt_property_read_string should return -ENODATA on !length Stefano Stabellini
2022-04-01 8:05 ` Henry Wang
2022-04-01 0:38 ` [PATCH v4 2/9] xen/arm: implement domU extended regions Stefano Stabellini
2022-04-01 13:52 ` Luca Fancellu
2022-04-01 14:34 ` Julien Grall
2022-04-01 0:38 ` [PATCH v4 3/9] xen/arm: temporarily elevate idle_domain privileged during create_domUs Stefano Stabellini
2022-04-01 17:36 ` Julien Grall
2022-04-01 0:38 ` [PATCH v4 4/9] xen: export evtchn_alloc_unbound Stefano Stabellini
2022-04-05 9:50 ` Jan Beulich
2022-04-01 0:38 ` [PATCH v4 5/9] xen: introduce xen,enhanced dom0less property Stefano Stabellini
2022-04-01 0:38 ` Stefano Stabellini [this message]
2022-04-01 0:38 ` [PATCH v4 7/9] xenstored: send an evtchn notification on introduce_domain Stefano Stabellini
2022-04-01 12:48 ` Juergen Gross
2022-04-01 0:38 ` [PATCH v4 8/9] tools: add example application to initialize dom0less PV drivers Stefano Stabellini
2022-04-01 10:21 ` Julien Grall
2022-04-01 10:46 ` Juergen Gross
2022-04-01 13:35 ` Julien Grall
2022-04-01 13:52 ` Juergen Gross
2022-04-01 14:04 ` Julien Grall
2022-04-01 14:11 ` Juergen Gross
2022-04-06 2:21 ` Stefano Stabellini
2022-04-06 8:58 ` Julien Grall
2022-04-13 1:22 ` Stefano Stabellini
2022-04-01 0:38 ` [PATCH v4 9/9] docs: document dom0less + " Stefano Stabellini
2022-04-01 10:48 ` Luca Fancellu
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=20220401003847.38393-6-sstabellini@kernel.org \
--to=sstabellini@kernel.org \
--cc=Bertrand.Marquis@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=jgross@suse.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.