From: Anthony PERARD <anthony.perard@citrix.com>
To: xen-devel@lists.xen.org
Cc: Anthony PERARD <anthony.perard@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v3 07/16] hvmloader: Grab the hvm_start_info pointer
Date: Thu, 25 Feb 2016 14:56:05 +0000 [thread overview]
Message-ID: <1456412174-20162-8-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1456412174-20162-1-git-send-email-anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
Change in V3:
- remove cmdline parser
- load hvm_start_info pointer earlier, before calling main().
- Add struct hvm_start_info definition to hvmloader.
---
tools/firmware/hvmloader/hvm_start_info.h | 32 +++++++++++++++++++++++++++++++
tools/firmware/hvmloader/hvmloader.c | 6 ++++++
2 files changed, 38 insertions(+)
create mode 100644 tools/firmware/hvmloader/hvm_start_info.h
diff --git a/tools/firmware/hvmloader/hvm_start_info.h b/tools/firmware/hvmloader/hvm_start_info.h
new file mode 100644
index 0000000..b95d60d
--- /dev/null
+++ b/tools/firmware/hvmloader/hvm_start_info.h
@@ -0,0 +1,32 @@
+#ifndef __HVM_START_INFO_H__
+#define __HVM_START_INFO_H__
+
+/* C representation of the x86/HVM start info layout.
+ *
+ * The canonical definition of this layout resides in public/xen.h, this
+ * is just a way to represent the layout described there using C types.
+ *
+ * NB: the packed attribute is not really needed, but it helps us enforce
+ * the fact this this is just a representation, and it might indeed
+ * be required in the future if there are alignment changes.
+ */
+struct hvm_start_info {
+ uint32_t magic; /* Contains the magic value 0x336ec578 */
+ /* ("xEn3" with the 0x80 bit of the "E" set).*/
+ uint32_t version; /* Version of this structure. */
+ uint32_t flags; /* SIF_xxx flags. */
+ uint32_t cmdline_paddr; /* Physical address of the command line. */
+ uint32_t nr_modules; /* Number of modules passed to the kernel. */
+ uint32_t modlist_paddr; /* Physical address of an array of */
+ /* hvm_modlist_entry. */
+ uint32_t rsdp_paddr; /* Physical address of the RSDP ACPI data */
+ /* structure. */
+} __attribute__((packed));
+
+struct hvm_modlist_entry {
+ uint64_t paddr; /* Physical address of the module. */
+ uint64_t size; /* Size of the module in bytes. */
+ uint64_t cmdline_paddr; /* Physical address of the command line. */
+ uint64_t reserved;
+} __attribute__((packed));
+#endif /* __HVM_START_INFO_H__ */
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 716d03c..20ec8dc 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -28,6 +28,9 @@
#include "vnuma.h"
#include <xen/version.h>
#include <xen/hvm/params.h>
+#include "hvm_start_info.h"
+
+const struct hvm_start_info *hvm_start_info;
asm (
" .text \n"
@@ -46,6 +49,8 @@ asm (
" ljmp $"STR(SEL_CODE32)",$1f \n"
"1: movl $stack_top,%esp \n"
" movl %esp,%ebp \n"
+ /* store HVM start info ptr */
+ " mov %ebx, hvm_start_info \n"
" call main \n"
/* Relocate real-mode trampoline to 0x0. */
" mov $trampoline_start,%esi \n"
@@ -258,6 +263,7 @@ int main(void)
memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);
printf("HVM Loader\n");
+ BUG_ON(hvm_start_info->magic != XEN_HVM_START_MAGIC_VALUE);
init_hypercalls();
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-02-25 14:56 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 14:55 [PATCH v3 00/16] Load BIOS via toolstack instead of been embedded in hvmloader Anthony PERARD
2016-02-25 14:55 ` [PATCH v3 01/16] libxc: Rework extra module initialisation Anthony PERARD
2016-03-01 11:51 ` Wei Liu
2016-03-03 16:27 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 02/16] libxc: Load BIOS and ACPI table into guest memory Anthony PERARD
2016-03-01 11:51 ` Wei Liu
2016-03-03 16:57 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 03/16] configure: #define SEABIOS_PATH and OVMF_PATH Anthony PERARD
2016-03-01 11:51 ` Wei Liu
2016-03-03 17:03 ` Anthony PERARD
2016-03-08 15:55 ` Wei Liu
2016-02-25 14:56 ` [PATCH v3 04/16] firmware/makefile: install BIOS and ACPI blob Anthony PERARD
2016-02-29 16:31 ` Jan Beulich
2016-03-03 15:44 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 05/16] libxl: Load guest BIOS from file Anthony PERARD
2016-03-01 11:51 ` Wei Liu
2016-03-03 17:16 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 06/16] libxl: Load guest ACPI table " Anthony PERARD
2016-03-01 11:51 ` Wei Liu
2016-03-03 17:12 ` Anthony PERARD
2016-03-08 15:55 ` Wei Liu
2016-02-25 14:56 ` Anthony PERARD [this message]
2016-02-29 16:37 ` [PATCH v3 07/16] hvmloader: Grab the hvm_start_info pointer Jan Beulich
2016-02-29 16:48 ` Jan Beulich
2016-02-25 14:56 ` [PATCH v3 08/16] hvmloader: Locate the BIOS blob Anthony PERARD
2016-02-29 16:56 ` Jan Beulich
2016-03-03 16:21 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 09/16] hvmloader: Check modules whereabouts Anthony PERARD
2016-02-29 16:58 ` Jan Beulich
2016-03-03 16:00 ` Anthony PERARD
2016-03-03 16:18 ` Jan Beulich
2016-03-03 16:34 ` Andrew Cooper
2016-02-25 14:56 ` [PATCH v3 10/16] hvmloader: Load SeaBIOS from hvm_start_info modules Anthony PERARD
2016-02-29 17:02 ` Jan Beulich
2016-03-03 16:15 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 11/16] hvmloader: Load OVMF from modules Anthony PERARD
2016-03-01 16:03 ` Jan Beulich
2016-03-03 17:39 ` Anthony PERARD
2016-03-05 18:05 ` Wei Liu
2016-02-25 14:56 ` [PATCH v3 12/16] hvmloader: Specific bios_load function required Anthony PERARD
2016-03-01 16:07 ` Jan Beulich
2016-02-25 14:56 ` [PATCH v3 13/16] hvmloader: Load ACPI tables from hvm_start_info module Anthony PERARD
2016-03-01 16:17 ` Jan Beulich
2016-03-03 17:59 ` Anthony PERARD
2016-03-04 8:39 ` Jan Beulich
2016-03-08 11:15 ` Anthony PERARD
2016-02-25 14:56 ` [PATCH v3 14/16] hvmloader: Compile out the qemu-xen ACPI tables Anthony PERARD
2016-03-01 16:19 ` Jan Beulich
2016-02-25 14:56 ` [PATCH v3 15/16] hvmloader: Always build-in SeaBIOS and OVMF loader Anthony PERARD
2016-03-01 16:20 ` Jan Beulich
2016-02-25 14:56 ` [PATCH v3 16/16] hvmloader: do not depend on SEABIOS_PATH or OVMF_PATH Anthony PERARD
2016-03-01 16:24 ` Jan Beulich
2016-03-03 11:38 ` Wei Liu
2016-02-25 16:16 ` [PATCH v3 00/16] Load BIOS via toolstack instead of been embedded in hvmloader Boris Ostrovsky
2016-02-25 16:43 ` Anthony PERARD
2016-03-03 18:03 ` Anthony PERARD
2016-03-04 10:57 ` Andrew Cooper
2016-03-08 11:21 ` Anthony PERARD
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=1456412174-20162-8-git-send-email-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).