From: Jason Andryuk <jason.andryuk@amd.com>
To: Jan Beulich <jbeulich@suse.com>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: christopher.w.clark@gmail.com, stefano.stabellini@amd.com,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>
Subject: Re: [PATCH v2 15/15] x86/hyperlaunch: add capabilities to boot domain
Date: Tue, 4 Feb 2025 10:40:33 -0500 [thread overview]
Message-ID: <95e997d0-2b5c-411a-adac-246bfd1780de@amd.com> (raw)
In-Reply-To: <108bc55e-cde6-4a2e-ada2-571c4d72bfa5@suse.com>
On 2025-02-04 06:13, Jan Beulich wrote:
> On 26.12.2024 17:57, Daniel P. Smith wrote:
>> Introduce the ability to assign capabilities to a domain via its definition in
>> device tree. The first capability enabled to select is the control domain
>> capability.
>
> Hmm, and not at the same time another one to select "hardware domain"?
Dan has an un-submitted patch that adds in hardware domain. Related, I
was preparing a dom0less patch that adds control, hardware, and xenstore
capabilities.
I've included it below. To keep them aligned, it creates a new common
public header with defines for the capabilities.
Regards,
Jason
commit 5d329e6ef7128a4999b28de6745810c595a7f9e8
Author: Jason Andryuk <jason.andryuk@amd.com>
Date: Fri Jan 31 14:50:53 2025 -0500
xen/arm: Add capabilities to dom0less
Add capabilities property to dom0less to allow building a
disaggregated system.
Introduce bootfdt.h to contain these constants.
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
There is overlap with hyperlaunch. The numeric values are the same.
Hyperlaunch doesn't expose the values in a public header as done here.
Is this to be expected for dom0less? It seems most of dom0less
isn't in
a header, but just in docs.
Hyperlaunch uses BUILD_CAPS_, but I chose DOMAIN_CAPS_ since there are
domain-level capabilities.
diff --git a/docs/misc/arm/device-tree/booting.txt
b/docs/misc/arm/device-tree/booting.txt
index 4346953a71..2cd99f9b79 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -167,6 +167,17 @@ with the following properties:
Refer to docs/misc/cache_coloring.rst for syntax. This option is
applicable
only to Arm64 guests.
+- capabilities
+ Optional. A bit field of domain capabilities for a disaggregated
+ system. A traditional dom0 has all all of these capabilities, and a
+ domU has none of them.
+
+ 0x1 DOMAIN_CAPS_CONTROL - A privileged, control domain
+ 0x2 DOMAIN_CAPS_HARDWARE - The hardware domain - there can be only 1
+ 0x4 DOMAIN_CAPS_XENSTORE - The xenstore domain - there can be only 1
+
+ The default is no capabilities.
+
- vpl011
An empty property to enable/disable a virtual pl011 for the guest to
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 9f24463ebd..bb49142d24 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -12,6 +12,7 @@
#include <xen/sizes.h>
#include <xen/vmap.h>
+#include <public/bootfdt.h>
#include <public/io/xs_wire.h>
#include <asm/arm64/sve.h>
@@ -1236,6 +1237,18 @@ void __init create_domUs(void)
d_cfg.max_maptrack_frames = val;
}
+ if ( dt_property_read_u32(node, "capabilities", &val) )
+ {
+ if ( val & ~DOMAIN_CAPS_MASK )
+ panic("invalid capabilities (%"PRIu32") overflow\n", val);
+ if ( val & DOMAIN_CAPS_CONTROL )
+ flags |= CDF_privileged;
+ if ( val & DOMAIN_CAPS_HARDWARE )
+ flags |= CDF_hardware;
+ if ( val & DOMAIN_CAPS_XENSTORE )
+ d_cfg.flags |= XEN_DOMCTL_CDF_xs_domain;
+ }
+
if ( dt_get_property(node, "sve", &val) )
{
#ifdef CONFIG_ARM64_SVE
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c170597410..dbeda908be 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -701,6 +701,10 @@ struct domain *domain_create(domid_t domid,
/* Sort out our idea of is_hardware_domain(). */
if ( flags & CDF_hardware || domid == hardware_domid )
{
+ if ( hardware_domain )
+ panic("Can't set %pd - %pd is already hardware domain\n", d,
+ hardware_domain);
+
if ( hardware_domid < 0 || hardware_domid >=
DOMID_FIRST_RESERVED )
panic("The value of hardware_dom must be a valid domain
ID\n");
diff --git a/xen/include/public/bootfdt.h b/xen/include/public/bootfdt.h
new file mode 100644
index 0000000000..4e87aca8ac
--- /dev/null
+++ b/xen/include/public/bootfdt.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Xen Device Tree boot information
+ *
+ * Information for configuring Xen domains created at boot time.
+ */
+
+#ifndef __XEN_PUBLIC_BOOTFDT_H__
+#define __XEN_PUBLIC_BOOTFDT_H__
+
+/* Domain Capabilities specified in the "capabilities" property. Use of
+ * this property allows splitting up the monolithic dom0 into separate,
+ * less privileged components. A regular domU has no capabilities
+ * (which is the default if nothing is specified). A traditional dom0
+ * has all three capabilities.*/
+
+/* Control/Privileged domain capable of affecting other domains. */
+#define DOMAIN_CAPS_CONTROL (1 << 0)
+/* Hardware domain controlling physical hardware. Typically providing
+ * backends to other domains. */
+#define DOMAIN_CAPS_HARDWARE (1 << 1)
+/* Xenstore domain. */
+#define DOMAIN_CAPS_XENSTORE (1 << 2)
+#define DOMAIN_CAPS_MASK (DOMAIN_CAPS_CONTROL |
DOMAIN_CAPS_HARDWARE | \
+ DOMAIN_CAPS_XENSTORE)
+
+#endif /* __XEN_PUBLIC_BOOTFDT_H__ */
prev parent reply other threads:[~2025-02-04 15:40 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 16:57 [PATCH v2 00/15] Hyperlaunch device tree for dom0 Daniel P. Smith
2024-12-26 16:57 ` [PATCH v2 01/15] x86/boot: introduce boot domain Daniel P. Smith
2025-01-30 13:45 ` Jan Beulich
2025-04-05 0:04 ` Daniel P. Smith
2025-04-07 7:10 ` Jan Beulich
2025-04-09 23:55 ` Daniel P. Smith
2025-04-10 6:37 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 02/15] x86/boot: introduce domid field to struct boot_domain Daniel P. Smith
2025-01-30 13:51 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 03/15] x86/boot: add cmdline " Daniel P. Smith
2025-01-10 19:52 ` Jason Andryuk
2025-01-15 17:22 ` Daniel P. Smith
2025-01-15 19:50 ` Jason Andryuk
2025-01-30 14:15 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 04/15] kconfig: introduce option to independently enable libfdt Daniel P. Smith
2025-01-30 14:19 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 05/15] kconfig: introduce domain builder config option Daniel P. Smith
2025-01-10 19:55 ` Jason Andryuk
2025-01-15 17:24 ` Daniel P. Smith
2025-01-30 14:30 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 06/15] x86/hyperlaunch: introduce the domain builder Daniel P. Smith
2025-01-08 21:54 ` Jason Andryuk
2025-01-15 17:25 ` Daniel P. Smith
2025-01-30 14:52 ` Jan Beulich
2025-04-01 18:01 ` Jason Andryuk
2025-04-02 9:25 ` Jan Beulich
2025-04-02 19:44 ` Jason Andryuk
2024-12-26 16:57 ` [PATCH v2 07/15] x86/hyperlaunch: initial support for hyperlaunch device tree Daniel P. Smith
2025-01-10 22:20 ` Jason Andryuk
2025-01-15 17:47 ` Daniel P. Smith
2025-01-30 15:01 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 08/15] x86/hyperlaunch: locate dom0 kernel with hyperlaunch Daniel P. Smith
2025-01-10 23:06 ` Jason Andryuk
2025-01-30 15:42 ` Jan Beulich
2025-01-30 21:14 ` Stefano Stabellini
2025-01-31 6:36 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 09/15] x86/hyperlaunch: obtain cmdline from device tree Daniel P. Smith
2025-01-15 16:38 ` Jason Andryuk
2025-01-30 15:58 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 10/15] x86/hyperlaunch: locate dom0 initrd with hyperlaunch Daniel P. Smith
2025-01-15 16:43 ` Jason Andryuk
2025-01-30 16:39 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 11/15] x86/hyperlaunch: add domain id parsing to domain config Daniel P. Smith
2025-01-30 16:49 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 12/15] x86/hyperlaunch: specify dom0 mode with device tree Daniel P. Smith
2025-01-15 19:42 ` Jason Andryuk
2025-01-30 16:55 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 13/15] x86/hyperlaunch: add memory parsing to domain config Daniel P. Smith
2025-01-15 16:55 ` Jason Andryuk
2025-01-30 17:01 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 14/15] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree Daniel P. Smith
2025-01-15 19:40 ` Jason Andryuk
2025-01-30 17:04 ` Jan Beulich
2024-12-26 16:57 ` [PATCH v2 15/15] x86/hyperlaunch: add capabilities to boot domain Daniel P. Smith
2025-02-04 11:13 ` Jan Beulich
2025-02-04 15:40 ` Jason Andryuk [this message]
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=95e997d0-2b5c-411a-adac-246bfd1780de@amd.com \
--to=jason.andryuk@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=christopher.w.clark@gmail.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@amd.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.