Linux Audio

Check our new training course

Loading...
v6.13.7
  1/* SPDX-License-Identifier: MIT */
  2/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  3 * Copyright (c) 2016, Citrix Systems, Inc.
  4 */
  5
  6#ifndef __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
  7#define __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__
  8
  9/*
 10 * Start of day structure passed to PVH guests and to HVM guests in %ebx.
 11 *
 12 * NOTE: nothing will be loaded at physical address 0, so a 0 value in any
 13 * of the address fields should be treated as not present.
 14 *
 15 *  0 +----------------+
 16 *    | magic          | Contains the magic value XEN_HVM_START_MAGIC_VALUE
 17 *    |                | ("xEn3" with the 0x80 bit of the "E" set).
 18 *  4 +----------------+
 19 *    | version        | Version of this structure. Current version is 1. New
 20 *    |                | versions are guaranteed to be backwards-compatible.
 21 *  8 +----------------+
 22 *    | flags          | SIF_xxx flags.
 23 * 12 +----------------+
 24 *    | nr_modules     | Number of modules passed to the kernel.
 25 * 16 +----------------+
 26 *    | modlist_paddr  | Physical address of an array of modules
 27 *    |                | (layout of the structure below).
 28 * 24 +----------------+
 29 *    | cmdline_paddr  | Physical address of the command line,
 30 *    |                | a zero-terminated ASCII string.
 31 * 32 +----------------+
 32 *    | rsdp_paddr     | Physical address of the RSDP ACPI data structure.
 33 * 40 +----------------+
 34 *    | memmap_paddr   | Physical address of the (optional) memory map. Only
 35 *    |                | present in version 1 and newer of the structure.
 36 * 48 +----------------+
 37 *    | memmap_entries | Number of entries in the memory map table. Zero
 38 *    |                | if there is no memory map being provided. Only
 39 *    |                | present in version 1 and newer of the structure.
 40 * 52 +----------------+
 41 *    | reserved       | Version 1 and newer only.
 42 * 56 +----------------+
 43 *
 44 * The layout of each entry in the module structure is the following:
 45 *
 46 *  0 +----------------+
 47 *    | paddr          | Physical address of the module.
 48 *  8 +----------------+
 49 *    | size           | Size of the module in bytes.
 50 * 16 +----------------+
 51 *    | cmdline_paddr  | Physical address of the command line,
 52 *    |                | a zero-terminated ASCII string.
 53 * 24 +----------------+
 54 *    | reserved       |
 55 * 32 +----------------+
 56 *
 57 * The layout of each entry in the memory map table is as follows:
 58 *
 59 *  0 +----------------+
 60 *    | addr           | Base address
 61 *  8 +----------------+
 62 *    | size           | Size of mapping in bytes
 63 * 16 +----------------+
 64 *    | type           | Type of mapping as defined between the hypervisor
 65 *    |                | and guest. See XEN_HVM_MEMMAP_TYPE_* values below.
 66 * 20 +----------------|
 67 *    | reserved       |
 68 * 24 +----------------+
 69 *
 70 * The address and sizes are always a 64bit little endian unsigned integer.
 71 *
 72 * NB: Xen on x86 will always try to place all the data below the 4GiB
 73 * boundary.
 74 *
 75 * Version numbers of the hvm_start_info structure have evolved like this:
 76 *
 77 * Version 0:  Initial implementation.
 78 *
 79 * Version 1:  Added the memmap_paddr/memmap_entries fields (plus 4 bytes of
 80 *             padding) to the end of the hvm_start_info struct. These new
 81 *             fields can be used to pass a memory map to the guest. The
 82 *             memory map is optional and so guests that understand version 1
 83 *             of the structure must check that memmap_entries is non-zero
 84 *             before trying to read the memory map.
 85 */
 86#define XEN_HVM_START_MAGIC_VALUE 0x336ec578
 87
 88/*
 89 * The values used in the type field of the memory map table entries are
 90 * defined below and match the Address Range Types as defined in the "System
 91 * Address Map Interfaces" section of the ACPI Specification. Please refer to
 92 * section 15 in version 6.2 of the ACPI spec: http://uefi.org/specifications
 93 */
 94#define XEN_HVM_MEMMAP_TYPE_RAM       1
 95#define XEN_HVM_MEMMAP_TYPE_RESERVED  2
 96#define XEN_HVM_MEMMAP_TYPE_ACPI      3
 97#define XEN_HVM_MEMMAP_TYPE_NVS       4
 98#define XEN_HVM_MEMMAP_TYPE_UNUSABLE  5
 99#define XEN_HVM_MEMMAP_TYPE_DISABLED  6
