Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: sync elfnote.h from xen tree

Sync Xen's elfnote.h header from xen.git to pull in the
XEN_ELFNOTE_PHYS32_RELOC define.

xen commit dfc9fab00378 ("x86/PVH: Support relocatable dom0 kernels")

This is a copy except for the removal of the emacs editor config at the
end of the file.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20240823193630.2583107-2-jason.andryuk@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Jason Andryuk and committed by
Juergen Gross
08377ed2 8f2f74f2

+88 -5
+88 -5
include/xen/interface/elfnote.h
··· 11 11 #define __XEN_PUBLIC_ELFNOTE_H__ 12 12 13 13 /* 14 - * The notes should live in a SHT_NOTE segment and have "Xen" in the 14 + * `incontents 200 elfnotes ELF notes 15 + * 16 + * The notes should live in a PT_NOTE segment and have "Xen" in the 15 17 * name field. 16 18 * 17 19 * Numeric types are either 4 or 8 bytes depending on the content of ··· 24 22 * 25 23 * String values (for non-legacy) are NULL terminated ASCII, also known 26 24 * as ASCIZ type. 25 + * 26 + * Xen only uses ELF Notes contained in x86 binaries. 27 27 */ 28 28 29 29 /* ··· 56 52 #define XEN_ELFNOTE_VIRT_BASE 3 57 53 58 54 /* 59 - * The offset of the ELF paddr field from the acutal required 55 + * The offset of the ELF paddr field from the actual required 60 56 * pseudo-physical address (numeric). 61 57 * 62 58 * This is used to maintain backwards compatibility with older kernels ··· 96 92 #define XEN_ELFNOTE_LOADER 8 97 93 98 94 /* 99 - * The kernel supports PAE (x86/32 only, string = "yes" or "no"). 95 + * The kernel supports PAE (x86/32 only, string = "yes", "no" or 96 + * "bimodal"). 97 + * 98 + * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting 99 + * may be given as "yes,bimodal" which will cause older Xen to treat 100 + * this kernel as PAE. 100 101 * 101 102 * LEGACY: PAE (n.b. The legacy interface included a provision to 102 103 * indicate 'extended-cr3' support allowing L3 page tables to be ··· 158 149 * The (non-default) location the initial phys-to-machine map should be 159 150 * placed at by the hypervisor (Dom0) or the tools (DomU). 160 151 * The kernel must be prepared for this mapping to be established using 161 - * large pages, despite such otherwise not being available to guests. 152 + * large pages, despite such otherwise not being available to guests. Note 153 + * that these large pages may be misaligned in PFN space (they'll obviously 154 + * be aligned in MFN and virtual address spaces). 162 155 * The kernel must also be able to handle the page table pages used for 163 156 * this mapping not being accessible through the initial mapping. 164 157 * (Only x86-64 supports this at present.) ··· 197 186 #define XEN_ELFNOTE_PHYS32_ENTRY 18 198 187 199 188 /* 189 + * Physical loading constraints for PVH kernels 190 + * 191 + * The presence of this note indicates the kernel supports relocating itself. 192 + * 193 + * The note may include up to three 32bit values to place constraints on the 194 + * guest physical loading addresses and alignment for a PVH kernel. Values 195 + * are read in the following order: 196 + * - a required start alignment (default 0x200000) 197 + * - a minimum address for the start of the image (default 0; see below) 198 + * - a maximum address for the last byte of the image (default 0xffffffff) 199 + * 200 + * When this note specifies an alignment value, it is used. Otherwise the 201 + * maximum p_align value from loadable ELF Program Headers is used, if it is 202 + * greater than or equal to 4k (0x1000). Otherwise, the default is used. 203 + */ 204 + #define XEN_ELFNOTE_PHYS32_RELOC 19 205 + 206 + /* 200 207 * The number of the highest elfnote defined. 201 208 */ 202 - #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY 209 + #define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_RELOC 210 + 211 + /* 212 + * System information exported through crash notes. 213 + * 214 + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO 215 + * note in case of a system crash. This note will contain various 216 + * information about the system, see xen/include/xen/elfcore.h. 217 + */ 218 + #define XEN_ELFNOTE_CRASH_INFO 0x1000001 219 + 220 + /* 221 + * System registers exported through crash notes. 222 + * 223 + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS 224 + * note per cpu in case of a system crash. This note is architecture 225 + * specific and will contain registers not saved in the "CORE" note. 226 + * See xen/include/xen/elfcore.h for more information. 227 + */ 228 + #define XEN_ELFNOTE_CRASH_REGS 0x1000002 229 + 230 + 231 + /* 232 + * xen dump-core none note. 233 + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE 234 + * in its dump file to indicate that the file is xen dump-core 235 + * file. This note doesn't have any other information. 236 + * See tools/libxc/xc_core.h for more information. 237 + */ 238 + #define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000 239 + 240 + /* 241 + * xen dump-core header note. 242 + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER 243 + * in its dump file. 244 + * See tools/libxc/xc_core.h for more information. 245 + */ 246 + #define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001 247 + 248 + /* 249 + * xen dump-core xen version note. 250 + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION 251 + * in its dump file. It contains the xen version obtained via the 252 + * XENVER hypercall. 253 + * See tools/libxc/xc_core.h for more information. 254 + */ 255 + #define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002 256 + 257 + /* 258 + * xen dump-core format version note. 259 + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 260 + * in its dump file. It contains a format version identifier. 261 + * See tools/libxc/xc_core.h for more information. 262 + */ 263 + #define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003 203 264 204 265 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */