Skip to contentSkip to conversation

xen: Move the hvm_start_info C representation to the public headers

PATCH In review Juergen Gross 2 participants 2 messages Aug 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Move the hvm_start_info C representation to the public headers

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.

---
This is a resend of Anthony's patch "[PATCH v7 06/15] xen: Move the hvm_start_info C representation to the public headers" in order to make the structure usable for mini-os.

---
 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
tools/libxc/include/xc_dom.h +0 -31
index 6cb10c4..cac4698 100644
@@ -216,37 +216,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 {
tools/libxc/xc_dom_x86.c +1 -0
index 021f8a8..d9747b4 100644
@@ -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"
xen/include/public/arch-x86/hvm/start_info.h new file +99 -0

99 lines not on this page · raw message

xen/include/public/xen.h +0 -46

52 lines not on this page · raw message

Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by Jan Beulich Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Juergen Gross

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.

On the original patch:

Quoted 4 lines

+/*
+ * C representation of the x86/HVM start info layout.
+ *
+ * The canonical definition of this layout is abrove, this is just a way to

above

Quoted 2 lines

+ * represent the layout described there using C types.
+ *

I will delete this line while committing

(Both changes are required by Jan)

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel