18c2ecf20Sopenharmony_ci/******************************************************************************
28c2ecf20Sopenharmony_ci * elfnote.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Definitions used for the Xen ELF notes.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
78c2ecf20Sopenharmony_ci * of this software and associated documentation files (the "Software"), to
88c2ecf20Sopenharmony_ci * deal in the Software without restriction, including without limitation the
98c2ecf20Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
108c2ecf20Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is
118c2ecf20Sopenharmony_ci * furnished to do so, subject to the following conditions:
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
148c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
178c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
198c2ecf20Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
208c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
218c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
228c2ecf20Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#ifndef __XEN_PUBLIC_ELFNOTE_H__
288c2ecf20Sopenharmony_ci#define __XEN_PUBLIC_ELFNOTE_H__
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/*
318c2ecf20Sopenharmony_ci * The notes should live in a SHT_NOTE segment and have "Xen" in the
328c2ecf20Sopenharmony_ci * name field.
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * Numeric types are either 4 or 8 bytes depending on the content of
358c2ecf20Sopenharmony_ci * the desc field.
368c2ecf20Sopenharmony_ci *
378c2ecf20Sopenharmony_ci * LEGACY indicated the fields in the legacy __xen_guest string which
388c2ecf20Sopenharmony_ci * this a note type replaces.
398c2ecf20Sopenharmony_ci *
408c2ecf20Sopenharmony_ci * String values (for non-legacy) are NULL terminated ASCII, also known
418c2ecf20Sopenharmony_ci * as ASCIZ type.
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/*
458c2ecf20Sopenharmony_ci * NAME=VALUE pair (string).
468c2ecf20Sopenharmony_ci */
478c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_INFO           0
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/*
508c2ecf20Sopenharmony_ci * The virtual address of the entry point (numeric).
518c2ecf20Sopenharmony_ci *
528c2ecf20Sopenharmony_ci * LEGACY: VIRT_ENTRY
538c2ecf20Sopenharmony_ci */
548c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_ENTRY          1
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* The virtual address of the hypercall transfer page (numeric).
578c2ecf20Sopenharmony_ci *
588c2ecf20Sopenharmony_ci * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
598c2ecf20Sopenharmony_ci * number not a virtual address)
608c2ecf20Sopenharmony_ci */
618c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_HYPERCALL_PAGE 2
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/* The virtual address where the kernel image should be mapped (numeric).
648c2ecf20Sopenharmony_ci *
658c2ecf20Sopenharmony_ci * Defaults to 0.
668c2ecf20Sopenharmony_ci *
678c2ecf20Sopenharmony_ci * LEGACY: VIRT_BASE
688c2ecf20Sopenharmony_ci */
698c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_VIRT_BASE      3
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci/*
728c2ecf20Sopenharmony_ci * The offset of the ELF paddr field from the acutal required
738c2ecf20Sopenharmony_ci * pseudo-physical address (numeric).
748c2ecf20Sopenharmony_ci *
758c2ecf20Sopenharmony_ci * This is used to maintain backwards compatibility with older kernels
768c2ecf20Sopenharmony_ci * which wrote __PAGE_OFFSET into that field. This field defaults to 0
778c2ecf20Sopenharmony_ci * if not present.
788c2ecf20Sopenharmony_ci *
798c2ecf20Sopenharmony_ci * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
808c2ecf20Sopenharmony_ci */
818c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_PADDR_OFFSET   4
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/*
848c2ecf20Sopenharmony_ci * The version of Xen that we work with (string).
858c2ecf20Sopenharmony_ci *
868c2ecf20Sopenharmony_ci * LEGACY: XEN_VER
878c2ecf20Sopenharmony_ci */
888c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_XEN_VERSION    5
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/*
918c2ecf20Sopenharmony_ci * The name of the guest operating system (string).
928c2ecf20Sopenharmony_ci *
938c2ecf20Sopenharmony_ci * LEGACY: GUEST_OS
948c2ecf20Sopenharmony_ci */
958c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_GUEST_OS       6
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/*
988c2ecf20Sopenharmony_ci * The version of the guest operating system (string).
998c2ecf20Sopenharmony_ci *
1008c2ecf20Sopenharmony_ci * LEGACY: GUEST_VER
1018c2ecf20Sopenharmony_ci */
1028c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_GUEST_VERSION  7
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/*
1058c2ecf20Sopenharmony_ci * The loader type (string).
1068c2ecf20Sopenharmony_ci *
1078c2ecf20Sopenharmony_ci * LEGACY: LOADER
1088c2ecf20Sopenharmony_ci */
1098c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_LOADER         8
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/*
1128c2ecf20Sopenharmony_ci * The kernel supports PAE (x86/32 only, string = "yes" or "no").
1138c2ecf20Sopenharmony_ci *
1148c2ecf20Sopenharmony_ci * LEGACY: PAE (n.b. The legacy interface included a provision to
1158c2ecf20Sopenharmony_ci * indicate 'extended-cr3' support allowing L3 page tables to be
1168c2ecf20Sopenharmony_ci * placed above 4G. It is assumed that any kernel new enough to use
1178c2ecf20Sopenharmony_ci * these ELF notes will include this and therefore "yes" here is
1188c2ecf20Sopenharmony_ci * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
1198c2ecf20Sopenharmony_ci */
1208c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_PAE_MODE       9
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci/*
1238c2ecf20Sopenharmony_ci * The features supported/required by this kernel (string).
1248c2ecf20Sopenharmony_ci *
1258c2ecf20Sopenharmony_ci * The string must consist of a list of feature names (as given in
1268c2ecf20Sopenharmony_ci * features.h, without the "XENFEAT_" prefix) separated by '|'
1278c2ecf20Sopenharmony_ci * characters. If a feature is required for the kernel to function
1288c2ecf20Sopenharmony_ci * then the feature name must be preceded by a '!' character.
1298c2ecf20Sopenharmony_ci *
1308c2ecf20Sopenharmony_ci * LEGACY: FEATURES
1318c2ecf20Sopenharmony_ci */
1328c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_FEATURES      10
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/*
1358c2ecf20Sopenharmony_ci * The kernel requires the symbol table to be loaded (string = "yes" or "no")
1368c2ecf20Sopenharmony_ci * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
1378c2ecf20Sopenharmony_ci * of this string as a boolean flag rather than requiring "yes" or
1388c2ecf20Sopenharmony_ci * "no".
1398c2ecf20Sopenharmony_ci */
1408c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_BSD_SYMTAB    11
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci/*
1438c2ecf20Sopenharmony_ci * The lowest address the hypervisor hole can begin at (numeric).
1448c2ecf20Sopenharmony_ci *
1458c2ecf20Sopenharmony_ci * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
1468c2ecf20Sopenharmony_ci * also indicates to the hypervisor that the kernel can deal with the
1478c2ecf20Sopenharmony_ci * hole starting at a higher address.
1488c2ecf20Sopenharmony_ci */
1498c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_HV_START_LOW  12
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci/*
1528c2ecf20Sopenharmony_ci * List of maddr_t-sized mask/value pairs describing how to recognize
1538c2ecf20Sopenharmony_ci * (non-present) L1 page table entries carrying valid MFNs (numeric).
1548c2ecf20Sopenharmony_ci */
1558c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_L1_MFN_VALID  13
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/*
1588c2ecf20Sopenharmony_ci * Whether or not the guest supports cooperative suspend cancellation.
1598c2ecf20Sopenharmony_ci * This is a numeric value.
1608c2ecf20Sopenharmony_ci *
1618c2ecf20Sopenharmony_ci * Default is 0
1628c2ecf20Sopenharmony_ci */
1638c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_SUSPEND_CANCEL 14
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci/*
1668c2ecf20Sopenharmony_ci * The (non-default) location the initial phys-to-machine map should be
1678c2ecf20Sopenharmony_ci * placed at by the hypervisor (Dom0) or the tools (DomU).
1688c2ecf20Sopenharmony_ci * The kernel must be prepared for this mapping to be established using
1698c2ecf20Sopenharmony_ci * large pages, despite such otherwise not being available to guests.
1708c2ecf20Sopenharmony_ci * The kernel must also be able to handle the page table pages used for
1718c2ecf20Sopenharmony_ci * this mapping not being accessible through the initial mapping.
1728c2ecf20Sopenharmony_ci * (Only x86-64 supports this at present.)
1738c2ecf20Sopenharmony_ci */
1748c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_INIT_P2M      15
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci/*
1778c2ecf20Sopenharmony_ci * Whether or not the guest can deal with being passed an initrd not
1788c2ecf20Sopenharmony_ci * mapped through its initial page tables.
1798c2ecf20Sopenharmony_ci */
1808c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_MOD_START_PFN 16
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci/*
1838c2ecf20Sopenharmony_ci * The features supported by this kernel (numeric).
1848c2ecf20Sopenharmony_ci *
1858c2ecf20Sopenharmony_ci * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a
1868c2ecf20Sopenharmony_ci * kernel to specify support for features that older hypervisors don't
1878c2ecf20Sopenharmony_ci * know about. The set of features 4.2 and newer hypervisors will
1888c2ecf20Sopenharmony_ci * consider supported by the kernel is the combination of the sets
1898c2ecf20Sopenharmony_ci * specified through this and the string note.
1908c2ecf20Sopenharmony_ci *
1918c2ecf20Sopenharmony_ci * LEGACY: FEATURES
1928c2ecf20Sopenharmony_ci */
1938c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_SUPPORTED_FEATURES 17
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci/*
1968c2ecf20Sopenharmony_ci * Physical entry point into the kernel.
1978c2ecf20Sopenharmony_ci *
1988c2ecf20Sopenharmony_ci * 32bit entry point into the kernel. When requested to launch the
1998c2ecf20Sopenharmony_ci * guest kernel in a HVM container, Xen will use this entry point to
2008c2ecf20Sopenharmony_ci * launch the guest in 32bit protected mode with paging disabled.
2018c2ecf20Sopenharmony_ci * Ignored otherwise.
2028c2ecf20Sopenharmony_ci */
2038c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_PHYS32_ENTRY 18
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci/*
2068c2ecf20Sopenharmony_ci * The number of the highest elfnote defined.
2078c2ecf20Sopenharmony_ci */
2088c2ecf20Sopenharmony_ci#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci/*
2138c2ecf20Sopenharmony_ci * Local variables:
2148c2ecf20Sopenharmony_ci * mode: C
2158c2ecf20Sopenharmony_ci * c-set-style: "BSD"
2168c2ecf20Sopenharmony_ci * c-basic-offset: 4
2178c2ecf20Sopenharmony_ci * tab-width: 4
2188c2ecf20Sopenharmony_ci * indent-tabs-mode: nil
2198c2ecf20Sopenharmony_ci * End:
2208c2ecf20Sopenharmony_ci */
221