ia64/xen-unstable

view docs/misc/dump-core-format.txt @ 15803:23bf79231e12

Update dump-core-foramt.txt documentation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Thu Aug 30 15:00:49 2007 +0100 (2007-08-30)
parents ca7cd6752cc2
children ecbda3783c85
line source
1 xen dump-core format
2 Written by Isaku Yamahata <yamahata at valinux co jp> Feb. 2007
5 Introduction
6 ------------
7 With xm dump-core command, the guest domain's core can be created as a file.
8 Its format was changed to be based on ELF format because elf format is easily
9 extensible and handy. This document describes the new format.
10 In this document the new format is called new xen dump-core format,
11 xen dump-core format or simply dump-core format. The file of xen dump-core
12 format is called xen dump-core file or dump-core file.
14 The usual process core file includes program headers and no section header.
15 On the other hand the xen dump-core file includes no program headers and
16 some sections because of its peculiar requirements.
19 Reference
20 ---------
21 For ELF format itself, see Tool Interface Standard(TIS) Executable and
22 Linking Format(ELF) Specification version 1.2.
23 For xen related structure, please see the xen header files.
26 Elf header
27 ----------
28 The elf header members are set as follows
29 e_ident[EI_CLASS] = ELFCLASS64 = 2
30 e_ident[EI_OSABI] = ELFOSABI_SYSV = 0
31 e_type = ET_CORE = 4
32 ELFCLASS64 is always used independent of architecture.
33 e_ident[EI_DATA] and e_flags are set according to the dumping system's
34 architecture. Other members are set as usual.
36 Sections
37 --------
38 Currently the following sections are defined. Some sections are optional.
40 ".note.Xen" section
41 name ".note.Xen"
42 type SHT_NOTE
43 description
44 This section is used as note section to store xen dump-core
45 file specific informations. The each detailed informations are
46 described in note section. This section must exist.
48 ".xen_prstatus" section
49 name ".xen_prstatus"
50 type SHT_PROGBITS
51 structure array of vcpu_guest_context_t
52 description
53 This section stores the array of vcpu_guest_context_t
54 which is obtained by XEN_DOMCTL_getvcpucontext hypercall
55 when the xen dump-core file is created.
56 The size of array is stored in xch_nr_vcpus member of header
57 note descriptor in .note.Xen note section.
58 This section must exist.
60 ".xen_shared_info" section
61 name ".xen_shared_info"
62 type SHT_PROGBITS
63 structure shared_info_t
64 description
65 This section stores the contents of shared info page
66 of a domain. This section is optional.
68 ".xen_p2m" section
69 name ".xen_p2m"
70 type SHT_PROGBITS
71 structure array of struct xen_dumpcore_p2m
72 struct xen_dumpcore_p2m {
73 uint64_t pfn;
74 uint64_t gmfn;
75 };
76 description
77 This elements represents the frame number of the page
78 in .xen_pages section.
79 pfn: guest-specific pseudo-physical frame number
80 gmfn: machine physical frame number
81 The size of arrays is stored in xch_nr_pages member of header
82 note descriptor in .note.Xen note section.
83 The entries are stored in pfn-ascending order.
84 The value, {~(uint64_t)0, ~(uint64_t)0}, means invalid
85 (pfn, gmfn) and the corresponding page has zero. There might
86 exist invalid (pfn, gmfn)'s at the end part of this array.
87 This section must exist when the domain is non auto
88 translated physmap mode. Currently x86 paravirtualized domain.
90 ".xen_pfn" section
91 name ".xen_pfn"
92 type SHT_PROGBITS
93 structure array of uint64_t
94 description
95 This elements represents the frame number of the page
96 in .xen_pages section.
97 The size of arrays is stored in xch_nr_pages member of header
98 note descriptor in .note.Xen note section.
99 The entries are stored in ascending order.
100 The value, ~(uint64_t)0, means invalid pfn and the
101 corresponding page has zero. There might exist invalid
102 pfn's at the end part of this array.
103 This section must exist when the domain is auto translated
104 physmap mode. Currently x86 full virtualized domain and
105 ia64 domain.
107 ".xen_pages" section
108 name ".xen_pages"
109 type SHT_PROGBITS
110 structure array of page where page is page size byte array
111 description
112 This section includes the contents of pages.
113 The corresponding address is described in .xen_p2m section
114 or .xen_pfn section.
115 The page size is stored in xch_page_size member of header note
116 descriptor in .note.Xen section.
117 The array size is stored in xch_nr_pages member of header note
118 descriptor in .note.Xen section.
119 This section must exist.
122 ".xen_ia64_mapped_regs" section
123 name ".xen_ia64_mapped_regs"
124 type SHT_PROGBITS
125 structure array of mapped_regs_t
126 description
127 This section stores the array of mapped_regs_t.
128 The size of array is stored in xch_nr_vcpus member of header
129 note descriptor in .note.Xen note section.
130 This section is ia64 specific and must exist for ia64 domain.
131 This section must not exist for non-ia64 domain.
134 note section
135 ------------
136 The note types are defined in xen/include/public/elfnote.h.
137 The note descriptors are defined in tools/libxc/xc_core.h
138 Currently the following note informations are defined.
141 elf note section
143 "Xen" is used as elf note name in elf note info
144 namesz 4
145 name "Xen" (null-terminated)
148 Descriptors
150 none note descriptor
151 type XEN_ELFNOTE_DUMPCORE_NONE = 0x2000000
152 structure struct xen_dumpcore_elfnote_none_desc {
153 /* nothing is defined */
154 };
155 description
156 This note descriptor is defined to just indicate that this
157 file is xen dump-core format without any specific information.
158 This note information must exist.
160 header note descriptor
161 type XEN_ELFNOTE_DUMPCORE_HEADER = 0x2000001
162 structure struct xen_dumpcore_elfnote_header_desc {
163 uint64_t xch_magic;
164 uint64_t xch_nr_vcpus;
165 uint64_t xch_nr_pages;
166 uint64_t xch_page_size;
167 };
168 description
169 This note descriptor stores basic information of the domain.
170 xch_magic magic number
171 XC_CORE_MAGIC = 0xF00FEBED for paravirtualized domain
172 XC_CORE_MAGIC_HVM = 0xF00FEBEE for full virtualized domain
173 xch_nr_vcpus the number of vcpus
174 xch_nr_pages the number of pages
175 xch_page_size guest OS's page size
176 This note information must exist.
178 xen_version descriptor
179 type XEN_ELFNOTE_DUMPCORE_XEN_VERSION = 0x2000002
180 structure struct xen_dumpcore_elfnote_xen_version_desc {
181 uint64_t major_version;
182 uint64_t minor_version;
183 xen_extraversion_t extra_version;
184 xen_compile_info_t compile_info;
185 xen_capabilities_info_t capabilities;
186 xen_changeset_info_t changeset;
187 xen_platform_parameters_t platform_parameters;
188 uint64_t pagesize;
189 };
190 description
191 This note descriptor stores basic information about xen
192 hypervisor. The each members store the result of
193 __HYPERVISOR_xen_version hypercall.
194 major_version 16msb bit of the result of XENVER_version
195 minor_version 16lsb bit of the result of XENVER_version
196 uint64_t is used to make struct
197 xen_dumpcore_elfnote_xen_version_desc independent
198 on 32bit/64bit instead of uint32_t.
199 extra_version the result of XENVER_extraversion
200 compile_info the result of XENVER_compile_info
201 capabilities the result of XENVER_capabilities
202 changeset the result of XENVER_changeset
203 platform_parameters
204 the result of XENVER_platform_parameters
205 pagesize the result of XENVER_pagesize
206 This note information must exist.
208 format_version descriptor
209 type XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION = 0x2000003
210 structure struct xen_dumpcore_elfnote_format_version_desc {
211 uint64_t version;
212 };
213 description
214 This note descriptor stores xen dump-core format version.
215 The 32msb bit is major version and the 32lsb bit is minor
216 version.
217 The minor version will be incremented when the format
218 is changed in compatible way. e.g. new sections, new note
219 descriptors are added.
220 the major version will be incremented when the format is
221 changed in incompatible way.
222 This note information must exit. Analysis tools should check
223 this format version.
224 This note information must exist.
227 Format version history
228 ----------------------
229 Currently only (major, minor) = (0, 1) is used.
230 [When the format is changed, it would be described here.]
232 (0, 1) update
233 - .xen_p2m, .xen_pfn section
234 Invalid pfn/gmfn.
235 - .xen_p2m, .xen_pfn section
236 Arrays must be in pfn ascending order for efficient looking up.
237 - EI_CLASS member of elf header was changed to ELFCLASS64 independent of
238 architecture. This is mainly for x86_32pae.
239 The format version isn't bumped because analysis tools can distinguish it.