/* SPDX-License-Identifier: MIT */1/******************************************************************************2* elfnote.h3*4* Definitions used for the Xen ELF notes.5*6* Copyright (c) 2006, Ian Campbell, XenSource Ltd.7*/89#ifndef __XEN_PUBLIC_ELFNOTE_H__10#define __XEN_PUBLIC_ELFNOTE_H__1112/*13* `incontents 200 elfnotes ELF notes14*15* The notes should live in a PT_NOTE segment and have "Xen" in the16* name field.17*18* Numeric types are either 4 or 8 bytes depending on the content of19* the desc field.20*21* LEGACY indicated the fields in the legacy __xen_guest string which22* this a note type replaces.23*24* String values (for non-legacy) are NULL terminated ASCII, also known25* as ASCIZ type.26*27* Xen only uses ELF Notes contained in x86 binaries.28*/2930/*31* NAME=VALUE pair (string).32*/33#define XEN_ELFNOTE_INFO 03435/*36* The virtual address of the entry point (numeric).37*38* LEGACY: VIRT_ENTRY39*/40#define XEN_ELFNOTE_ENTRY 14142/* The virtual address of the hypercall transfer page (numeric).43*44* LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page45* number not a virtual address)46*/47#define XEN_ELFNOTE_HYPERCALL_PAGE 24849/* The virtual address where the kernel image should be mapped (numeric).50*51* Defaults to 0.52*53* LEGACY: VIRT_BASE54*/55#define XEN_ELFNOTE_VIRT_BASE 35657/*58* The offset of the ELF paddr field from the actual required59* pseudo-physical address (numeric).60*61* This is used to maintain backwards compatibility with older kernels62* which wrote __PAGE_OFFSET into that field. This field defaults to 063* if not present.64*65* LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)66*/67#define XEN_ELFNOTE_PADDR_OFFSET 46869/*70* The version of Xen that we work with (string).71*72* LEGACY: XEN_VER73*/74#define XEN_ELFNOTE_XEN_VERSION 57576/*77* The name of the guest operating system (string).78*79* LEGACY: GUEST_OS80*/81#define XEN_ELFNOTE_GUEST_OS 68283/*84* The version of the guest operating system (string).85*86* LEGACY: GUEST_VER87*/88#define XEN_ELFNOTE_GUEST_VERSION 78990/*91* The loader type (string).92*93* LEGACY: LOADER94*/95#define XEN_ELFNOTE_LOADER 89697/*98* The kernel supports PAE (x86/32 only, string = "yes", "no" or99* "bimodal").100*101* For compatibility with Xen 3.0.3 and earlier the "bimodal" setting102* may be given as "yes,bimodal" which will cause older Xen to treat103* this kernel as PAE.104*105* LEGACY: PAE (n.b. The legacy interface included a provision to106* indicate 'extended-cr3' support allowing L3 page tables to be107* placed above 4G. It is assumed that any kernel new enough to use108* these ELF notes will include this and therefore "yes" here is109* equivalent to "yes[entended-cr3]" in the __xen_guest interface.110*/111#define XEN_ELFNOTE_PAE_MODE 9112113/*114* The features supported/required by this kernel (string).115*116* The string must consist of a list of feature names (as given in117* features.h, without the "XENFEAT_" prefix) separated by '|'118* characters. If a feature is required for the kernel to function119* then the feature name must be preceded by a '!' character.120*121* LEGACY: FEATURES122*/123#define XEN_ELFNOTE_FEATURES 10124125/*126* The kernel requires the symbol table to be loaded (string = "yes" or "no")127* LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence128* of this string as a boolean flag rather than requiring "yes" or129* "no".130*/131#define XEN_ELFNOTE_BSD_SYMTAB 11132133/*134* The lowest address the hypervisor hole can begin at (numeric).135*136* This must not be set higher than HYPERVISOR_VIRT_START. Its presence137* also indicates to the hypervisor that the kernel can deal with the138* hole starting at a higher address.139*/140#define XEN_ELFNOTE_HV_START_LOW 12141142/*143* List of maddr_t-sized mask/value pairs describing how to recognize144* (non-present) L1 page table entries carrying valid MFNs (numeric).145*/146#define XEN_ELFNOTE_L1_MFN_VALID 13147148/*149* Whether or not the guest supports cooperative suspend cancellation.150* This is a numeric value.151*152* Default is 0153*/154#define XEN_ELFNOTE_SUSPEND_CANCEL 14155156/*157* The (non-default) location the initial phys-to-machine map should be158* placed at by the hypervisor (Dom0) or the tools (DomU).159* The kernel must be prepared for this mapping to be established using160* large pages, despite such otherwise not being available to guests. Note161* that these large pages may be misaligned in PFN space (they'll obviously162* be aligned in MFN and virtual address spaces).163* The kernel must also be able to handle the page table pages used for164* this mapping not being accessible through the initial mapping.165* (Only x86-64 supports this at present.)166*/167#define XEN_ELFNOTE_INIT_P2M 15168169/*170* Whether or not the guest can deal with being passed an initrd not171* mapped through its initial page tables.172*/173#define XEN_ELFNOTE_MOD_START_PFN 16174175/*176* The features supported by this kernel (numeric).177*178* Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a179* kernel to specify support for features that older hypervisors don't180* know about. The set of features 4.2 and newer hypervisors will181* consider supported by the kernel is the combination of the sets182* specified through this and the string note.183*184* LEGACY: FEATURES185*/186#define XEN_ELFNOTE_SUPPORTED_FEATURES 17187188/*189* Physical entry point into the kernel.190*191* 32bit entry point into the kernel. When requested to launch the192* guest kernel in a HVM container, Xen will use this entry point to193* launch the guest in 32bit protected mode with paging disabled.194* Ignored otherwise.195*/196#define XEN_ELFNOTE_PHYS32_ENTRY 18197198/*199* Physical loading constraints for PVH kernels200*201* The presence of this note indicates the kernel supports relocating itself.202*203* The note may include up to three 32bit values to place constraints on the204* guest physical loading addresses and alignment for a PVH kernel. Values205* are read in the following order:206* - a required start alignment (default 0x200000)207* - a minimum address for the start of the image (default 0; see below)208* - a maximum address for the last byte of the image (default 0xffffffff)209*210* When this note specifies an alignment value, it is used. Otherwise the211* maximum p_align value from loadable ELF Program Headers is used, if it is212* greater than or equal to 4k (0x1000). Otherwise, the default is used.213*/214#define XEN_ELFNOTE_PHYS32_RELOC 19215216/*217* The number of the highest elfnote defined.218*/219#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_RELOC220221/*222* System information exported through crash notes.223*224* The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO225* note in case of a system crash. This note will contain various226* information about the system, see xen/include/xen/elfcore.h.227*/228#define XEN_ELFNOTE_CRASH_INFO 0x1000001229230/*231* System registers exported through crash notes.232*233* The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS234* note per cpu in case of a system crash. This note is architecture235* specific and will contain registers not saved in the "CORE" note.236* See xen/include/xen/elfcore.h for more information.237*/238#define XEN_ELFNOTE_CRASH_REGS 0x1000002239240241/*242* xen dump-core none note.243* xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE244* in its dump file to indicate that the file is xen dump-core245* file. This note doesn't have any other information.246* See tools/libxc/xc_core.h for more information.247*/248#define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000249250/*251* xen dump-core header note.252* xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER253* in its dump file.254* See tools/libxc/xc_core.h for more information.255*/256#define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001257258/*259* xen dump-core xen version note.260* xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION261* in its dump file. It contains the xen version obtained via the262* XENVER hypercall.263* See tools/libxc/xc_core.h for more information.264*/265#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002266267/*268* xen dump-core format version note.269* xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION270* in its dump file. It contains a format version identifier.271* See tools/libxc/xc_core.h for more information.272*/273#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003274275#endif /* __XEN_PUBLIC_ELFNOTE_H__ */276277278