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

[RFC 10/10] hyperlaunch: integrate dtb parse and domain creation


  • To: Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 17 Dec 2021 18:34:36 -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=1639769539; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=jwECCbUo2nQZxRvb7JqeHbk/5gA0ySBH1Pa0syLScWY=; b=CLXiw5Pjg2JnmotSAxt/N/xJsY6kXNuhQL8lxceZwp3IHFnXEkWx8PSQe5UnWhaolTtXRCnkAj1ch3rmdyEIh9smWojjI6sHWsObViLU28Cbsm4QO0d+di6rcYjQjO/L7uz5sBBlpFmfEGy3F0gVdLEIXfM7DG/ISIrWrxugm9A=
  • Arc-seal: i=1; a=rsa-sha256; t=1639769539; cv=none; d=zohomail.com; s=zohoarc; b=SN9tTyT2zwY2lOr0z0ysHo/VS/72rE5opud8fZhI77td4LQ144T48gZMOuw/PnS2bJuPu0i6LPr6AmLr353q/cnvg5FQJ4dZ7EwtbDjFvYbBmu6h2S77kH2jwes5PTRscxOqmA3g8BXmtTqLqoK8IlZ9y+AbrL2xW7EiFs1/MeA=
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Christopher Clark <christopher.clark@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 17 Dec 2021 19:39:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This commit introduces into x86 start_xen the detection and parsing of a
hyperlaunch DTB file and then using that information to construct the domains
contained in the hyperlaunch configuration.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Christopher Clark <christopher.clark@xxxxxxxxxx>
---
 xen/arch/x86/setup.c | 54 ++++++++++++++++++++++++++++++--------------
 1 file changed, 37 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index bee221d5ee..c007c421b0 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1020,6 +1020,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     bitmap_fill(module_map, mbi->mods_count);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
 
+    if ( hyperlaunch_mb_init(mod) )
+        printk(XENLOG_INFO "Hyperlaunch enabled\n");
+
     if ( pvh_boot )
     {
         /* pvh_init() already filled in e820_raw */
@@ -1142,6 +1145,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
             panic("Bootloader didn't honor module alignment request\n");
         mod[i].mod_end -= mod[i].mod_start;
         mod[i].mod_start >>= PAGE_SHIFT;
+        mod[i].headroom = 0;
         mod[i].reserved = 0;
     }
 
@@ -1158,8 +1162,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
     }
 
-    mod->headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
-    bootstrap_map(NULL);
+    if ( hyperlaunch_enabled ) {
+        hyperlaunch_mb_headroom();
+    } else {
+        mod->headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+        bootstrap_map(NULL);
+    }
 
 #ifndef highmem_start
     /* Don't allow split below 4Gb. */
@@ -1890,22 +1898,34 @@ void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, mbi->mods_count);
-    if ( !hyperlaunch_enabled &&
-         bitmap_weight(module_map, mbi->mods_count) > 1 )
-        printk(XENLOG_WARNING
-               "Multiple initrd candidates, picking module #%u\n",
-               initrdidx);
+    if ( hyperlaunch_enabled )
+    {
+        uint32_t ndoms;
 
-    /*
-     * We're going to setup domain0 using the module(s) that we stashed safely
-     * above our heap. The second module, if present, is an initrd ramdisk.
-     */
-    dom0 = create_dom0(mod, mod->headroom,
-                       initrdidx < mbi->mods_count ? mod + initrdidx : NULL,
-                       kextra, loader);
-    if ( !dom0 )
-        panic("Could not set up DOM0 guest OS\n");
+        printk(XENLOG_INFO "Hyperlaunch starting domain construction...\n");
+        ndoms = hyperlaunch_create_domains(&dom0, kextra, loader);
+        if ( ndoms == 0 )
+            panic("Hyperlaunch could not set up the domains\n");
+
+        printk(XENLOG_INFO "Hyperlaunch created %u domains\n", ndoms);
+    } else {
+        initrdidx = find_first_bit(module_map, mbi->mods_count);
+        if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+            printk(XENLOG_WARNING
+                   "Multiple initrd candidates, picking module #%u\n",
+                   initrdidx);
+
+        /*
+         * We're going to setup domain0 using the module(s) that we stashed
+         * safely above our heap. The second module, if present, is an initrd
+         * ramdisk.
+         */
+        dom0 = create_dom0(mod, mod->headroom,
+                           initrdidx < mbi->mods_count ? mod + initrdidx : 
NULL,
+                           kextra, loader);
+        if ( !dom0 )
+            panic("Could not set up DOM0 guest OS\n");
+    }
 
     heap_init_late();
 
-- 
2.20.1




 


Rackspace

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