|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [mini-os master] setup: add global pointer for struct hvm_start_info
commit 11a242f7680c353243ca5773bd001b7f092e2cc5
Author: Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Jul 9 16:41:34 2025 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 9 16:41:34 2025 +0200
setup: add global pointer for struct hvm_start_info
Similar to start_info_ptr for PV provide hvm_start_info_ptr for PVH.
Add a generic function to set the pointer.
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
arch/x86/setup.c | 20 +++++++++++++++++---
include/hypervisor.h | 3 +++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/arch/x86/setup.c b/arch/x86/setup.c
index ed28d94..2085ee5 100644
--- a/arch/x86/setup.c
+++ b/arch/x86/setup.c
@@ -69,6 +69,11 @@ static inline void sse_init(void) {
start_info_t *start_info_ptr;
EXPORT_SYMBOL(start_info_ptr);
+static void set_info_ptr(start_info_t *ptr)
+{
+ start_info_ptr = ptr;
+}
+
#define hpc_init()
shared_info_t *map_shared_info(void)
@@ -123,6 +128,17 @@ static void print_start_of_day(void *p)
printk(" stack: %p-%p\n", stack, stack + sizeof(stack));
}
#else
+
+/*
+ * This pointer holds a reference to the hvm_start_info struct.
+ */
+struct hvm_start_info *hvm_start_info_ptr;
+
+static void set_info_ptr(struct hvm_start_info *ptr)
+{
+ hvm_start_info_ptr = ptr;
+}
+
static void hpc_init(void)
{
uint32_t eax, ebx, ecx, edx, base;
@@ -176,9 +192,7 @@ arch_init(void *par)
{
static char hello[] = "Bootstrapping...\n";
-#ifdef CONFIG_PARAVIRT
- start_info_ptr = par;
-#endif
+ set_info_ptr(par);
hpc_init();
(void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(hello), hello);
diff --git a/include/hypervisor.h b/include/hypervisor.h
index d199f03..93f1247 100644
--- a/include/hypervisor.h
+++ b/include/hypervisor.h
@@ -33,6 +33,9 @@ extern start_info_t *start_info_ptr;
#define start_info (*start_info_ptr)
#else
+#include <xen/arch-x86/hvm/start_info.h>
+
+extern struct hvm_start_info *hvm_start_info_ptr;
int hvm_get_parameter(int idx, uint64_t *value);
int hvm_set_parameter(int idx, uint64_t value);
#endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |