VirtualBox

source: vbox/trunk/include/VBox/vmm/dbgfcorefmt.h@ 87450

Last change on this file since 87450 was 83122, checked in by vboxsync, 5 years ago

VMM/DBGF: Add TSC Aux MSR to the DBGF core dump.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/** @file
2 * DBGF - Debugger Facility, VM Core File Format.
3 */
4
5/*
6 * Copyright (C) 2010-2020 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_vmm_dbgfcorefmt_h
27#define VBOX_INCLUDED_vmm_dbgfcorefmt_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/types.h>
33#include <VBox/vmm/cpumctx.h>
34#include <iprt/assertcompile.h>
35
36
37RT_C_DECLS_BEGIN
38
39
40/** @defgroup grp_dbgf_corefmt VM Core File Format
41 * @ingroup grp_dbgf
42 *
43 * @todo Add description of the core file format and how the structures in this
44 * file relate to it. Point to X86XSAVEAREA in x86.h for the CPU's
45 * FPU/SSE/AVX/XXX state.
46 * @todo Add the note names.
47 *
48 * @{
49 */
50
51/** DBGCORECOREDESCRIPTOR::u32Magic. */
52#define DBGFCORE_MAGIC UINT32_C(0xc01ac0de)
53/** DBGCORECOREDESCRIPTOR::u32FmtVersion. */
54#define DBGFCORE_FMT_VERSION UINT32_C(0x00010006)
55
56/**
57 * An x86 segment selector.
58 */
59typedef struct DBGFCORESEL
60{
61 uint64_t uBase;
62 uint32_t uLimit;
63 uint32_t uAttr;
64 uint16_t uSel;
65 uint16_t uReserved0;
66 uint32_t uReserved1;
67} DBGFCORESEL;
68AssertCompileSizeAlignment(DBGFCORESEL, 8);
69
70/**
71 * A gdtr/ldtr descriptor.
72 */
73typedef struct DBGFCOREXDTR
74{
75 uint64_t uAddr;
76 uint32_t cb;
77 uint32_t uReserved0;
78} DBGFCOREXDTR;
79AssertCompileSizeAlignment(DBGFCOREXDTR, 8);
80
81/**
82 * A simpler to parse CPU dump than CPUMCTX.
83 *
84 * Please bump DBGFCORE_FMT_VERSION by 1 if you make any changes to this
85 * structure.
86 */
87typedef struct DBGFCORECPU
88{
89 uint64_t rax;
90 uint64_t rbx;
91 uint64_t rcx;
92 uint64_t rdx;
93 uint64_t rsi;
94 uint64_t rdi;
95 uint64_t r8;
96 uint64_t r9;
97 uint64_t r10;
98 uint64_t r11;
99 uint64_t r12;
100 uint64_t r13;
101 uint64_t r14;
102 uint64_t r15;
103 uint64_t rip;
104 uint64_t rsp;
105 uint64_t rbp;
106 uint64_t rflags;
107 DBGFCORESEL cs;
108 DBGFCORESEL ds;
109 DBGFCORESEL es;
110 DBGFCORESEL fs;
111 DBGFCORESEL gs;
112 DBGFCORESEL ss;
113 uint64_t cr0;
114 uint64_t cr2;
115 uint64_t cr3;
116 uint64_t cr4;
117 uint64_t dr[8];
118 DBGFCOREXDTR gdtr;
119 DBGFCOREXDTR idtr;
120 DBGFCORESEL ldtr;
121 DBGFCORESEL tr;
122 struct
123 {
124 uint64_t cs;
125 uint64_t eip;
126 uint64_t esp;
127 } sysenter;
128 uint64_t msrEFER;
129 uint64_t msrSTAR;
130 uint64_t msrPAT;
131 uint64_t msrLSTAR;
132 uint64_t msrCSTAR;
133 uint64_t msrSFMASK;
134 uint64_t msrKernelGSBase;
135 uint64_t msrApicBase;
136 uint64_t msrTscAux;
137 uint64_t aXcr[2];
138 uint32_t cbExt;
139 uint32_t uPadding0;
140 X86XSAVEAREA ext;
141} DBGFCORECPU;
142/** Pointer to a DBGF-core CPU. */
143typedef DBGFCORECPU *PDBGFCORECPU;
144/** Pointer to the const DBGF-core CPU. */
145typedef const DBGFCORECPU *PCDBGFCORECPU;
146AssertCompileMemberAlignment(DBGFCORECPU, cr0, 8);
147AssertCompileMemberAlignment(DBGFCORECPU, msrEFER, 8);
148AssertCompileMemberAlignment(DBGFCORECPU, ext, 8);
149AssertCompileSizeAlignment(DBGFCORECPU, 8);
150
151/**
152 * The DBGF Core descriptor.
153 */
154typedef struct DBGFCOREDESCRIPTOR
155{
156 /** The core file magic (DBGFCORE_MAGIC) */
157 uint32_t u32Magic;
158 /** The core file format version (DBGFCORE_FMT_VERSION). */
159 uint32_t u32FmtVersion;
160 /** Size of this structure (sizeof(DBGFCOREDESCRIPTOR)). */
161 uint32_t cbSelf;
162 /** VirtualBox version. */
163 uint32_t u32VBoxVersion;
164 /** VirtualBox revision. */
165 uint32_t u32VBoxRevision;
166 /** Number of CPUs. */
167 uint32_t cCpus;
168} DBGFCOREDESCRIPTOR;
169AssertCompileSizeAlignment(DBGFCOREDESCRIPTOR, 8);
170/** Pointer to DBGFCOREDESCRIPTOR data. */
171typedef DBGFCOREDESCRIPTOR *PDBGFCOREDESCRIPTOR;
172
173/** @} */
174
175RT_C_DECLS_END
176
177#endif /* !VBOX_INCLUDED_vmm_dbgfcorefmt_h */
178
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette