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