100#define XEN_HVM_MEMMAP_TYPE_PMEM      7
101
102/*
103 * C representation of the x86/HVM start info layout.
104 *
105 * The canonical definition of this layout is above, this is just a way to
106 * represent the layout described there using C types.
107 */
108struct hvm_start_info {
109    uint32_t magic;             /* Contains the magic value 0x336ec578       */
110                                /* ("xEn3" with the 0x80 bit of the "E" set).*/
111    uint32_t version;           /* Version of this structure.                */
112    uint32_t flags;             /* SIF_xxx flags.                            */
113    uint32_t nr_modules;        /* Number of modules passed to the kernel.   */
114    uint64_t modlist_paddr;     /* Physical address of an array of           */
115                                /* hvm_modlist_entry.                        */
116    uint64_t cmdline_paddr;     /* Physical address of the command line.     */
117    uint64_t rsdp_paddr;        /* Physical address of the RSDP ACPI data    */
118                                /* structure.                                */
119    /* All following fields only present in version 1 and newer */
120    uint64_t memmap_paddr;      /* Physical address of an array of           */
121                                /* hvm_memmap_table_entry.                   */
122    uint32_t memmap_entries;    /* Number of entries in the memmap table.    */
123                                /* Value will be zero if there is no memory  */
124                                /* map being provided.                       */
125    uint32_t reserved;          /* Must be zero.                             */
126};
127
128struct hvm_modlist_entry {
129    uint64_t paddr;             /* Physical address of the module.           */
130    uint64_t size;              /* Size of the module in bytes.              */
131    uint64_t cmdline_paddr;     /* Physical address of the command line.     */
132    uint64_t reserved;
133};
134
135struct hvm_memmap_table_entry {
136    uint64_t addr;              /* Base address of the memory region         */
137    uint64_t size;              /* Size of the memory region in bytes        */
138    uint32_t type;              /* Mapping type                              */
139    uint32_t reserved;          /* Must be zero for Version 1.               */
140};
141
142#endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */
v5.4
 
  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 1. 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 *    | memmap_paddr   | Physical address of the (optional) memory map. Only
 52 *    |                | present in version 1 and newer of the structure.
 53 * 48 +----------------+
 54 *    | memmap_entries | Number of entries in the memory map table. Zero
 55 *    |                | if there is no memory map being provided. Only
 56 *    |                | present in version 1 and newer of the structure.
 57 * 52 +----------------+
 58 *    | reserved       | Version 1 and newer only.
 59 * 56 +----------------+
 60 *
 61 * The layout of each entry in the module structure is the following:
 62 *
 63 *  0 +----------------+
 64 *    | paddr          | Physical address of the module.
 65 *  8 +----------------+
 66 *    | size           | Size of the module in bytes.
 67 * 16 +----------------+
 68 *    | cmdline_paddr  | Physical address of the command line,
 69 *    |                | a zero-terminated ASCII string.
 70 * 24 +----------------+
 71 *    | reserved       |
 72 * 32 +----------------+
 73 *
 74 * The layout of each entry in the memory map table is as follows:
 75 *
 76 *  0 +----------------+
 77 *    | addr           | Base address
 78 *  8 +----------------+
 79 *    | size           | Size of mapping in bytes
 80 * 16 +----------------+
 81 *    | type           | Type of mapping as defined between the hypervisor
 82 *    |                | and guest. See XEN_HVM_MEMMAP_TYPE_* values below.
 83 * 20 +----------------|
 84 *    | reserved       |
 85 * 24 +----------------+
 86 *
 87 * The address and sizes are always a 64bit little endian unsigned integer.
 88 *
 89 * NB: Xen on x86 will always try to place all the data below the 4GiB
 90 * boundary.
 91 *
 92 * Version numbers of the hvm_start_info structure have evolved like this:
 93 *
 94 * Version 0:  Initial implementation.
 95 *
 96 * Version 1:  Added the memmap_paddr/memmap_entries fields (plus 4 bytes of
 97 *             padding) to the end of the hvm_start_info struct. These new
 98 *             fields can be used to pass a memory map to the guest. The
 99 *             memory map is optional and so guests that understand version 1
