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

[RFC 06/10] hyperlaunch: add structures to hold parsed dtb


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 17 Dec 2021 18:34:32 -0500
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639769534; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=em6dzW9XaL2Yw7Hp9YltudsddXj7DesXGxfaC/g+vO8=; b=IzrMpgK7REYjo70CQH9CLdKSaYFKtU9j2yk97O8eKiBr72j3Nu+oFleaHiKLYJtmky8yHYyPMISHgqEVDr3ddNxLKFNsNGmqnCoVwdWXdNQ0jw9uaC4lrBobLrW5HUSfQG//vI5isga6JMyfTH33szAxN7yQ/5ZYLO223AKNJyY=
  • Arc-seal: i=1; a=rsa-sha256; t=1639769534; cv=none; d=zohomail.com; s=zohoarc; b=WRGpN1segHzywaEb9+PBaysX05z/rI3teEUy1Kv24Ijdp2khAt0UzmaJiy+mD70gE2HqZs2I/sqmCFfKG+iQ0CSgOqHdYpjDVWQNlNzwYRXwpxA4qQ4ALLdls31u3BLPd/SS1eithyjL/G5nTpOGGeMkDoMZ1qM678nY8KTDdDA=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Christopher Clark <christopher.clark@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 17 Dec 2021 19:33:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hyperlaunch builds from dom0less' `struct bootmodule` as the representation of
a boot module provided by a bootloader. From there it expands to cover the
representations proposed in the hyperlaunch design documentation.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Christopher Clark <christopher.clark@xxxxxxxxxx>
---
 xen/include/xen/setup.h | 81 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/xen/include/xen/setup.h b/xen/include/xen/setup.h
index 6fbe87860e..69ea042716 100644
--- a/xen/include/xen/setup.h
+++ b/xen/include/xen/setup.h
@@ -5,6 +5,87 @@
 
 #include <asm/setup.h>
 
+/* Reusing Dom0less definitions */
+typedef enum {
+    BOOTMOD_XEN,
+    BOOTMOD_FDT,
+    BOOTMOD_KERNEL,
+    BOOTMOD_RAMDISK,
+    BOOTMOD_MICROCODE,
+    BOOTMOD_XSM,
+    BOOTMOD_GUEST_DTB,
+    BOOTMOD_GUEST_CONF,
+    BOOTMOD_UNKNOWN
+}  bootmodule_kind;
+
+struct bootmodule {
+    bootmodule_kind kind;
+    bool domU;
+    paddr_t start;
+    paddr_t size;
+};
+
+/* End reuse */
+
+struct memrange {
+    paddr_t start;
+    paddr_t size;
+};
+
+/* Currently only two config modules supported, microcode and xsm policy */
+#define HL_MAX_CONFIG_MODULES 2
+struct bootconfig {
+    uint16_t nr_mods;
+    struct bootmodule mods[HL_MAX_CONFIG_MODULES];
+};
+
+struct bootdomain {
+#define HL_PERMISSION_NONE          (0)
+#define HL_PERMISSION_CONTROL       (1 << 0)
+#define HL_PERMISSION_HARDWARE      (1 << 1)
+    uint32_t permissions;
+
+#define HL_FUNCTION_NONE            (0)
+#define HL_FUNCTION_BOOT            (1 << 0)
+#define HL_FUNCTION_CRASH           (1 << 1)
+#define HL_FUNCTION_CONSOLE         (1 << 2)
+#define HL_FUNCTION_XENSTORE        (1 << 30)
+#define HL_FUNCTION_LEGACY_DOM0     (1 << 31)
+    uint32_t functions;
+
+#define HL_MODE_PARAVIRTUALIZED     (1 << 0) /* PV | PVH/HVM */
+#define HL_MODE_ENABLE_DEVICE_MODEL (1 << 1) /* HVM | PVH */
+#define HL_MODE_LONG                (1 << 2) /* 64 BIT | 32 BIT */
+    uint32_t mode;
+
+    domid_t domid;
+    uint8_t uuid[16];
+
+    uint32_t ncpus;
+    bool maxmem_set;
+    struct memrange memrange[2]; /* 0: min; 1: max */
+
+#define HL_MAX_SECID_LEN 64
+    unsigned char secid[HL_MAX_SECID_LEN];
+
+#define HL_MAX_DOMAIN_MODULES 3
+    uint16_t nr_mods;
+    struct bootmodule modules[HL_MAX_DOMAIN_MODULES];
+#define HL_MAX_CMDLINE_LEN 1024
+    unsigned char cmdline[HL_MAX_CMDLINE_LEN];
+};
+
+struct hyperlaunch_config {
+    const void *fdt;
+#ifdef CONFIG_MULTIBOOT
+    module_t *mods;
+#endif
+    struct bootconfig config;
+#define HL_MAX_BOOT_DOMAINS 64
+    uint16_t nr_doms;
+    struct bootdomain domains[HL_MAX_BOOT_DOMAINS];
+};
+
 #ifdef CONFIG_HYPERLAUNCH
 extern bool hyperlaunch_enabled;
 #else
-- 
2.20.1




 


Rackspace

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