Skip to contentSkip to conversation

xen: change the sizes of fields in the HVM start info layout to be 64bits

PATCH Superseded Roger Pau Monne 5 participants 9 messages Apr 8, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: change the sizes of fields in the HVM start info layout to be 64bits

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 tools/libxc/include/xc_dom.h | 20 ++++++++++----------
 xen/include/public/xen.h     | 24 +++++++++++++-----------
 2 files changed, 23 insertions(+), 21 deletions(-)
tools/libxc/include/xc_dom.h +10 -10
index 6ebe946..746cce2 100644
@@ -227,16 +227,16 @@ struct xc_dom_image {
  * 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.                                */
+    uint64_t magic;         /* Contains the magic value 0x746f6f62336ec578   */
+                            /* ("xEn3boot" with the 0x80 bit of the "E" set).*/
+    uint64_t version;       /* Version of this structure.                    */
+    uint64_t flags;         /* SIF_xxx flags.                                */
+    uint64_t cmdline_paddr; /* Physical address of the command line.         */
+    uint64_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 rsdp_paddr;    /* Physical address of the RSDP ACPI data        */
+                            /* structure.                                    */
 } __attribute__((packed));
 
 struct hvm_modlist_entry {
xen/include/public/xen.h +13 -11
index 435d789..59f3c2f 100644
@@ -814,23 +814,23 @@ typedef struct start_info start_info_t;
  *
  *  0 +----------------+
  *    | magic          | Contains the magic value XEN_HVM_START_MAGIC_VALUE
- *    |                | ("xEn3" with the 0x80 bit of the "E" set).
- *  4 +----------------+
+ *    |                | ("xEn3boot" with the 0x80 bit of the "E" set).
+ *  8 +----------------+
  *    | version        | Version of this structure. Current version is 0. New
  *    |                | versions are guaranteed to be backwards-compatible.
- *  8 +----------------+
+ * 16 +----------------+
  *    | flags          | SIF_xxx flags.
- * 12 +----------------+
+ * 24 +----------------+
  *    | cmdline_paddr  | Physical address of the command line,
  *    |                | a zero-terminated ASCII string.
- * 16 +----------------+
+ * 32 +----------------+
  *    | nr_modules     | Number of modules passed to the kernel.
- * 20 +----------------+
+ * 40 +----------------+
  *    | modlist_paddr  | Physical address of an array of modules
  *    |                | (layout of the structure below).
- * 24 +----------------+
+ * 48 +----------------+
  *    | rsdp_paddr     | Physical address of the RSDP ACPI data structure.
- * 28 +----------------+
+ * 56 +----------------+
  *
  * The layout of each entry in the module structure is the following:
  *
@@ -845,10 +845,12 @@ typedef struct start_info start_info_t;
  *    | reserved       |
  * 32 +----------------+
  *
- * The address and size of the modules is a 64bit unsigned integer. However
- * Xen will always try to place all modules below the 4GiB boundary.
+ * 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
+#define XEN_HVM_START_MAGIC_VALUE 0x746f6f62336ec578
 
 /* New console union for dom0 introduced in 0x00030203. */
 #if __XEN_INTERFACE_VERSION__ < 0x00030203
Signature · 7 lines
2.6.4 (Apple Git-63)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Roger Pau Monne

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

Quoted 7 lines

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 tools/libxc/include/xc_dom.h | 20 ++++++++++----------

Subject to an ack from HV maintainers:

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

Acked-by on v1 1/1
#2 lore raw
In reply to Roger Pau Monne
Quoted 7 lines · Roger Pau Monne

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

I hope never to need to use this for x86, but leaving some wiggleroom is probably best. If the very worst happens, the guest can just enable PAE paging to get access to the data.

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

#3 lore raw

Andrew Cooper writes ("Re: [PATCH] xen: change the sizes of fields in the HVM start info layout to be 64bits"):

Quoted 6 lines · Roger Pau Monne
Quoted 5 lines

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

Quoted 8 lines
Quoted 2 lines

I hope never to need to use this for x86, but leaving some wiggleroom is probably best. If the very worst happens, the guest can just enable PAE paging to get access to the data.

Thanks.

Queued.

Ian.

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

#4 lore raw
Quoted 14 lines
Quoted 1 line
Quoted 1 line · On 08.04.16 at 18:01, <[email protected]> wrote:

Andrew Cooper writes ("Re: [PATCH] xen: change the sizes of fields in the HVM start info layout to be 64bits"):

Quoted 11 lines · Roger Pau Monne
Quoted 7 lines

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

Quoted 7 lines
Quoted 3 lines

I hope never to need to use this for x86, but leaving some wiggleroom is probably best. If the very worst happens, the guest can just enable PAE paging to get access to the data.

Thanks.

Queued.

And already applied as I see. I think rushing things in like this is not a solution, no matter that we want to freeze the tree today. Changes like this should be free to go in as de-facto bug fixes after the freeze date.

Jan

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

#5 lore raw
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 08.04.16 at 18:01, <[email protected]> wrote:

Andrew Cooper writes ("Re: [PATCH] xen: change the sizes of fields in the HVM start info layout to be 64bits"):

Quoted 14 lines · Roger Pau Monne
Quoted 7 lines

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

I hope never to need to use this for x86, but leaving some wiggleroom is probably best. If the very worst happens, the guest can just enable PAE paging to get access to the data.

Quoted 9 lines
Quoted 3 lines

Thanks.

Queued.

And already applied as I see. I think rushing things in like this is not a solution, no matter that we want to freeze the tree today. Changes like this should be free to go in as de-facto bug fixes after the freeze date.

Yes, I'm fine with this changing after the freeze. I certainly don't want to release a wrong interface.

Wei.

Quoted 6 lines

Jan

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

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

Nacked-by on v1 1/1 NAK
#6 lore raw
In reply to Roger Pau Monne
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 08.04.16 at 17:47, <[email protected]> wrote:

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

I don't think I've asked for _all_ fields to be made 64-bit. In particular...

Quoted 10 lines
tools/libxc/include/xc_dom.h +0 -4
@@ -227,16 +227,16 @@ struct xc_dom_image {
  * 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.                            */

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 233

Quoted 10 lines
tools/libxc/include/xc_dom.h +4 -6
-    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.                                */
+    uint64_t magic;         /* Contains the magic value 0x746f6f62336ec578   */
+                            /* ("xEn3boot" with the 0x80 bit of the "E" set).*/
+    uint64_t version;       /* Version of this structure.                    */
+    uint64_t flags;         /* SIF_xxx flags.                                */

... none of these 3 need to be 64-bit, nor ...

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 235

Quoted 2 lines
tools/libxc/include/xc_dom.h +2 -0
+    uint64_t cmdline_paddr; /* Physical address of the command line.         */
+    uint64_t nr_modules;    /* Number of modules passed to the kernel.       */

... this one.

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

#7 lore raw
Quoted 35 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 08.04.16 at 17:47, <[email protected]> wrote:

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

I don't think I've asked for _all_ fields to be made 64-bit. In particular...

Quoted 10 lines
tools/libxc/include/xc_dom.h +0 -4
@@ -227,16 +227,16 @@ struct xc_dom_image {
  * 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.                            */

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 233

Quoted 10 lines
tools/libxc/include/xc_dom.h +4 -6
-    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.                                */
+    uint64_t magic;         /* Contains the magic value 0x746f6f62336ec578   */
+                            /* ("xEn3boot" with the 0x80 bit of the "E" set).*/
+    uint64_t version;       /* Version of this structure.                    */
+    uint64_t flags;         /* SIF_xxx flags.                                */

... none of these 3 need to be 64-bit, nor ...

Quoted 6 lines

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 235

Quoted 2 lines
tools/libxc/include/xc_dom.h +2 -0
+    uint64_t cmdline_paddr; /* Physical address of the command line.         */
+    uint64_t nr_modules;    /* Number of modules passed to the kernel.       */

... this one.

Ian committed this already. You might want to revert it then.

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

#8 lore raw
In reply to Jan Beulich
Quoted 35 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 08.04.16 at 17:47, <[email protected]> wrote:

At the moment the only consumer of this structure is x86, but other arches might also use it, so make all the fields 64bits. On x86 Xen will still try to place everything below the 4GiB boundary, but that might not be feasible in other arches.

I don't think I've asked for _all_ fields to be made 64-bit. In particular...

Quoted 10 lines
tools/libxc/include/xc_dom.h +0 -4
@@ -227,16 +227,16 @@ struct xc_dom_image {
  * 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.                            */

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 233

Quoted 10 lines
tools/libxc/include/xc_dom.h +4 -6
-    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.                                */
+    uint64_t magic;         /* Contains the magic value 0x746f6f62336ec578   */
+                            /* ("xEn3boot" with the 0x80 bit of the "E" set).*/
+    uint64_t version;       /* Version of this structure.                    */
+    uint64_t flags;         /* SIF_xxx flags.                                */

... none of these 3 need to be 64-bit, nor ...

Quoted 6 lines

tools/libxc/include/xc_dom.h struct xc_dom_image { · line 235

Quoted 2 lines
tools/libxc/include/xc_dom.h +2 -0
+    uint64_t cmdline_paddr; /* Physical address of the command line.         */
+    uint64_t nr_modules;    /* Number of modules passed to the kernel.       */

... this one.

I know, but I don't see any harm in them being 64bits, and then the layout is clearer IMHO.

Roger.

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