elfnote.h revision a576ab5b6e08c47732b3dedca9eaa8a8cbb85720
843e19887f64dde75055cf8842fc4db2171eff45johnlev/******************************************************************************
843e19887f64dde75055cf8842fc4db2171eff45johnlev * elfnote.h
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Definitions used for the Xen ELF notes.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Permission is hereby granted, free of charge, to any person obtaining a copy
843e19887f64dde75055cf8842fc4db2171eff45johnlev * of this software and associated documentation files (the "Software"), to
843e19887f64dde75055cf8842fc4db2171eff45johnlev * deal in the Software without restriction, including without limitation the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
843e19887f64dde75055cf8842fc4db2171eff45johnlev * sell copies of the Software, and to permit persons to whom the Software is
843e19887f64dde75055cf8842fc4db2171eff45johnlev * furnished to do so, subject to the following conditions:
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The above copyright notice and this permission notice shall be included in
843e19887f64dde75055cf8842fc4db2171eff45johnlev * all copies or substantial portions of the Software.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
843e19887f64dde75055cf8842fc4db2171eff45johnlev * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
843e19887f64dde75055cf8842fc4db2171eff45johnlev * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
843e19887f64dde75055cf8842fc4db2171eff45johnlev * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
843e19887f64dde75055cf8842fc4db2171eff45johnlev * DEALINGS IN THE SOFTWARE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev#ifndef __XEN_PUBLIC_ELFNOTE_H__
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define __XEN_PUBLIC_ELFNOTE_H__
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * The notes should live in a PT_NOTE segment and have "Xen" in the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * name field.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Numeric types are either 4 or 8 bytes depending on the content of
843e19887f64dde75055cf8842fc4db2171eff45johnlev * the desc field.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY indicated the fields in the legacy __xen_guest string which
843e19887f64dde75055cf8842fc4db2171eff45johnlev * this a note type replaces.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * NAME=VALUE pair (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_INFO 0
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The virtual address of the entry point (numeric).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: VIRT_ENTRY
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_ENTRY 1
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/* The virtual address of the hypercall transfer page (numeric).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
843e19887f64dde75055cf8842fc4db2171eff45johnlev * number not a virtual address)
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_HYPERCALL_PAGE 2
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/* The virtual address where the kernel image should be mapped (numeric).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Defaults to 0.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: VIRT_BASE
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_VIRT_BASE 3
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The offset of the ELF paddr field from the acutal required
843e19887f64dde75055cf8842fc4db2171eff45johnlev * psuedo-physical address (numeric).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This is used to maintain backwards compatibility with older kernels
843e19887f64dde75055cf8842fc4db2171eff45johnlev * which wrote __PAGE_OFFSET into that field. This field defaults to 0
843e19887f64dde75055cf8842fc4db2171eff45johnlev * if not present.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_PADDR_OFFSET 4
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The version of Xen that we work with (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: XEN_VER
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_XEN_VERSION 5
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The name of the guest operating system (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: GUEST_OS
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_GUEST_OS 6
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The version of the guest operating system (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: GUEST_VER
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_GUEST_VERSION 7
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The loader type (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: LOADER
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_LOADER 8
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * The kernel supports PAE (x86/32 only, string = "yes", "no" or
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * "bimodal").
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab *
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * may be given as "yes,bimodal" which will cause older Xen to treat
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * this kernel as PAE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: PAE (n.b. The legacy interface included a provision to
843e19887f64dde75055cf8842fc4db2171eff45johnlev * indicate 'extended-cr3' support allowing L3 page tables to be
843e19887f64dde75055cf8842fc4db2171eff45johnlev * placed above 4G. It is assumed that any kernel new enough to use
843e19887f64dde75055cf8842fc4db2171eff45johnlev * these ELF notes will include this and therefore "yes" here is
843e19887f64dde75055cf8842fc4db2171eff45johnlev * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_PAE_MODE 9
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The features supported/required by this kernel (string).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The string must consist of a list of feature names (as given in
843e19887f64dde75055cf8842fc4db2171eff45johnlev * features.h, without the "XENFEAT_" prefix) separated by '|'
843e19887f64dde75055cf8842fc4db2171eff45johnlev * characters. If a feature is required for the kernel to function
843e19887f64dde75055cf8842fc4db2171eff45johnlev * then the feature name must be preceded by a '!' character.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: FEATURES
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_FEATURES 10
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The kernel requires the symbol table to be loaded (string = "yes" or "no")
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
843e19887f64dde75055cf8842fc4db2171eff45johnlev * of this string as a boolean flag rather than requiring "yes" or
843e19887f64dde75055cf8842fc4db2171eff45johnlev * "no".
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_BSD_SYMTAB 11
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The lowest address the hypervisor hole can begin at (numeric).
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
843e19887f64dde75055cf8842fc4db2171eff45johnlev * also indicates to the hypervisor that the kernel can deal with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * hole starting at a higher address.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_HV_START_LOW 12
843e19887f64dde75055cf8842fc4db2171eff45johnlev
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * List of maddr_t-sized mask/value pairs describing how to recognize
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * (non-present) L1 page table entries carrying valid MFNs (numeric).
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_L1_MFN_VALID 13
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * Whether or not the guest supports cooperative suspend cancellation.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_SUSPEND_CANCEL 14
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * The number of the highest elfnote defined.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * System information exported through crash notes.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
843e19887f64dde75055cf8842fc4db2171eff45johnlev * note in case of a system crash. This note will contain various
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information about the system, see xen/include/xen/elfcore.h.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_CRASH_INFO 0x1000001
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * System registers exported through crash notes.
843e19887f64dde75055cf8842fc4db2171eff45johnlev *
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
843e19887f64dde75055cf8842fc4db2171eff45johnlev * note per cpu in case of a system crash. This note is architecture
843e19887f64dde75055cf8842fc4db2171eff45johnlev * specific and will contain registers not saved in the "CORE" note.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See xen/include/xen/elfcore.h for more information.
843e19887f64dde75055cf8842fc4db2171eff45johnlev */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define XEN_ELFNOTE_CRASH_REGS 0x1000002
843e19887f64dde75055cf8842fc4db2171eff45johnlev
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xen dump-core none note.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * in its dump file to indicate that the file is xen dump-core
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * file. This note doesn't have any other information.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * See tools/libxc/xc_core.h for more information.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xen dump-core header note.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * in its dump file.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * See tools/libxc/xc_core.h for more information.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xen dump-core xen version note.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * in its dump file. It contains the xen version obtained via the
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * XENVER hypercall.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * See tools/libxc/xc_core.h for more information.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab/*
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xen dump-core format version note.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * in its dump file. It contains a format version identifier.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * See tools/libxc/xc_core.h for more information.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab
843e19887f64dde75055cf8842fc4db2171eff45johnlev#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
843e19887f64dde75055cf8842fc4db2171eff45johnlev
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Local variables:
843e19887f64dde75055cf8842fc4db2171eff45johnlev * mode: C
843e19887f64dde75055cf8842fc4db2171eff45johnlev * c-set-style: "BSD"
843e19887f64dde75055cf8842fc4db2171eff45johnlev * c-basic-offset: 4
843e19887f64dde75055cf8842fc4db2171eff45johnlev * tab-width: 4
843e19887f64dde75055cf8842fc4db2171eff45johnlev * indent-tabs-mode: nil
843e19887f64dde75055cf8842fc4db2171eff45johnlev * End:
843e19887f64dde75055cf8842fc4db2171eff45johnlev */