xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	samuel.thibault@ens-lyon.org, wei.liu2@citrix.com
Subject: [PATCH 1/2] mini-os: support keeping start_info structure conditionally
Date: Mon, 29 Aug 2016 13:01:08 +0200	[thread overview]
Message-ID: <1472468469-11560-2-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1472468469-11560-1-git-send-email-jgross@suse.com>

grub stubdom needs the start_info structure. Keep a copy of it in
pv mini-os if configured via "CONFIG_KEEP_STARTINFO". This should
default to "n" in order to have it enabled only when really needed.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Config.mk            |  2 ++
 arch/x86/setup.c     | 12 ++++++++++++
 include/hypervisor.h | 13 +++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/Config.mk b/Config.mk
index aa36761..ae18ffd 100644
--- a/Config.mk
+++ b/Config.mk
@@ -175,6 +175,7 @@ CONFIG_XENBUS ?= y
 CONFIG_XC ?=y
 CONFIG_LWIP ?= $(lwip)
 CONFIG_BALLOON ?= n
+CONFIG_KEEP_STARTINFO ?= n
 
 # Export config items as compiler directives
 DEFINES-$(CONFIG_PARAVIRT) += -DCONFIG_PARAVIRT
@@ -192,6 +193,7 @@ DEFINES-$(CONFIG_FBFRONT) += -DCONFIG_FBFRONT
 DEFINES-$(CONFIG_CONSFRONT) += -DCONFIG_CONSFRONT
 DEFINES-$(CONFIG_XENBUS) += -DCONFIG_XENBUS
 DEFINES-$(CONFIG_BALLOON) += -DCONFIG_BALLOON
+DEFINES-$(CONFIG_KEEP_STARTINFO) += -DCONFIG_KEEP_STARTINFO
 
 # Override settings for this OS
 PTHREAD_LIBS =
diff --git a/arch/x86/setup.c b/arch/x86/setup.c
index 86955cf..1761b81 100644
--- a/arch/x86/setup.c
+++ b/arch/x86/setup.c
@@ -33,6 +33,14 @@
 #include <xen/arch-x86/cpuid.h>
 #include <xen/arch-x86/hvm/start_info.h>
 
+#ifdef CONFIG_KEEP_STARTINFO
+/*
+ * This structure contains start-of-day info, such as pagetable base pointer,
+ * address of the shared_info structure, and things like that.
+ */
+union start_info_union start_info_union;
+#endif
+
 /*
  * Shared page for communicating with the hypervisor.
  * Events flags go here, for example.
@@ -189,6 +197,10 @@ arch_init(void *par)
 	/* print out some useful information  */
 	print_start_of_day(par);
 
+#ifdef CONFIG_KEEP_STARTINFO
+	memcpy(&start_info, par, sizeof(start_info));
+#endif
+
 	start_kernel();
 }
 
diff --git a/include/hypervisor.h b/include/hypervisor.h
index 3073a8a..5475867 100644
--- a/include/hypervisor.h
+++ b/include/hypervisor.h
@@ -27,6 +27,19 @@
 #include <mini-os/traps.h>
 
 /* hypervisor.c */
+#ifdef CONFIG_KEEP_STARTINFO
+/*
+ * a placeholder for the start of day information passed up from the hypervisor
+ */
+union start_info_union
+{
+    start_info_t start_info;
+    char padding[512];
+};
+extern union start_info_union start_info_union;
+#define start_info (start_info_union.start_info)
+#endif
+
 #ifndef CONFIG_PARAVIRT
 int hvm_get_parameter(int idx, uint64_t *value);
 int hvm_set_parameter(int idx, uint64_t value);
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-29 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 11:01 [PATCH 0/2] mini-os: repair stubdom build Juergen Gross
2016-08-29 11:01 ` Juergen Gross [this message]
2016-08-29 11:09   ` [PATCH 1/2] mini-os: support keeping start_info structure conditionally Wei Liu
2016-08-29 11:17     ` [Minios-devel] " Juergen Gross
2016-08-29 11:47       ` Andrew Cooper
2016-08-29 12:28         ` Juergen Gross
2016-08-29 12:32           ` Andrew Cooper
2016-08-29 13:09             ` Juergen Gross
2016-08-29 12:03       ` Wei Liu
2016-08-29 11:01 ` [PATCH 2/2] mini-os: don't get xenbus parameters if xenbus is disabled Juergen Gross
2016-08-29 11:11   ` Wei Liu
2016-08-29 20:42     ` Samuel Thibault

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=1472468469-11560-2-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).