15084Sjohnlev /****************************************************************************** 25084Sjohnlev * elfnote.h 35084Sjohnlev * 45084Sjohnlev * Definitions used for the Xen ELF notes. 55084Sjohnlev * 65084Sjohnlev * Permission is hereby granted, free of charge, to any person obtaining a copy 75084Sjohnlev * of this software and associated documentation files (the "Software"), to 85084Sjohnlev * deal in the Software without restriction, including without limitation the 95084Sjohnlev * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 105084Sjohnlev * sell copies of the Software, and to permit persons to whom the Software is 115084Sjohnlev * furnished to do so, subject to the following conditions: 125084Sjohnlev * 135084Sjohnlev * The above copyright notice and this permission notice shall be included in 145084Sjohnlev * all copies or substantial portions of the Software. 155084Sjohnlev * 165084Sjohnlev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 175084Sjohnlev * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 185084Sjohnlev * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 195084Sjohnlev * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 205084Sjohnlev * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 215084Sjohnlev * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 225084Sjohnlev * DEALINGS IN THE SOFTWARE. 235084Sjohnlev * 245084Sjohnlev * Copyright (c) 2006, Ian Campbell, XenSource Ltd. 255084Sjohnlev */ 265084Sjohnlev 275084Sjohnlev #ifndef __XEN_PUBLIC_ELFNOTE_H__ 285084Sjohnlev #define __XEN_PUBLIC_ELFNOTE_H__ 295084Sjohnlev 305084Sjohnlev /* 316144Srab * The notes should live in a PT_NOTE segment and have "Xen" in the 325084Sjohnlev * name field. 335084Sjohnlev * 345084Sjohnlev * Numeric types are either 4 or 8 bytes depending on the content of 355084Sjohnlev * the desc field. 365084Sjohnlev * 375084Sjohnlev * LEGACY indicated the fields in the legacy __xen_guest string which 385084Sjohnlev * this a note type replaces. 395084Sjohnlev */ 405084Sjohnlev 415084Sjohnlev /* 425084Sjohnlev * NAME=VALUE pair (string). 435084Sjohnlev */ 445084Sjohnlev #define XEN_ELFNOTE_INFO 0 455084Sjohnlev 465084Sjohnlev /* 475084Sjohnlev * The virtual address of the entry point (numeric). 485084Sjohnlev * 495084Sjohnlev * LEGACY: VIRT_ENTRY 505084Sjohnlev */ 515084Sjohnlev #define XEN_ELFNOTE_ENTRY 1 525084Sjohnlev 535084Sjohnlev /* The virtual address of the hypercall transfer page (numeric). 545084Sjohnlev * 555084Sjohnlev * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page 565084Sjohnlev * number not a virtual address) 575084Sjohnlev */ 585084Sjohnlev #define XEN_ELFNOTE_HYPERCALL_PAGE 2 595084Sjohnlev 605084Sjohnlev /* The virtual address where the kernel image should be mapped (numeric). 615084Sjohnlev * 625084Sjohnlev * Defaults to 0. 635084Sjohnlev * 645084Sjohnlev * LEGACY: VIRT_BASE 655084Sjohnlev */ 665084Sjohnlev #define XEN_ELFNOTE_VIRT_BASE 3 675084Sjohnlev 685084Sjohnlev /* 695084Sjohnlev * The offset of the ELF paddr field from the acutal required 705084Sjohnlev * psuedo-physical address (numeric). 715084Sjohnlev * 725084Sjohnlev * This is used to maintain backwards compatibility with older kernels 735084Sjohnlev * which wrote __PAGE_OFFSET into that field. This field defaults to 0 745084Sjohnlev * if not present. 755084Sjohnlev * 765084Sjohnlev * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE) 775084Sjohnlev */ 785084Sjohnlev #define XEN_ELFNOTE_PADDR_OFFSET 4 795084Sjohnlev 805084Sjohnlev /* 815084Sjohnlev * The version of Xen that we work with (string). 825084Sjohnlev * 835084Sjohnlev * LEGACY: XEN_VER 845084Sjohnlev */ 855084Sjohnlev #define XEN_ELFNOTE_XEN_VERSION 5 865084Sjohnlev 875084Sjohnlev /* 885084Sjohnlev * The name of the guest operating system (string). 895084Sjohnlev * 905084Sjohnlev * LEGACY: GUEST_OS 915084Sjohnlev */ 925084Sjohnlev #define XEN_ELFNOTE_GUEST_OS 6 935084Sjohnlev 945084Sjohnlev /* 955084Sjohnlev * The version of the guest operating system (string). 965084Sjohnlev * 975084Sjohnlev * LEGACY: GUEST_VER 985084Sjohnlev */ 995084Sjohnlev #define XEN_ELFNOTE_GUEST_VERSION 7 1005084Sjohnlev 1015084Sjohnlev /* 1025084Sjohnlev * The loader type (string). 1035084Sjohnlev * 1045084Sjohnlev * LEGACY: LOADER 1055084Sjohnlev */ 1065084Sjohnlev #define XEN_ELFNOTE_LOADER 8 1075084Sjohnlev 1085084Sjohnlev /* 1096144Srab * The kernel supports PAE (x86/32 only, string = "yes", "no" or 1106144Srab * "bimodal"). 1116144Srab * 1126144Srab * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting 1136144Srab * may be given as "yes,bimodal" which will cause older Xen to treat 1146144Srab * this kernel as PAE. 1155084Sjohnlev * 1165084Sjohnlev * LEGACY: PAE (n.b. The legacy interface included a provision to 1175084Sjohnlev * indicate 'extended-cr3' support allowing L3 page tables to be 1185084Sjohnlev * placed above 4G. It is assumed that any kernel new enough to use 1195084Sjohnlev * these ELF notes will include this and therefore "yes" here is 1205084Sjohnlev * equivalent to "yes[entended-cr3]" in the __xen_guest interface. 1215084Sjohnlev */ 1225084Sjohnlev #define XEN_ELFNOTE_PAE_MODE 9 1235084Sjohnlev 1245084Sjohnlev /* 1255084Sjohnlev * The features supported/required by this kernel (string). 1265084Sjohnlev * 1275084Sjohnlev * The string must consist of a list of feature names (as given in 1285084Sjohnlev * features.h, without the "XENFEAT_" prefix) separated by '|' 1295084Sjohnlev * characters. If a feature is required for the kernel to function 1305084Sjohnlev * then the feature name must be preceded by a '!' character. 1315084Sjohnlev * 1325084Sjohnlev * LEGACY: FEATURES 1335084Sjohnlev */ 1345084Sjohnlev #define XEN_ELFNOTE_FEATURES 10 1355084Sjohnlev 1365084Sjohnlev /* 1375084Sjohnlev * The kernel requires the symbol table to be loaded (string = "yes" or "no") 1385084Sjohnlev * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence 1395084Sjohnlev * of this string as a boolean flag rather than requiring "yes" or 1405084Sjohnlev * "no". 1415084Sjohnlev */ 1425084Sjohnlev #define XEN_ELFNOTE_BSD_SYMTAB 11 1435084Sjohnlev 1445084Sjohnlev /* 1455084Sjohnlev * The lowest address the hypervisor hole can begin at (numeric). 1465084Sjohnlev * 1475084Sjohnlev * This must not be set higher than HYPERVISOR_VIRT_START. Its presence 1485084Sjohnlev * also indicates to the hypervisor that the kernel can deal with the 1495084Sjohnlev * hole starting at a higher address. 1505084Sjohnlev */ 1515084Sjohnlev #define XEN_ELFNOTE_HV_START_LOW 12 1525084Sjohnlev 1535084Sjohnlev /* 1546144Srab * List of maddr_t-sized mask/value pairs describing how to recognize 1556144Srab * (non-present) L1 page table entries carrying valid MFNs (numeric). 1566144Srab */ 1576144Srab #define XEN_ELFNOTE_L1_MFN_VALID 13 1586144Srab 1596144Srab /* 1606144Srab * Whether or not the guest supports cooperative suspend cancellation. 1616144Srab */ 1626144Srab #define XEN_ELFNOTE_SUSPEND_CANCEL 14 1636144Srab 1646144Srab /* 165*11120SMark.Johnson@Sun.COM * The (non-default) location the initial phys-to-machine map should be 166*11120SMark.Johnson@Sun.COM * placed at by the hypervisor (Dom0) or the tools (DomU). 167*11120SMark.Johnson@Sun.COM * The kernel must be prepared for this mapping to be established using 168*11120SMark.Johnson@Sun.COM * large pages, despite such otherwise not being available to guests. 169*11120SMark.Johnson@Sun.COM * The kernel must also be able to handle the page table pages used for 170*11120SMark.Johnson@Sun.COM * this mapping not being accessible through the initial mapping. 171*11120SMark.Johnson@Sun.COM * (Only x86-64 supports this at present.) 172*11120SMark.Johnson@Sun.COM */ 173*11120SMark.Johnson@Sun.COM #define XEN_ELFNOTE_INIT_P2M 15 174*11120SMark.Johnson@Sun.COM 175*11120SMark.Johnson@Sun.COM /* 1766144Srab * The number of the highest elfnote defined. 1776144Srab */ 178*11120SMark.Johnson@Sun.COM #define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M 1796144Srab 1806144Srab /* 1815084Sjohnlev * System information exported through crash notes. 1825084Sjohnlev * 1835084Sjohnlev * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO 1845084Sjohnlev * note in case of a system crash. This note will contain various 1855084Sjohnlev * information about the system, see xen/include/xen/elfcore.h. 1865084Sjohnlev */ 1875084Sjohnlev #define XEN_ELFNOTE_CRASH_INFO 0x1000001 1885084Sjohnlev 1895084Sjohnlev /* 1905084Sjohnlev * System registers exported through crash notes. 1915084Sjohnlev * 1925084Sjohnlev * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS 1935084Sjohnlev * note per cpu in case of a system crash. This note is architecture 1945084Sjohnlev * specific and will contain registers not saved in the "CORE" note. 1955084Sjohnlev * See xen/include/xen/elfcore.h for more information. 1965084Sjohnlev */ 1975084Sjohnlev #define XEN_ELFNOTE_CRASH_REGS 0x1000002 1985084Sjohnlev 1996144Srab 2006144Srab /* 2016144Srab * xen dump-core none note. 2026144Srab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE 2036144Srab * in its dump file to indicate that the file is xen dump-core 2046144Srab * file. This note doesn't have any other information. 2056144Srab * See tools/libxc/xc_core.h for more information. 2066144Srab */ 2076144Srab #define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000 2086144Srab 2096144Srab /* 2106144Srab * xen dump-core header note. 2116144Srab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER 2126144Srab * in its dump file. 2136144Srab * See tools/libxc/xc_core.h for more information. 2146144Srab */ 2156144Srab #define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001 2166144Srab 2176144Srab /* 2186144Srab * xen dump-core xen version note. 2196144Srab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION 2206144Srab * in its dump file. It contains the xen version obtained via the 2216144Srab * XENVER hypercall. 2226144Srab * See tools/libxc/xc_core.h for more information. 2236144Srab */ 2246144Srab #define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002 2256144Srab 2266144Srab /* 2276144Srab * xen dump-core format version note. 2286144Srab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 2296144Srab * in its dump file. It contains a format version identifier. 2306144Srab * See tools/libxc/xc_core.h for more information. 2316144Srab */ 2326144Srab #define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003 2336144Srab 2345084Sjohnlev #endif /* __XEN_PUBLIC_ELFNOTE_H__ */ 2355084Sjohnlev 2365084Sjohnlev /* 2375084Sjohnlev * Local variables: 2385084Sjohnlev * mode: C 2395084Sjohnlev * c-set-style: "BSD" 2405084Sjohnlev * c-basic-offset: 4 2415084Sjohnlev * tab-width: 4 2425084Sjohnlev * indent-tabs-mode: nil 2435084Sjohnlev * End: 2445084Sjohnlev */ 245