diff mbox series

[RFC,01/10] introduce hyperlaunch kconfig and core

Message ID 20211217233437.13791-2-dpsmith@apertussolutions.com (mailing list archive)
State New, archived
Headers show
Series Hyperlaunch x86 Dom0 launch | expand

Commit Message

Daniel P. Smith Dec. 17, 2021, 11:34 p.m. UTC
From: Christopher Clark <christopher.w.clark@gmail.com>

Add a CONFIG_HYPERLAUNCH to allow enabling/disabling the hyperlaunch code
paths. Introduce an initial use of the hyperlaunch_enabled variable to suppress
the warning about multiple initrd candidates when multiboot modules are
detected when the hyperlaunch boolean is true.

Added to common code since this option will apply to all architectures.

Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c    |  4 +++-
 xen/common/Kconfig      | 10 ++++++++++
 xen/common/Makefile     |  1 +
 xen/common/setup.c      |  8 ++++++++
 xen/include/xen/setup.h | 14 ++++++++++++++
 5 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 xen/common/setup.c
 create mode 100644 xen/include/xen/setup.h
diff mbox series

Patch

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f40a9fe5d3..190d7aefb5 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -26,6 +26,7 @@ 
 #include <xen/nodemask.h>
 #include <xen/virtual_region.h>
 #include <xen/watchdog.h>
+#include <xen/setup.h>
 #include <public/version.h>
 #ifdef CONFIG_COMPAT
 #include <compat/platform.h>
@@ -1891,7 +1892,8 @@  void __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? "" : "not ");
 
     initrdidx = find_first_bit(module_map, mbi->mods_count);
-    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+    if ( !hyperlaunch_enabled &&
+         bitmap_weight(module_map, mbi->mods_count) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index db687b1785..5e6aad644e 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -331,6 +331,16 @@  config ARGO
 
 	  If unsure, say N.
 
+config HYPERLAUNCH
+	bool "Hyperlaunch support (UNSUPPORTED)" if UNSUPPORTED
+	---help---
+	  Enables launch of multiple VMs at host boot as an alternative
+	  method of starting a Xen system.
+
+	  This feature is currently experimental.
+
+	  If unsure, say N.
+
 source "common/sched/Kconfig"
 
 config CRYPTO
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 141d7d40d3..a6337e065a 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -35,6 +35,7 @@  obj-y += rangeset.o
 obj-y += radix-tree.o
 obj-y += rcupdate.o
 obj-y += rwlock.o
+obj-y += setup.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += smp.o
diff --git a/xen/common/setup.c b/xen/common/setup.c
new file mode 100644
index 0000000000..e18ea14fe0
--- /dev/null
+++ b/xen/common/setup.c
@@ -0,0 +1,8 @@ 
+#include <xen/types.h>
+#include <xen/init.h>
+
+#ifdef CONFIG_HYPERLAUNCH
+
+bool __initdata hyperlaunch_enabled;
+
+#endif
diff --git a/xen/include/xen/setup.h b/xen/include/xen/setup.h
new file mode 100644
index 0000000000..6fbe87860e
--- /dev/null
+++ b/xen/include/xen/setup.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef XEN_SETUP_H
+#define XEN_SETUP_H
+
+#include <asm/setup.h>
+
+#ifdef CONFIG_HYPERLAUNCH
+extern bool hyperlaunch_enabled;
+#else
+#define hyperlaunch_enabled false
+#endif
+
+#endif /* XEN_SETUP_H */