elfnote.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 PT_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. /*
  39. * NAME=VALUE pair (string).
  40. */
  41. #define XEN_ELFNOTE_INFO 0
  42. /*
  43. * The virtual address of the entry point (numeric).
  44. *
  45. * LEGACY: VIRT_ENTRY
  46. */
  47. #define XEN_ELFNOTE_ENTRY 1
  48. /* The virtual address of the hypercall transfer page (numeric).
  49. *
  50. * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
  51. * number not a virtual address)
  52. */
  53. #define XEN_ELFNOTE_HYPERCALL_PAGE 2
  54. /* The virtual address where the kernel image should be mapped (numeric).
  55. *
  56. * Defaults to 0.
  57. *
  58. * LEGACY: VIRT_BASE
  59. */
  60. #define XEN_ELFNOTE_VIRT_BASE 3
  61. /*
  62. * The offset of the ELF paddr field from the acutal required
  63. * psuedo-physical address (numeric).
  64. *
  65. * This is used to maintain backwards compatibility with older kernels
  66. * which wrote __PAGE_OFFSET into that field. This field defaults to 0
  67. * if not present.
  68. *
  69. * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
  70. */
  71. #define XEN_ELFNOTE_PADDR_OFFSET 4
  72. /*
  73. * The version of Xen that we work with (string).
  74. *
  75. * LEGACY: XEN_VER
  76. */
  77. #define XEN_ELFNOTE_XEN_VERSION 5
  78. /*
  79. * The name of the guest operating system (string).
  80. *
  81. * LEGACY: GUEST_OS
  82. */
  83. #define XEN_ELFNOTE_GUEST_OS 6
  84. /*
  85. * The version of the guest operating system (string).
  86. *
  87. * LEGACY: GUEST_VER
  88. */
  89. #define XEN_ELFNOTE_GUEST_VERSION 7
  90. /*
  91. * The loader type (string).
  92. *
  93. * LEGACY: LOADER
  94. */
  95. #define XEN_ELFNOTE_LOADER 8
  96. /*
  97. * The kernel supports PAE (x86/32 only, string = "yes", "no" or
  98. * "bimodal").
  99. *
  100. * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
  101. * may be given as "yes,bimodal" which will cause older Xen to treat
  102. * this kernel as PAE.
  103. *
  104. * LEGACY: PAE (n.b. The legacy interface included a provision to
  105. * indicate 'extended-cr3' support allowing L3 page tables to be
  106. * placed above 4G. It is assumed that any kernel new enough to use
  107. * these ELF notes will include this and therefore "yes" here is
  108. * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
  109. */
  110. #define XEN_ELFNOTE_PAE_MODE 9
  111. /*
  112. * The features supported/required by this kernel (string).
  113. *
  114. * The string must consist of a list of feature names (as given in
  115. * features.h, without the "XENFEAT_" prefix) separated by '|'
  116. * characters. If a feature is required for the kernel to function
  117. * then the feature name must be preceded by a '!' character.
  118. *
  119. * LEGACY: FEATURES
  120. */
  121. #define XEN_ELFNOTE_FEATURES 10
  122. /*
  123. * The kernel requires the symbol table to be loaded (string = "yes" or "no")
  124. * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
  125. * of this string as a boolean flag rather than requiring "yes" or
  126. * "no".
  127. */
  128. #define XEN_ELFNOTE_BSD_SYMTAB 11
  129. /*
  130. * The lowest address the hypervisor hole can begin at (numeric).
  131. *
  132. * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
  133. * also indicates to the hypervisor that the kernel can deal with the
  134. * hole starting at a higher address.
  135. */
  136. #define XEN_ELFNOTE_HV_START_LOW 12
  137. /*
  138. * List of maddr_t-sized mask/value pairs describing how to recognize
  139. * (non-present) L1 page table entries carrying valid MFNs (numeric).
  140. */
  141. #define XEN_ELFNOTE_L1_MFN_VALID 13
  142. /*
  143. * Whether or not the guest supports cooperative suspend cancellation.
  144. */
  145. #define XEN_ELFNOTE_SUSPEND_CANCEL 14
  146. /*
  147. * The number of the highest elfnote defined.
  148. */
  149. #define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL
  150. /*
  151. * System information exported through crash notes.
  152. *
  153. * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
  154. * note in case of a system crash. This note will contain various
  155. * information about the system, see xen/include/xen/elfcore.h.
  156. */
  157. #define XEN_ELFNOTE_CRASH_INFO 0x1000001
  158. /*
  159. * System registers exported through crash notes.
  160. *
  161. * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
  162. * note per cpu in case of a system crash. This note is architecture
  163. * specific and will contain registers not saved in the "CORE" note.
  164. * See xen/include/xen/elfcore.h for more information.
  165. */
  166. #define XEN_ELFNOTE_CRASH_REGS 0x1000002
  167. /*
  168. * xen dump-core none note.
  169. * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
  170. * in its dump file to indicate that the file is xen dump-core
  171. * file. This note doesn't have any other information.
  172. * See tools/libxc/xc_core.h for more information.
  173. */
  174. #define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000
  175. /*
  176. * xen dump-core header note.
  177. * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
  178. * in its dump file.
  179. * See tools/libxc/xc_core.h for more information.
  180. */
  181. #define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001
  182. /*
  183. * xen dump-core xen version note.
  184. * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
  185. * in its dump file. It contains the xen version obtained via the
  186. * XENVER hypercall.
  187. * See tools/libxc/xc_core.h for more information.
  188. */
  189. #define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002
  190. /*
  191. * xen dump-core format version note.
  192. * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
  193. * in its dump file. It contains a format version identifier.
  194. * See tools/libxc/xc_core.h for more information.
  195. */
  196. #define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003
  197. #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
  198. /*
  199. * Local variables:
  200. * mode: C
  201. * c-set-style: "BSD"
  202. * c-basic-offset: 4
  203. * tab-width: 4
  204. * indent-tabs-mode: nil
  205. * End:
  206. */