diff options
| -rw-r--r-- | include/xen/interface/hvm/start_info.h | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/include/xen/interface/hvm/start_info.h b/include/xen/interface/hvm/start_info.h index 648415976ead..50af9ea2ff1e 100644 --- a/include/xen/interface/hvm/start_info.h +++ b/include/xen/interface/hvm/start_info.h | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE | 33 | * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE |
| 34 | * | | ("xEn3" with the 0x80 bit of the "E" set). | 34 | * | | ("xEn3" with the 0x80 bit of the "E" set). |
| 35 | * 4 +----------------+ | 35 | * 4 +----------------+ |
| 36 | * | version | Version of this structure. Current version is 0. New | 36 | * | version | Version of this structure. Current version is 1. New |
| 37 | * | | versions are guaranteed to be backwards-compatible. | 37 | * | | versions are guaranteed to be backwards-compatible. |
| 38 | * 8 +----------------+ | 38 | * 8 +----------------+ |
| 39 | * | flags | SIF_xxx flags. | 39 | * | flags | SIF_xxx flags. |
| @@ -48,6 +48,15 @@ | |||
| 48 | * 32 +----------------+ | 48 | * 32 +----------------+ |
| 49 | * | rsdp_paddr | Physical address of the RSDP ACPI data structure. | 49 | * | rsdp_paddr | Physical address of the RSDP ACPI data structure. |
| 50 | * 40 +----------------+ | 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 +----------------+ | ||
| 51 | * | 60 | * |
| 52 | * The layout of each entry in the module structure is the following: | 61 | * The layout of each entry in the module structure is the following: |
| 53 | * | 62 | * |
| @@ -62,14 +71,52 @@ | |||
| 62 | * | reserved | | 71 | * | reserved | |
| 63 | * 32 +----------------+ | 72 | * 32 +----------------+ |
| 64 | * | 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 | * | ||
| 65 | * The address and sizes are always a 64bit little endian unsigned integer. | 87 | * The address and sizes are always a 64bit little endian unsigned integer. |
| 66 | * | 88 | * |
| 67 | * NB: Xen on x86 will always try to place all the data below the 4GiB | 89 | * NB: Xen on x86 will always try to place all the data below the 4GiB |
| 68 | * boundary. | 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. | ||
| 69 | */ | 102 | */ |
| 70 | #define XEN_HVM_START_MAGIC_VALUE 0x336ec578 | 103 | #define XEN_HVM_START_MAGIC_VALUE 0x336ec578 |
| 71 | 104 | ||
| 72 | /* | 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 | /* | ||
| 73 | * C representation of the x86/HVM start info layout. | 120 | * C representation of the x86/HVM start info layout. |
| 74 | * | 121 | * |
| 75 | * The canonical definition of this layout is above, this is just a way to | 122 | * The canonical definition of this layout is above, this is just a way to |
| @@ -86,6 +133,13 @@ struct hvm_start_info { | |||
| 86 | uint64_t cmdline_paddr; /* Physical address of the command line. */ | 133 | uint64_t cmdline_paddr; /* Physical address of the command line. */ |
| 87 | uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */ | 134 | uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */ |
| 88 | /* structure. */ | 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. */ | ||
| 89 | }; | 143 | }; |
| 90 | 144 | ||
| 91 | struct hvm_modlist_entry { | 145 | struct hvm_modlist_entry { |
| @@ -95,4 +149,11 @@ struct hvm_modlist_entry { | |||
| 95 | uint64_t reserved; | 149 | uint64_t reserved; |
| 96 | }; | 150 | }; |
| 97 | 151 | ||
| 152 | struct 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 | |||
| 98 | #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */ | 159 | #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */ |
