elfnote.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* SPDX-License-Identifier: MIT */
  2. /******************************************************************************
  3. * elfnote.h
  4. *
  5. * Definitions used for the Xen ELF notes.
  6. *
  7. * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
  8. */
  9. #ifndef __XEN_PUBLIC_ELFNOTE_H__
  10. #define __XEN_PUBLIC_ELFNOTE_H__
  11. /*
  12. * The notes should live in a SHT_NOTE segment and have "Xen" in the
  13. * name field.
  14. *
  15. * Numeric types are either 4 or 8 bytes depending on the content of
  16. * the desc field.
  17. *
  18. * LEGACY indicated the fields in the legacy __xen_guest string which
  19. * this a note type replaces.
  20. *
  21. * String values (for non-legacy) are NULL terminated ASCII, also known
  22. * as ASCIZ type.
  23. */
  24. /*
  25. * NAME=VALUE pair (string).
  26. */
  27. #define XEN_ELFNOTE_INFO 0
  28. /*
  29. * The virtual address of the entry point (numeric).
  30. *
  31. * LEGACY: VIRT_ENTRY
  32. */
  33. #define XEN_ELFNOTE_ENTRY 1
  34. /* The virtual address of the hypercall transfer page (numeric).
  35. *
  36. * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
  37. * number not a virtual address)
  38. */
  39. #define XEN_ELFNOTE_HYPERCALL_PAGE 2
  40. /* The virtual address where the kernel image should be mapped (numeric).
  41. *
  42. * Defaults to 0.
  43. *
  44. * LEGACY: VIRT_BASE
  45. */
  46. #define XEN_ELFNOTE_VIRT_BASE 3
  47. /*
  48. * The offset of the ELF paddr field from the acutal required
  49. * pseudo-physical address (numeric).
  50. *
  51. * This is used to maintain backwards compatibility with older kernels
  52. * which wrote __PAGE_OFFSET into that field. This field defaults to 0
  53. * if not present.
  54. *
  55. * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
  56. */
  57. #define XEN_ELFNOTE_PADDR_OFFSET 4
  58. /*
  59. * The version of Xen that we work with (string).
  60. *
  61. * LEGACY: XEN_VER
  62. */
  63. #define XEN_ELFNOTE_XEN_VERSION 5
  64. /*
  65. * The name of the guest operating system (string).
  66. *
  67. * LEGACY: GUEST_OS
  68. */
  69. #define XEN_ELFNOTE_GUEST_OS 6
  70. /*
  71. * The version of the guest operating system (string).
  72. *
  73. * LEGACY: GUEST_VER
  74. */
  75. #define XEN_ELFNOTE_GUEST_VERSION 7
  76. /*
  77. * The loader type (string).
  78. *
  79. * LEGACY: LOADER
  80. */
  81. #define XEN_ELFNOTE_LOADER 8
  82. /*
  83. * The kernel supports PAE (x86/32 only, string = "yes" or "no").
  84. *
  85. * LEGACY: PAE (n.b. The legacy interface included a provision to
  86. * indicate 'extended-cr3' support allowing L3 page tables to be
  87. * placed above 4G. It is assumed that any kernel new enough to use
  88. * these ELF notes will include this and therefore "yes" here is
  89. * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
  90. */
  91. #define XEN_ELFNOTE_PAE_MODE 9
  92. /*
  93. * The features supported/required by this kernel (string).
  94. *
  95. * The string must consist of a list of feature names (as given in
  96. * features.h, without the "XENFEAT_" prefix) separated by '|'
  97. * characters. If a feature is required for the kernel to function
  98. * then the feature name must be preceded by a '!' character.
  99. *
  100. * LEGACY: FEATURES
  101. */
  102. #define XEN_ELFNOTE_FEATURES 10
  103. /*
  104. * The kernel requires the symbol table to be loaded (string = "yes" or "no")
  105. * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
  106. * of this string as a boolean flag rather than requiring "yes" or
  107. * "no".
  108. */
  109. #define XEN_ELFNOTE_BSD_SYMTAB 11
  110. /*
  111. * The lowest address the hypervisor hole can begin at (numeric).
  112. *
  113. * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
  114. * also indicates to the hypervisor that the kernel can deal with the
  115. * hole starting at a higher address.
  116. */
  117. #define XEN_ELFNOTE_HV_START_LOW 12
  118. /*
  119. * List of maddr_t-sized mask/value pairs describing how to recognize
  120. * (non-present) L1 page table entries carrying valid MFNs (numeric).
  121. */
  122. #define XEN_ELFNOTE_L1_MFN_VALID 13
  123. /*
  124. * Whether or not the guest supports cooperative suspend cancellation.
  125. * This is a numeric value.
  126. *
  127. * Default is 0
  128. */
  129. #define XEN_ELFNOTE_SUSPEND_CANCEL 14
  130. /*
  131. * The (non-default) location the initial phys-to-machine map should be
  132. * placed at by the hypervisor (Dom0) or the tools (DomU).
  133. * The kernel must be prepared for this mapping to be established using
  134. * large pages, despite such otherwise not being available to guests.
  135. * The kernel must also be able to handle the page table pages used for
  136. * this mapping not being accessible through the initial mapping.
  137. * (Only x86-64 supports this at present.)
  138. */
  139. #define XEN_ELFNOTE_INIT_P2M 15
  140. /*
  141. * Whether or not the guest can deal with being passed an initrd not
  142. * mapped through its initial page tables.
  143. */
  144. #define XEN_ELFNOTE_MOD_START_PFN 16
  145. /*
  146. * The features supported by this kernel (numeric).
  147. *
  148. * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a
  149. * kernel to specify support for features that older hypervisors don't
  150. * know about. The set of features 4.2 and newer hypervisors will
  151. * consider supported by the kernel is the combination of the sets
  152. * specified through this and the string note.
  153. *
  154. * LEGACY: FEATURES
  155. */
  156. #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
  157. /*
  158. * Physical entry point into the kernel.
  159. *
  160. * 32bit entry point into the kernel. When requested to launch the
  161. * guest kernel in a HVM container, Xen will use this entry point to
  162. * launch the guest in 32bit protected mode with paging disabled.
  163. * Ignored otherwise.
  164. */
  165. #define XEN_ELFNOTE_PHYS32_ENTRY 18
  166. /*
  167. * The number of the highest elfnote defined.
  168. */
  169. #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
  170. #endif /* __XEN_PUBLIC_ELFNOTE_H__ */