^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * elfnote.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Definitions used for the Xen ELF notes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Permission is hereby granted, free of charge, to any person obtaining a copy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * of this software and associated documentation files (the "Software"), to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * deal in the Software without restriction, including without limitation the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * sell copies of the Software, and to permit persons to whom the Software is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * furnished to do so, subject to the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * The above copyright notice and this permission notice shall be included in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * all copies or substantial portions of the Software.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * DEALINGS IN THE SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #ifndef __XEN_PUBLIC_ELFNOTE_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define __XEN_PUBLIC_ELFNOTE_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * The notes should live in a SHT_NOTE segment and have "Xen" in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * name field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * Numeric types are either 4 or 8 bytes depending on the content of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * the desc field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * LEGACY indicated the fields in the legacy __xen_guest string which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * this a note type replaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * String values (for non-legacy) are NULL terminated ASCII, also known
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * as ASCIZ type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * NAME=VALUE pair (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define XEN_ELFNOTE_INFO 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * The virtual address of the entry point (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * LEGACY: VIRT_ENTRY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define XEN_ELFNOTE_ENTRY 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) /* The virtual address of the hypercall transfer page (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * number not a virtual address)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define XEN_ELFNOTE_HYPERCALL_PAGE 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* The virtual address where the kernel image should be mapped (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * Defaults to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * LEGACY: VIRT_BASE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #define XEN_ELFNOTE_VIRT_BASE 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * The offset of the ELF paddr field from the acutal required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * pseudo-physical address (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * This is used to maintain backwards compatibility with older kernels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) * which wrote __PAGE_OFFSET into that field. This field defaults to 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * if not present.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #define XEN_ELFNOTE_PADDR_OFFSET 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * The version of Xen that we work with (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * LEGACY: XEN_VER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define XEN_ELFNOTE_XEN_VERSION 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * The name of the guest operating system (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * LEGACY: GUEST_OS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) #define XEN_ELFNOTE_GUEST_OS 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * The version of the guest operating system (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * LEGACY: GUEST_VER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define XEN_ELFNOTE_GUEST_VERSION 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * The loader type (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * LEGACY: LOADER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define XEN_ELFNOTE_LOADER 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * The kernel supports PAE (x86/32 only, string = "yes" or "no").
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * LEGACY: PAE (n.b. The legacy interface included a provision to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * indicate 'extended-cr3' support allowing L3 page tables to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * placed above 4G. It is assumed that any kernel new enough to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * these ELF notes will include this and therefore "yes" here is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define XEN_ELFNOTE_PAE_MODE 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * The features supported/required by this kernel (string).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) * The string must consist of a list of feature names (as given in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) * features.h, without the "XENFEAT_" prefix) separated by '|'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * characters. If a feature is required for the kernel to function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * then the feature name must be preceded by a '!' character.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * LEGACY: FEATURES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #define XEN_ELFNOTE_FEATURES 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) * The kernel requires the symbol table to be loaded (string = "yes" or "no")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) * of this string as a boolean flag rather than requiring "yes" or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) * "no".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) #define XEN_ELFNOTE_BSD_SYMTAB 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) * The lowest address the hypervisor hole can begin at (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * also indicates to the hypervisor that the kernel can deal with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) * hole starting at a higher address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define XEN_ELFNOTE_HV_START_LOW 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * List of maddr_t-sized mask/value pairs describing how to recognize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * (non-present) L1 page table entries carrying valid MFNs (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #define XEN_ELFNOTE_L1_MFN_VALID 13
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * Whether or not the guest supports cooperative suspend cancellation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * This is a numeric value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * Default is 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #define XEN_ELFNOTE_SUSPEND_CANCEL 14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * The (non-default) location the initial phys-to-machine map should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * placed at by the hypervisor (Dom0) or the tools (DomU).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * The kernel must be prepared for this mapping to be established using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * large pages, despite such otherwise not being available to guests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * The kernel must also be able to handle the page table pages used for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * this mapping not being accessible through the initial mapping.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) * (Only x86-64 supports this at present.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #define XEN_ELFNOTE_INIT_P2M 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) * Whether or not the guest can deal with being passed an initrd not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * mapped through its initial page tables.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #define XEN_ELFNOTE_MOD_START_PFN 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * The features supported by this kernel (numeric).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) * kernel to specify support for features that older hypervisors don't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * know about. The set of features 4.2 and newer hypervisors will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) * consider supported by the kernel is the combination of the sets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) * specified through this and the string note.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) * LEGACY: FEATURES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * Physical entry point into the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * 32bit entry point into the kernel. When requested to launch the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) * guest kernel in a HVM container, Xen will use this entry point to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * launch the guest in 32bit protected mode with paging disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) * Ignored otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) #define XEN_ELFNOTE_PHYS32_ENTRY 18
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) * The number of the highest elfnote defined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) * Local variables:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) * mode: C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) * c-set-style: "BSD"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * c-basic-offset: 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) * tab-width: 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) * indent-tabs-mode: nil
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) * End:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) */