Home | History | Annotate | Line # | Download | only in public
      1  1.1  cherry /******************************************************************************
      2  1.1  cherry  * elfnote.h
      3  1.1  cherry  *
      4  1.1  cherry  * Definitions used for the Xen ELF notes.
      5  1.1  cherry  *
      6  1.1  cherry  * Permission is hereby granted, free of charge, to any person obtaining a copy
      7  1.1  cherry  * of this software and associated documentation files (the "Software"), to
      8  1.1  cherry  * deal in the Software without restriction, including without limitation the
      9  1.1  cherry  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     10  1.1  cherry  * sell copies of the Software, and to permit persons to whom the Software is
     11  1.1  cherry  * furnished to do so, subject to the following conditions:
     12  1.1  cherry  *
     13  1.1  cherry  * The above copyright notice and this permission notice shall be included in
     14  1.1  cherry  * all copies or substantial portions of the Software.
     15  1.1  cherry  *
     16  1.1  cherry  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  1.1  cherry  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  1.1  cherry  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     19  1.1  cherry  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     20  1.1  cherry  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     21  1.1  cherry  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     22  1.1  cherry  * DEALINGS IN THE SOFTWARE.
     23  1.1  cherry  *
     24  1.1  cherry  * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
     25  1.1  cherry  */
     26  1.1  cherry 
     27  1.1  cherry #ifndef __XEN_PUBLIC_ELFNOTE_H__
     28  1.1  cherry #define __XEN_PUBLIC_ELFNOTE_H__
     29  1.1  cherry 
     30  1.1  cherry /*
     31  1.1  cherry  * `incontents 200 elfnotes ELF notes
     32  1.1  cherry  *
     33  1.1  cherry  * The notes should live in a PT_NOTE segment and have "Xen" in the
     34  1.1  cherry  * name field.
     35  1.1  cherry  *
     36  1.1  cherry  * Numeric types are either 4 or 8 bytes depending on the content of
     37  1.1  cherry  * the desc field.
     38  1.1  cherry  *
     39  1.1  cherry  * LEGACY indicated the fields in the legacy __xen_guest string which
     40  1.1  cherry  * this a note type replaces.
     41  1.1  cherry  *
     42  1.1  cherry  * String values (for non-legacy) are NULL terminated ASCII, also known
     43  1.1  cherry  * as ASCIZ type.
     44  1.1  cherry  */
     45  1.1  cherry 
     46  1.1  cherry /*
     47  1.1  cherry  * NAME=VALUE pair (string).
     48  1.1  cherry  */
     49  1.1  cherry #define XEN_ELFNOTE_INFO           0
     50  1.1  cherry 
     51  1.1  cherry /*
     52  1.1  cherry  * The virtual address of the entry point (numeric).
     53  1.1  cherry  *
     54  1.1  cherry  * LEGACY: VIRT_ENTRY
     55  1.1  cherry  */
     56  1.1  cherry #define XEN_ELFNOTE_ENTRY          1
     57  1.1  cherry 
     58  1.1  cherry /* The virtual address of the hypercall transfer page (numeric).
     59  1.1  cherry  *
     60  1.1  cherry  * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
     61  1.1  cherry  * number not a virtual address)
     62  1.1  cherry  */
     63  1.1  cherry #define XEN_ELFNOTE_HYPERCALL_PAGE 2
     64  1.1  cherry 
     65  1.1  cherry /* The virtual address where the kernel image should be mapped (numeric).
     66  1.1  cherry  *
     67  1.1  cherry  * Defaults to 0.
     68  1.1  cherry  *
     69  1.1  cherry  * LEGACY: VIRT_BASE
     70  1.1  cherry  */
     71  1.1  cherry #define XEN_ELFNOTE_VIRT_BASE      3
     72  1.1  cherry 
     73  1.1  cherry /*
     74  1.1  cherry  * The offset of the ELF paddr field from the actual required
     75  1.1  cherry  * pseudo-physical address (numeric).
     76  1.1  cherry  *
     77  1.1  cherry  * This is used to maintain backwards compatibility with older kernels
     78  1.1  cherry  * which wrote __PAGE_OFFSET into that field. This field defaults to 0
     79  1.1  cherry  * if not present.
     80  1.1  cherry  *
     81  1.1  cherry  * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
     82  1.1  cherry  */
     83  1.1  cherry #define XEN_ELFNOTE_PADDR_OFFSET   4
     84  1.1  cherry 
     85  1.1  cherry /*
     86  1.1  cherry  * The version of Xen that we work with (string).
     87  1.1  cherry  *
     88  1.1  cherry  * LEGACY: XEN_VER
     89  1.1  cherry  */
     90  1.1  cherry #define XEN_ELFNOTE_XEN_VERSION    5
     91  1.1  cherry 
     92  1.1  cherry /*
     93  1.1  cherry  * The name of the guest operating system (string).
     94  1.1  cherry  *
     95  1.1  cherry  * LEGACY: GUEST_OS
     96  1.1  cherry  */
     97  1.1  cherry #define XEN_ELFNOTE_GUEST_OS       6
     98  1.1  cherry 
     99  1.1  cherry /*
    100  1.1  cherry  * The version of the guest operating system (string).
    101  1.1  cherry  *
    102  1.1  cherry  * LEGACY: GUEST_VER
    103  1.1  cherry  */
    104  1.1  cherry #define XEN_ELFNOTE_GUEST_VERSION  7
    105  1.1  cherry 
    106  1.1  cherry /*
    107  1.1  cherry  * The loader type (string).
    108  1.1  cherry  *
    109  1.1  cherry  * LEGACY: LOADER
    110  1.1  cherry  */
    111  1.1  cherry #define XEN_ELFNOTE_LOADER         8
    112  1.1  cherry 
    113  1.1  cherry /*
    114  1.1  cherry  * The kernel supports PAE (x86/32 only, string = "yes", "no" or
    115  1.1  cherry  * "bimodal").
    116  1.1  cherry  *
    117  1.1  cherry  * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
    118  1.1  cherry  * may be given as "yes,bimodal" which will cause older Xen to treat
    119  1.1  cherry  * this kernel as PAE.
    120  1.1  cherry  *
    121  1.1  cherry  * LEGACY: PAE (n.b. The legacy interface included a provision to
    122  1.1  cherry  * indicate 'extended-cr3' support allowing L3 page tables to be
    123  1.1  cherry  * placed above 4G. It is assumed that any kernel new enough to use
    124  1.1  cherry  * these ELF notes will include this and therefore "yes" here is
    125  1.1  cherry  * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
    126  1.1  cherry  */
    127  1.1  cherry #define XEN_ELFNOTE_PAE_MODE       9
    128  1.1  cherry 
    129  1.1  cherry /*
    130  1.1  cherry  * The features supported/required by this kernel (string).
    131  1.1  cherry  *
    132  1.1  cherry  * The string must consist of a list of feature names (as given in
    133  1.1  cherry  * features.h, without the "XENFEAT_" prefix) separated by '|'
    134  1.1  cherry  * characters. If a feature is required for the kernel to function
    135  1.1  cherry  * then the feature name must be preceded by a '!' character.
    136  1.1  cherry  *
    137  1.1  cherry  * LEGACY: FEATURES
    138  1.1  cherry  */
    139  1.1  cherry #define XEN_ELFNOTE_FEATURES      10
    140  1.1  cherry 
    141  1.1  cherry /*
    142  1.1  cherry  * The kernel requires the symbol table to be loaded (string = "yes" or "no")
    143  1.1  cherry  * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
    144  1.1  cherry  * of this string as a boolean flag rather than requiring "yes" or
    145  1.1  cherry  * "no".
    146  1.1  cherry  */
    147  1.1  cherry #define XEN_ELFNOTE_BSD_SYMTAB    11
    148  1.1  cherry 
    149  1.1  cherry /*
    150  1.1  cherry  * The lowest address the hypervisor hole can begin at (numeric).
    151  1.1  cherry  *
    152  1.1  cherry  * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
    153  1.1  cherry  * also indicates to the hypervisor that the kernel can deal with the
    154  1.1  cherry  * hole starting at a higher address.
    155  1.1  cherry  */
    156  1.1  cherry #define XEN_ELFNOTE_HV_START_LOW  12
    157  1.1  cherry 
    158  1.1  cherry /*
    159  1.1  cherry  * List of maddr_t-sized mask/value pairs describing how to recognize
    160  1.1  cherry  * (non-present) L1 page table entries carrying valid MFNs (numeric).
    161  1.1  cherry  */
    162  1.1  cherry #define XEN_ELFNOTE_L1_MFN_VALID  13
    163  1.1  cherry 
    164  1.1  cherry /*
    165  1.1  cherry  * Whether or not the guest supports cooperative suspend cancellation.
    166  1.1  cherry  * This is a numeric value.
    167  1.1  cherry  *
    168  1.1  cherry  * Default is 0
    169  1.1  cherry  */
    170  1.1  cherry #define XEN_ELFNOTE_SUSPEND_CANCEL 14
    171  1.1  cherry 
    172  1.1  cherry /*
    173  1.1  cherry  * The (non-default) location the initial phys-to-machine map should be
    174  1.1  cherry  * placed at by the hypervisor (Dom0) or the tools (DomU).
    175  1.1  cherry  * The kernel must be prepared for this mapping to be established using
    176  1.1  cherry  * large pages, despite such otherwise not being available to guests. Note
    177  1.1  cherry  * that these large pages may be misaligned in PFN space (they'll obviously
    178  1.1  cherry  * be aligned in MFN and virtual address spaces).
    179  1.1  cherry  * The kernel must also be able to handle the page table pages used for
    180  1.1  cherry  * this mapping not being accessible through the initial mapping.
    181  1.1  cherry  * (Only x86-64 supports this at present.)
    182  1.1  cherry  */
    183  1.1  cherry #define XEN_ELFNOTE_INIT_P2M      15
    184  1.1  cherry 
    185  1.1  cherry /*
    186  1.1  cherry  * Whether or not the guest can deal with being passed an initrd not
    187  1.1  cherry  * mapped through its initial page tables.
    188  1.1  cherry  */
    189  1.1  cherry #define XEN_ELFNOTE_MOD_START_PFN 16
    190  1.1  cherry 
    191  1.1  cherry /*
    192  1.1  cherry  * The features supported by this kernel (numeric).
    193  1.1  cherry  *
    194  1.1  cherry  * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a
    195  1.1  cherry  * kernel to specify support for features that older hypervisors don't
    196  1.1  cherry  * know about. The set of features 4.2 and newer hypervisors will
    197  1.1  cherry  * consider supported by the kernel is the combination of the sets
    198  1.1  cherry  * specified through this and the string note.
    199  1.1  cherry  *
    200  1.1  cherry  * LEGACY: FEATURES
    201  1.1  cherry  */
    202  1.1  cherry #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
    203  1.1  cherry 
    204  1.1  cherry /*
    205  1.1  cherry  * Physical entry point into the kernel.
    206  1.1  cherry  *
    207  1.1  cherry  * 32bit entry point into the kernel. When requested to launch the
    208  1.1  cherry  * guest kernel in a HVM container, Xen will use this entry point to
    209  1.1  cherry  * launch the guest in 32bit protected mode with paging disabled.
    210  1.1  cherry  * Ignored otherwise.
    211  1.1  cherry  */
    212  1.1  cherry #define XEN_ELFNOTE_PHYS32_ENTRY 18
    213  1.1  cherry 
    214  1.1  cherry /*
    215  1.1  cherry  * The number of the highest elfnote defined.
    216  1.1  cherry  */
    217  1.1  cherry #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
    218  1.1  cherry 
    219  1.1  cherry /*
    220  1.1  cherry  * System information exported through crash notes.
    221  1.1  cherry  *
    222  1.1  cherry  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
    223  1.1  cherry  * note in case of a system crash. This note will contain various
    224  1.1  cherry  * information about the system, see xen/include/xen/elfcore.h.
    225  1.1  cherry  */
    226  1.1  cherry #define XEN_ELFNOTE_CRASH_INFO 0x1000001
    227  1.1  cherry 
    228  1.1  cherry /*
    229  1.1  cherry  * System registers exported through crash notes.
    230  1.1  cherry  *
    231  1.1  cherry  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
    232  1.1  cherry  * note per cpu in case of a system crash. This note is architecture
    233  1.1  cherry  * specific and will contain registers not saved in the "CORE" note.
    234  1.1  cherry  * See xen/include/xen/elfcore.h for more information.
    235  1.1  cherry  */
    236  1.1  cherry #define XEN_ELFNOTE_CRASH_REGS 0x1000002
    237  1.1  cherry 
    238  1.1  cherry 
    239  1.1  cherry /*
    240  1.1  cherry  * xen dump-core none note.
    241  1.1  cherry  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
    242  1.1  cherry  * in its dump file to indicate that the file is xen dump-core
    243  1.1  cherry  * file. This note doesn't have any other information.
    244  1.1  cherry  * See tools/libxc/xc_core.h for more information.
    245  1.1  cherry  */
    246  1.1  cherry #define XEN_ELFNOTE_DUMPCORE_NONE               0x2000000
    247  1.1  cherry 
    248  1.1  cherry /*
    249  1.1  cherry  * xen dump-core header note.
    250  1.1  cherry  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
    251  1.1  cherry  * in its dump file.
    252  1.1  cherry  * See tools/libxc/xc_core.h for more information.
    253  1.1  cherry  */
    254  1.1  cherry #define XEN_ELFNOTE_DUMPCORE_HEADER             0x2000001
    255  1.1  cherry 
    256  1.1  cherry /*
    257  1.1  cherry  * xen dump-core xen version note.
    258  1.1  cherry  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
    259  1.1  cherry  * in its dump file. It contains the xen version obtained via the
    260  1.1  cherry  * XENVER hypercall.
    261  1.1  cherry  * See tools/libxc/xc_core.h for more information.
    262  1.1  cherry  */
    263  1.1  cherry #define XEN_ELFNOTE_DUMPCORE_XEN_VERSION        0x2000002
    264  1.1  cherry 
    265  1.1  cherry /*
    266  1.1  cherry  * xen dump-core format version note.
    267  1.1  cherry  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
    268  1.1  cherry  * in its dump file. It contains a format version identifier.
    269  1.1  cherry  * See tools/libxc/xc_core.h for more information.
    270  1.1  cherry  */
    271  1.1  cherry #define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION     0x2000003
    272  1.1  cherry 
    273  1.1  cherry #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
    274  1.1  cherry 
    275  1.1  cherry /*
    276  1.1  cherry  * Local variables:
    277  1.1  cherry  * mode: C
    278  1.1  cherry  * c-file-style: "BSD"
    279  1.1  cherry  * c-basic-offset: 4
    280  1.1  cherry  * tab-width: 4
    281  1.1  cherry  * indent-tabs-mode: nil
    282  1.1  cherry  * End:
    283  1.1  cherry  */
    284