GNU Linux-libre 4.19.264-gnu1
[releases.git] / include / xen / interface / hvm / start_info.h
1 /*
2  * Permission is hereby granted, free of charge, to any person obtaining a copy
3  * of this software and associated documentation files (the "Software"), to
4  * deal in the Software without restriction, including without limitation the
5  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6  * sell copies of the Software, and to permit persons to whom the Software is
7  * furnished to do so, subject to the following conditions:
8  *
9  * The above copyright notice and this permission notice shall be included in
10  * all copies or substantial portions of the Software.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18  * DEALINGS IN THE SOFTWARE.
19  *
20  * Copyright (c) 2016, Citrix Systems, Inc.
21  */
22
23 #ifndef __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
24 #define __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
25
26 /*
27  * Start of day structure passed to PVH guests and to HVM guests in %ebx.
28  *
29  * NOTE: nothing will be loaded at physical address 0, so a 0 value in any
30  * of the address fields should be treated as not present.
31  *
32  *  0 +----------------+
33  *    | magic          | Contains the magic value XEN_HVM_START_MAGIC_VALUE
34  *    |                | ("xEn3" with the 0x80 bit of the "E" set).
35  *  4 +----------------+
36  *    | version        | Version of this structure. Current version is 0. New
37  *    |                | versions are guaranteed to be backwards-compatible.
38  *  8 +----------------+
39  *    | flags          | SIF_xxx flags.
40  * 12 +----------------+
41  *    | nr_modules     | Number of modules passed to the kernel.
42  * 16 +----------------+
43  *    | modlist_paddr  | Physical address of an array of modules
44  *    |                | (layout of the structure below).
45  * 24 +----------------+
46  *    | cmdline_paddr  | Physical address of the command line,
47  *    |                | a zero-terminated ASCII string.
48  * 32 +----------------+
49  *    | rsdp_paddr     | Physical address of the RSDP ACPI data structure.
50  * 40 +----------------+
51  *
52  * The layout of each entry in the module structure is the following:
53  *
54  *  0 +----------------+
55  *    | paddr          | Physical address of the module.
56  *  8 +----------------+
57  *    | size           | Size of the module in bytes.
58  * 16 +----------------+
59  *    | cmdline_paddr  | Physical address of the command line,
60  *    |                | a zero-terminated ASCII string.
61  * 24 +----------------+
62  *    | reserved       |
63  * 32 +----------------+
64  *
65  * The address and sizes are always a 64bit little endian unsigned integer.
66  *
67  * NB: Xen on x86 will always try to place all the data below the 4GiB
68  * boundary.
69  */
70 #define XEN_HVM_START_MAGIC_VALUE 0x336ec578
71
72 /*
73  * C representation of the x86/HVM start info layout.
74  *
75  * The canonical definition of this layout is above, this is just a way to
76  * represent the layout described there using C types.
77  */
78 struct hvm_start_info {
79     uint32_t magic;             /* Contains the magic value 0x336ec578       */
80                                 /* ("xEn3" with the 0x80 bit of the "E" set).*/
81     uint32_t version;           /* Version of this structure.                */
82     uint32_t flags;             /* SIF_xxx flags.                            */
83     uint32_t nr_modules;        /* Number of modules passed to the kernel.   */
84     uint64_t modlist_paddr;     /* Physical address of an array of           */
85                                 /* hvm_modlist_entry.                        */
86     uint64_t cmdline_paddr;     /* Physical address of the command line.     */
87     uint64_t rsdp_paddr;        /* Physical address of the RSDP ACPI data    */
88                                 /* structure.                                */
89 };
90
91 struct hvm_modlist_entry {
92     uint64_t paddr;             /* Physical address of the module.           */
93     uint64_t size;              /* Size of the module in bytes.              */
94     uint64_t cmdline_paddr;     /* Physical address of the command line.     */
95     uint64_t reserved;
96 };
97
98 #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */