elfnote.h 6.1 KB

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