From: Anthony PERARD <anthony.perard@citrix.com>
To: xen-devel@lists.xen.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Jan Beulich <jbeulich@suse.com>,
Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v7 06/15] xen: Move the hvm_start_info C representation to the public headers
Date: Thu, 28 Jul 2016 11:50:04 +0100 [thread overview]
Message-ID: <20160728105013.22310-7-anthony.perard@citrix.com> (raw)
In-Reply-To: <20160728105013.22310-1-anthony.perard@citrix.com>
Instead of having several representation of hvm_start_info in C, define
it in public/arch-x86/hvm/start_info.h so both libxc and hvmloader can
use it.
Also move the comment describing the binary format to be alongside the
C struct.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
Changes in V7:
- also move the comment and define into arch-x86/hvm/start_info.h.
Changes in V6:
- move C representation to public/arch-x86/hvm/start_info.h instead of
public/xen.h
Change in V5:
- remove packed attribute.
New in V4.
---
tools/libxc/include/xc_dom.h | 31 ---------
tools/libxc/xc_dom_x86.c | 1 +
xen/include/public/arch-x86/hvm/start_info.h | 99 ++++++++++++++++++++++++++++
xen/include/public/xen.h | 46 -------------
4 files changed, 100 insertions(+), 77 deletions(-)
create mode 100644 xen/include/public/arch-x86/hvm/start_info.h
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 0629971..de7dca9 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -219,37 +219,6 @@ struct xc_dom_image {
struct xc_hvm_firmware_module smbios_module;
};
-#if defined(__i386__) || defined(__x86_64__)
-/* 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 nr_modules; /* Number of modules passed to the kernel. */
- uint64_t modlist_paddr; /* Physical address of an array of */
- /* hvm_modlist_entry. */
- uint64_t cmdline_paddr; /* Physical address of the command line. */
- uint64_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 /* x86 */
-
/* --- pluggable kernel loader ------------------------------------- */
struct xc_dom_loader {
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index bc2dbb2..0eab8a7 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -32,6 +32,7 @@
#include <xen/foreign/x86_32.h>
#include <xen/foreign/x86_64.h>
#include <xen/hvm/hvm_info_table.h>
+#include <xen/arch-x86/hvm/start_info.h>
#include <xen/io/protocols.h>
#include "xg_private.h"
diff --git a/xen/include/public/arch-x86/hvm/start_info.h b/xen/include/public/arch-x86/hvm/start_info.h
new file mode 100644
index 0000000..002e3b7
--- /dev/null
+++ b/xen/include/public/arch-x86/hvm/start_info.h
@@ -0,0 +1,99 @@
+/*
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Copyright (c) 2016, Citrix Systems, Inc.
+ */
+
+#ifndef __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
+#define __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
+
+/*
+ * Start of day structure passed to PVH guests and to HVM guests in %ebx.
+ *
+ * NOTE: nothing will be loaded at physical address 0, so a 0 value in any
+ * of the address fields should be treated as not present.
+ *
+ * 0 +----------------+
+ * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE
+ * | | ("xEn3" with the 0x80 bit of the "E" set).
+ * 4 +----------------+
+ * | version | Version of this structure. Current version is 0. New
+ * | | versions are guaranteed to be backwards-compatible.
+ * 8 +----------------+
+ * | flags | SIF_xxx flags.
+ * 12 +----------------+
+ * | nr_modules | Number of modules passed to the kernel.
+ * 16 +----------------+
+ * | modlist_paddr | Physical address of an array of modules
+ * | | (layout of the structure below).
+ * 24 +----------------+
+ * | cmdline_paddr | Physical address of the command line,
+ * | | a zero-terminated ASCII string.
+ * 32 +----------------+
+ * | rsdp_paddr | Physical address of the RSDP ACPI data structure.
+ * 40 +----------------+
+ *
+ * The layout of each entry in the module structure is the following:
+ *
+ * 0 +----------------+
+ * | paddr | Physical address of the module.
+ * 8 +----------------+
+ * | size | Size of the module in bytes.
+ * 16 +----------------+
+ * | cmdline_paddr | Physical address of the command line,
+ * | | a zero-terminated ASCII string.
+ * 24 +----------------+
+ * | reserved |
+ * 32 +----------------+
+ *
+ * The address and sizes are always a 64bit little endian unsigned integer.
+ *
+ * NB: Xen on x86 will always try to place all the data below the 4GiB
+ * boundary.
+ */
+#define XEN_HVM_START_MAGIC_VALUE 0x336ec578
+
+/*
+ * C representation of the x86/HVM start info layout.
+ *
+ * The canonical definition of this layout is abrove, this is just a way to
+ * represent the layout described there using C types.
+ *
+ */
+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 nr_modules; /* Number of modules passed to the kernel. */
+ uint64_t modlist_paddr; /* Physical address of an array of */
+ /* hvm_modlist_entry. */
+ uint64_t cmdline_paddr; /* Physical address of the command line. */
+ uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */
+ /* structure. */
+};
+
+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;
+};
+
+#endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 427e74f..41e415f 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -820,52 +820,6 @@ struct start_info {
};
typedef struct start_info start_info_t;
-/*
- * Start of day structure passed to PVH guests and to HVM guests in %ebx.
- *
- * NOTE: nothing will be loaded at physical address 0, so a 0 value in any
- * of the address fields should be treated as not present.
- *
- * 0 +----------------+
- * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE
- * | | ("xEn3" with the 0x80 bit of the "E" set).
- * 4 +----------------+
- * | version | Version of this structure. Current version is 0. New
- * | | versions are guaranteed to be backwards-compatible.
- * 8 +----------------+
- * | flags | SIF_xxx flags.
- * 12 +----------------+
- * | nr_modules | Number of modules passed to the kernel.
- * 16 +----------------+
- * | modlist_paddr | Physical address of an array of modules
- * | | (layout of the structure below).
- * 24 +----------------+
- * | cmdline_paddr | Physical address of the command line,
- * | | a zero-terminated ASCII string.
- * 32 +----------------+
- * | rsdp_paddr | Physical address of the RSDP ACPI data structure.
- * 40 +----------------+
- *
- * The layout of each entry in the module structure is the following:
- *
- * 0 +----------------+
- * | paddr | Physical address of the module.
- * 8 +----------------+
- * | size | Size of the module in bytes.
- * 16 +----------------+
- * | cmdline_paddr | Physical address of the command line,
- * | | a zero-terminated ASCII string.
- * 24 +----------------+
- * | reserved |
- * 32 +----------------+
- *
- * The address and sizes are always a 64bit little endian unsigned integer.
- *
- * NB: Xen on x86 will always try to place all the data below the 4GiB
- * boundary.
- */
-#define XEN_HVM_START_MAGIC_VALUE 0x336ec578
-
/* New console union for dom0 introduced in 0x00030203. */
#if __XEN_INTERFACE_VERSION__ < 0x00030203
#define console_mfn console.domU.mfn
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-28 10:50 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 10:49 [PATCH v7 00/15] Load BIOS via toolstack instead of been embedded in hvmloader Anthony PERARD
2016-07-28 10:49 ` [PATCH v7 01/15] libxc: Rework extra module initialisation Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 02/15] libxc: Prepare a start info structure for hvmloader Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 03/15] configure: #define SEABIOS_PATH and OVMF_PATH Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 04/15] firmware/makefile: install BIOS blob Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 05/15] libxl: Load guest BIOS from file Anthony PERARD
2016-08-15 9:04 ` Shannon Zhao
2016-08-15 9:09 ` Wei Liu
2016-08-15 9:14 ` Shannon Zhao
2016-08-15 9:17 ` Wei Liu
2016-07-28 10:50 ` Anthony PERARD [this message]
2016-07-28 13:23 ` [PATCH v7 06/15] xen: Move the hvm_start_info C representation to the public headers Andrew Cooper
2016-08-03 15:43 ` Jan Beulich
2016-07-28 10:50 ` [PATCH v7 07/15] hvmloader: Grab the hvm_start_info pointer Anthony PERARD
2016-07-28 14:09 ` Andrew Cooper
2016-07-28 10:50 ` [PATCH v7 08/15] hvmloader: Locate the BIOS blob Anthony PERARD
2016-07-28 13:44 ` Andrew Cooper
2016-08-02 18:14 ` Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 09/15] hvmloader: Check modules whereabouts in perform_tests Anthony PERARD
2016-07-28 14:08 ` Andrew Cooper
2016-08-02 18:34 ` Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 10/15] hvmloader: Load SeaBIOS from hvm_start_info modules Anthony PERARD
2016-07-28 14:09 ` Andrew Cooper
2016-07-28 10:50 ` [PATCH v7 11/15] hvmloader: Load OVMF from modules Anthony PERARD
2016-07-28 14:11 ` Andrew Cooper
2016-07-28 10:50 ` [PATCH v7 12/15] hvmloader: bios->bios_load() now needs to be defined Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 13/15] hvmloader: Always build-in SeaBIOS and OVMF loader Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 14/15] configure: do not depend on SEABIOS_PATH or OVMF_PATH Anthony PERARD
2016-07-28 10:50 ` [PATCH v7 15/15] docs/misc/hvmlite: Point to the canonical definition of hvm_start_info Anthony PERARD
2016-08-01 12:29 ` Jan Beulich
2016-07-29 5:28 ` [PATCH v7 00/15] Load BIOS via toolstack instead of been embedded in hvmloader Boris Ostrovsky
2016-07-29 8:29 ` Wei Liu
2016-07-29 14:36 ` Boris Ostrovsky
2016-07-29 14:50 ` Wei Liu
2016-07-29 14:57 ` Boris Ostrovsky
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=20160728105013.22310-7-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--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).