100 *             of the structure must check that memmap_entries is non-zero
101 *             before trying to read the memory map.
102 */
103#define XEN_HVM_START_MAGIC_VALUE 0x336ec578
104
105/*
106 * The values used in the type field of the memory map table entries are
107 * defined below and match the Address Range Types as defined in the "System
108 * Address Map Interfaces" section of the ACPI Specification. Please refer to
109 * section 15 in version 6.2 of the ACPI spec: http://uefi.org/specifications
110 */
111#define XEN_HVM_MEMMAP_TYPE_RAM       1
112#define XEN_HVM_MEMMAP_TYPE_RESERVED  2
113#define XEN_HVM_MEMMAP_TYPE_ACPI      3
114#define XEN_HVM_MEMMAP_TYPE_NVS       4
115#define XEN_HVM_MEMMAP_TYPE_UNUSABLE  5
116#define XEN_HVM_MEMMAP_TYPE_DISABLED  6
117#define XEN_HVM_MEMMAP_TYPE_PMEM      7
118
119/*
120 * C representation of the x86/HVM start info layout.
121 *
122 * The canonical definition of this layout is above, this is just a way to
123 * represent the layout described there using C types.
124 */
125struct hvm_start_info {
126    uint32_t magic;             /* Contains the magic value 0x336ec578       */
127                                /* ("xEn3" with the 0x80 bit of the "E" set).*/
128    uint32_t version;           /* Version of this structure.                */
129    uint32_t flags;             /* SIF_xxx flags.                            */
130    uint32_t nr_modules;        /* Number of modules passed to the kernel.   */
131    uint64_t modlist_paddr;     /* Physical address of an array of           */
132                                /* hvm_modlist_entry.                        */
133    uint64_t cmdline_paddr;     /* Physical address of the command line.     */
134    uint64_t rsdp_paddr;        /* Physical address of the RSDP ACPI data    */
135                                /* structure.                                */
136    /* All following fields only present in version 1 and newer */
137    uint64_t memmap_paddr;      /* Physical address of an array of           */
138                                /* hvm_memmap_table_entry.                   */
139    uint32_t memmap_entries;    /* Number of entries in the memmap table.    */
140                                /* Value will be zero if there is no memory  */
141                                /* map being provided.                       */
142    uint32_t reserved;          /* Must be zero.                             */
143};
144
145struct hvm_modlist_entry {
146    uint64_t paddr;             /* Physical address of the module.           */
147    uint64_t size;              /* Size of the module in bytes.              */
148    uint64_t cmdline_paddr;     /* Physical address of the command line.     */
149    uint64_t reserved;
150};
151
152struct hvm_memmap_table_entry {
153    uint64_t addr;              /* Base address of the memory region         */
154    uint64_t size;              /* Size of the memory region in bytes        */
155    uint32_t type;              /* Mapping type                              */
156    uint32_t reserved;          /* Must be zero for Version 1.               */
157};
158
159#endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */