xref: /titanic_52/usr/src/uts/common/xen/public/elfnote.h (revision 1ce1951135b81c803c8dcf2f3c756009b1b0170a)
1 /******************************************************************************
2  * elfnote.h
3  *
4  * Definitions used for the Xen ELF notes.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  *
24  * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
25  */
26 
27 #ifndef __XEN_PUBLIC_ELFNOTE_H__
28 #define __XEN_PUBLIC_ELFNOTE_H__
29 
30 /*
31  * The notes should live in a SHT_NOTE segment and have "Xen" in the
32  * name field.
33  *
34  * Numeric types are either 4 or 8 bytes depending on the content of
35  * the desc field.
36  *
37  * LEGACY indicated the fields in the legacy __xen_guest string which
38  * this a note type replaces.
39  */
40 
41 /*
42  * NAME=VALUE pair (string).
43  *
44  * LEGACY: FEATURES and PAE
45  */
46 #define XEN_ELFNOTE_INFO           0
47 
48 /*
49  * The virtual address of the entry point (numeric).
50  *
51  * LEGACY: VIRT_ENTRY
52  */
53 #define XEN_ELFNOTE_ENTRY          1
54 
55 /* The virtual address of the hypercall transfer page (numeric).
56  *
57  * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
58  * number not a virtual address)
59  */
60 #define XEN_ELFNOTE_HYPERCALL_PAGE 2
61 
62 /* The virtual address where the kernel image should be mapped (numeric).
63  *
64  * Defaults to 0.
65  *
66  * LEGACY: VIRT_BASE
67  */
68 #define XEN_ELFNOTE_VIRT_BASE      3
69 
70 /*
71  * The offset of the ELF paddr field from the acutal required
72  * psuedo-physical address (numeric).
73  *
74  * This is used to maintain backwards compatibility with older kernels
75  * which wrote __PAGE_OFFSET into that field. This field defaults to 0
76  * if not present.
77  *
78  * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
79  */
80 #define XEN_ELFNOTE_PADDR_OFFSET   4
81 
82 /*
83  * The version of Xen that we work with (string).
84  *
85  * LEGACY: XEN_VER
86  */
87 #define XEN_ELFNOTE_XEN_VERSION    5
88 
89 /*
90  * The name of the guest operating system (string).
91  *
92  * LEGACY: GUEST_OS
93  */
94 #define XEN_ELFNOTE_GUEST_OS       6
95 
96 /*
97  * The version of the guest operating system (string).
98  *
99  * LEGACY: GUEST_VER
100  */
101 #define XEN_ELFNOTE_GUEST_VERSION  7
102 
103 /*
104  * The loader type (string).
105  *
106  * LEGACY: LOADER
107  */
108 #define XEN_ELFNOTE_LOADER         8
109 
110 /*
111  * The kernel supports PAE (x86/32 only, string = "yes" or "no").
112  *
113  * LEGACY: PAE (n.b. The legacy interface included a provision to
114  * indicate 'extended-cr3' support allowing L3 page tables to be
115  * placed above 4G. It is assumed that any kernel new enough to use
116  * these ELF notes will include this and therefore "yes" here is
117  * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
118  */
119 #define XEN_ELFNOTE_PAE_MODE       9
120 
121 /*
122  * The features supported/required by this kernel (string).
123  *
124  * The string must consist of a list of feature names (as given in
125  * features.h, without the "XENFEAT_" prefix) separated by '|'
126  * characters. If a feature is required for the kernel to function
127  * then the feature name must be preceded by a '!' character.
128  *
129  * LEGACY: FEATURES
130  */
131 #define XEN_ELFNOTE_FEATURES      10
132 
133 /*
134  * The kernel requires the symbol table to be loaded (string = "yes" or "no")
135  * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
136  * of this string as a boolean flag rather than requiring "yes" or
137  * "no".
138  */
139 #define XEN_ELFNOTE_BSD_SYMTAB    11
140 
141 /*
142  * The lowest address the hypervisor hole can begin at (numeric).
143  *
144  * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
145  * also indicates to the hypervisor that the kernel can deal with the
146  * hole starting at a higher address.
147  */
148 #define XEN_ELFNOTE_HV_START_LOW  12
149 
150 /*
151  * System information exported through crash notes.
152  *
153  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
154  * note in case of a system crash. This note will contain various
155  * information about the system, see xen/include/xen/elfcore.h.
156  */
157 #define XEN_ELFNOTE_CRASH_INFO 0x1000001
158 
159 /*
160  * System registers exported through crash notes.
161  *
162  * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
163  * note per cpu in case of a system crash. This note is architecture
164  * specific and will contain registers not saved in the "CORE" note.
165  * See xen/include/xen/elfcore.h for more information.
166  */
167 #define XEN_ELFNOTE_CRASH_REGS 0x1000002
168 
169 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
170 
171 /*
172  * Local variables:
173  * mode: C
174  * c-set-style: "BSD"
175  * c-basic-offset: 4
176  * tab-width: 4
177  * indent-tabs-mode: nil
178  * End:
179  */
180