1843e1988Sjohnlev /******************************************************************************
2843e1988Sjohnlev  * elfnote.h
3843e1988Sjohnlev  *
4843e1988Sjohnlev  * Definitions used for the Xen ELF notes.
5843e1988Sjohnlev  *
6843e1988Sjohnlev  * Permission is hereby granted, free of charge, to any person obtaining a copy
7843e1988Sjohnlev  * of this software and associated documentation files (the "Software"), to
8843e1988Sjohnlev  * deal in the Software without restriction, including without limitation the
9843e1988Sjohnlev  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10843e1988Sjohnlev  * sell copies of the Software, and to permit persons to whom the Software is
11843e1988Sjohnlev  * furnished to do so, subject to the following conditions:
12843e1988Sjohnlev  *
13843e1988Sjohnlev  * The above copyright notice and this permission notice shall be included in
14843e1988Sjohnlev  * all copies or substantial portions of the Software.
15843e1988Sjohnlev  *
16843e1988Sjohnlev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17843e1988Sjohnlev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18843e1988Sjohnlev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19843e1988Sjohnlev  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20843e1988Sjohnlev  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21843e1988Sjohnlev  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22843e1988Sjohnlev  * DEALINGS IN THE SOFTWARE.
23843e1988Sjohnlev  *
24843e1988Sjohnlev  * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
25843e1988Sjohnlev  */
26843e1988Sjohnlev 
27843e1988Sjohnlev #ifndef __XEN_PUBLIC_ELFNOTE_H__
28843e1988Sjohnlev #define __XEN_PUBLIC_ELFNOTE_H__
29843e1988Sjohnlev 
30843e1988Sjohnlev /*
31a576ab5bSrab  * The notes should live in a PT_NOTE segment and have "Xen" in the
32843e1988Sjohnlev  * name field.
33843e1988Sjohnlev  *
34843e1988Sjohnlev  * Numeric types are either 4 or 8 bytes depending on the content of
35843e1988Sjohnlev  * the desc field.
36843e1988Sjohnlev  *
37843e1988Sjohnlev  * LEGACY indicated the fields in the legacy __xen_guest string which
38843e1988Sjohnlev  * this a note type replaces.
39843e1988Sjohnlev  */
40843e1988Sjohnlev 
41843e1988Sjohnlev /*
42843e1988Sjohnlev  * NAME=VALUE pair (string).
43843e1988Sjohnlev  */
44843e1988Sjohnlev #define XEN_ELFNOTE_INFO           0
45843e1988Sjohnlev 
46843e1988Sjohnlev /*
47843e1988Sjohnlev  * The virtual address of the entry point (numeric).
48843e1988Sjohnlev  *
49843e1988Sjohnlev  * LEGACY: VIRT_ENTRY
50843e1988Sjohnlev  */
51843e1988Sjohnlev #define XEN_ELFNOTE_ENTRY          1
52843e1988Sjohnlev 
53843e1988Sjohnlev /* The virtual address of the hypercall transfer page (numeric).
54843e1988Sjohnlev  *
55843e1988Sjohnlev  * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
56843e1988Sjohnlev  * number not a virtual address)
57843e1988Sjohnlev  */
58843e1988Sjohnlev #define XEN_ELFNOTE_HYPERCALL_PAGE 2
59843e1988Sjohnlev 
60843e1988Sjohnlev /* The virtual address where the kernel image should be mapped (numeric).
61843e1988Sjohnlev  *
62843e1988Sjohnlev  * Defaults to 0.
63843e1988Sjohnlev  *
64843e1988Sjohnlev  * LEGACY: VIRT_BASE
65843e1988Sjohnlev  */
66843e1988Sjohnlev #define XEN_ELFNOTE_VIRT_BASE      3
67843e1988Sjohnlev 
68843e1988Sjohnlev /*
69843e1988Sjohnlev  * The offset of the ELF paddr field from the acutal required
70843e1988Sjohnlev  * psuedo-physical address (numeric).
71843e1988Sjohnlev  *
72843e1988Sjohnlev  * This is used to maintain backwards compatibility with older kernels
73843e1988Sjohnlev  * which wrote __PAGE_OFFSET into that field. This field defaults to 0
74843e1988Sjohnlev  * if not present.
75843e1988Sjohnlev  *
76843e1988Sjohnlev  * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
77843e1988Sjohnlev  */
78843e1988Sjohnlev #define XEN_ELFNOTE_PADDR_OFFSET   4
79843e1988Sjohnlev 
80843e1988Sjohnlev /*
81843e1988Sjohnlev  * The version of Xen that we work with (string).
82843e1988Sjohnlev  *
83843e1988Sjohnlev  * LEGACY: XEN_VER
84843e1988Sjohnlev  */
85843e1988Sjohnlev #define XEN_ELFNOTE_XEN_VERSION    5
86843e1988Sjohnlev 
87843e1988Sjohnlev /*
88843e1988Sjohnlev  * The name of the guest operating system (string).
89843e1988Sjohnlev  *
90843e1988Sjohnlev  * LEGACY: GUEST_OS
91843e1988Sjohnlev  */
92843e1988Sjohnlev #define XEN_ELFNOTE_GUEST_OS       6
93843e1988Sjohnlev 
94843e1988Sjohnlev /*
95843e1988Sjohnlev  * The version of the guest operating system (string).
96843e1988Sjohnlev  *
97843e1988Sjohnlev  * LEGACY: GUEST_VER
98843e1988Sjohnlev  */
99843e1988Sjohnlev #define XEN_ELFNOTE_GUEST_VERSION  7
100843e1988Sjohnlev 
101843e1988Sjohnlev /*
102843e1988Sjohnlev  * The loader type (string).
103843e1988Sjohnlev  *
104843e1988Sjohnlev  * LEGACY: LOADER
105843e1988Sjohnlev  */
106843e1988Sjohnlev #define XEN_ELFNOTE_LOADER         8
107843e1988Sjohnlev 
108843e1988Sjohnlev /*
109a576ab5bSrab  * The kernel supports PAE (x86/32 only, string = "yes", "no" or
110a576ab5bSrab  * "bimodal").
111a576ab5bSrab  *
112a576ab5bSrab  * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
113a576ab5bSrab  * may be given as "yes,bimodal" which will cause older Xen to treat
114a576ab5bSrab  * this kernel as PAE.
115843e1988Sjohnlev  *
116843e1988Sjohnlev  * LEGACY: PAE (n.b. The legacy interface included a provision to
117843e1988Sjohnlev  * indicate 'extended-cr3' support allowing L3 page tables to be
118843e1988Sjohnlev  * placed above 4G. It is assumed that any kernel new enough to use
119843e1988Sjohnlev  * these ELF notes will include this and therefore "yes" here is
120843e1988Sjohnlev  * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
121843e1988Sjohnlev  */
122843e1988Sjohnlev #define XEN_ELFNOTE_PAE_MODE       9
123843e1988Sjohnlev 
124843e1988Sjohnlev /*
125843e1988Sjohnlev  * The features supported/required by this kernel (string).
126843e1988Sjohnlev  *
127843e1988Sjohnlev  * The string must consist of a list of feature names (as given in
128843e1988Sjohnlev  * features.h, without the "XENFEAT_" prefix) separated by '|'
129843e1988Sjohnlev  * characters. If a feature is required for the kernel to function
130843e1988Sjohnlev  * then the feature name must be preceded by a '!' character.
131843e1988Sjohnlev  *
132843e1988Sjohnlev  * LEGACY: FEATURES
133843e1988Sjohnlev  */
134843e1988Sjohnlev #define XEN_ELFNOTE_FEATURES      10
135843e1988Sjohnlev 
136843e1988Sjohnlev /*
137843e1988Sjohnlev  * The kernel requires the symbol table to be loaded (string = "yes" or "no")
138843e1988Sjohnlev  * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
139843e1988Sjohnlev  * of this string as a boolean flag rather than requiring "yes" or
140843e1988Sjohnlev  * "no".
141843e1988Sjohnlev  */
142843e1988Sjohnlev #define XEN_ELFNOTE_BSD_SYMTAB    11
143843e1988Sjohnlev 
144843e1988Sjohnlev /*
145843e1988Sjohnlev  * The lowest address the hypervisor hole can begin at (numeric).
146843e1988Sjohnlev  *
147843e1988Sjohnlev  * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
148843e1988Sjohnlev  * also indicates to the hypervisor that the kernel can deal with the
149843e1988Sjohnlev  * hole starting at a higher address.
150843e1988Sjohnlev  */
151843e1988Sjohnlev #define XEN_ELFNOTE_HV_START_LOW  12
152843e1988Sjohnlev 
153a576ab5bSrab /*
154a576ab5bSrab  * List of maddr_t-sized mask/value pairs describing how to recognize
155a576ab5bSrab  * (non-present) L1 page table entries carrying valid MFNs (numeric).
156a576ab5bSrab  */
157a576ab5bSrab #define XEN_ELFNOTE_L1_MFN_VALID  13
158a576ab5bSrab 
159a576ab5bSrab /*
160a576ab5bSrab  * Whether or not the guest supports cooperative suspend cancellation.
161a576ab5bSrab  */
162a576ab5bSrab #define XEN_ELFNOTE_SUSPEND_CANCEL 14
163a576ab5bSrab 
164ad09f8b8SMark Johnson /*
165ad09f8b8SMark Johnson  * The (non-default) location the initial phys-to-machine map should be
166ad09f8b8SMark Johnson  * placed at by the hypervisor (Dom0) or the tools (DomU).
167ad09f8b8SMark Johnson  * The kernel must be prepared for this mapping to be established using
168ad09f8b8SMark Johnson  * large pages, despite such otherwise not being available to guests.
169ad09f8b8SMark Johnson  * The kernel must also be able to handle the page table pages used for
170ad09f8b8SMark Johnson  * this mapping not being accessible through the initial mapping.
171ad09f8b8SMark Johnson  * (Only x86-64 supports this at present.)
172ad09f8b8SMark Johnson  */
173ad09f8b8SMark Johnson #define XEN_ELFNOTE_INIT_P2M      15
174ad09f8b8SMark Johnson 
175a576ab5bSrab /*
176a576ab5bSrab  * The number of the highest elfnote defined.
177a576ab5bSrab  */
178ad09f8b8SMark Johnson #define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M
179a576ab5bSrab 
180843e1988Sjohnlev /*
181843e1988Sjohnlev  * System information exported through crash notes.
182843e1988Sjohnlev  *
183*55fea89dSDan Cross  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
184843e1988Sjohnlev  * note in case of a system crash. This note will contain various
185843e1988Sjohnlev  * information about the system, see xen/include/xen/elfcore.h.
186843e1988Sjohnlev  */
187843e1988Sjohnlev #define XEN_ELFNOTE_CRASH_INFO 0x1000001
188843e1988Sjohnlev 
189843e1988Sjohnlev /*
190843e1988Sjohnlev  * System registers exported through crash notes.
191843e1988Sjohnlev  *
192*55fea89dSDan Cross  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
193843e1988Sjohnlev  * note per cpu in case of a system crash. This note is architecture
194843e1988Sjohnlev  * specific and will contain registers not saved in the "CORE" note.
195843e1988Sjohnlev  * See xen/include/xen/elfcore.h for more information.
196843e1988Sjohnlev  */
197843e1988Sjohnlev #define XEN_ELFNOTE_CRASH_REGS 0x1000002
198843e1988Sjohnlev 
199a576ab5bSrab 
200a576ab5bSrab /*
201a576ab5bSrab  * xen dump-core none note.
202a576ab5bSrab  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
203a576ab5bSrab  * in its dump file to indicate that the file is xen dump-core
204a576ab5bSrab  * file. This note doesn't have any other information.
205a576ab5bSrab  * See tools/libxc/xc_core.h for more information.
206a576ab5bSrab  */
207a576ab5bSrab #define XEN_ELFNOTE_DUMPCORE_NONE               0x2000000
208a576ab5bSrab 
209a576ab5bSrab /*
210a576ab5bSrab  * xen dump-core header note.
211a576ab5bSrab  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
212a576ab5bSrab  * in its dump file.
213a576ab5bSrab  * See tools/libxc/xc_core.h for more information.
214a576ab5bSrab  */
215a576ab5bSrab #define XEN_ELFNOTE_DUMPCORE_HEADER             0x2000001
216a576ab5bSrab 
217a576ab5bSrab /*
218a576ab5bSrab  * xen dump-core xen version note.
219a576ab5bSrab  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
220a576ab5bSrab  * in its dump file. It contains the xen version obtained via the
221a576ab5bSrab  * XENVER hypercall.
222a576ab5bSrab  * See tools/libxc/xc_core.h for more information.
223a576ab5bSrab  */
224a576ab5bSrab #define XEN_ELFNOTE_DUMPCORE_XEN_VERSION        0x2000002
225a576ab5bSrab 
226a576ab5bSrab /*
227a576ab5bSrab  * xen dump-core format version note.
228a576ab5bSrab  * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
229a576ab5bSrab  * in its dump file. It contains a format version identifier.
230a576ab5bSrab  * See tools/libxc/xc_core.h for more information.
231a576ab5bSrab  */
232a576ab5bSrab #define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION     0x2000003
233a576ab5bSrab 
234843e1988Sjohnlev #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
235843e1988Sjohnlev 
236843e1988Sjohnlev /*
237843e1988Sjohnlev  * Local variables:
238843e1988Sjohnlev  * mode: C
239843e1988Sjohnlev  * c-set-style: "BSD"
240843e1988Sjohnlev  * c-basic-offset: 4
241843e1988Sjohnlev  * tab-width: 4
242843e1988Sjohnlev  * indent-tabs-mode: nil
243843e1988Sjohnlev  * End:
244843e1988Sjohnlev  */
245