VirtualBox

source: vbox/trunk/src/VBox/VMM/include/HMInternal.mac@ 87491

Last change on this file since 87491 was 87491, checked in by vboxsync, 4 years ago

VMM/HMVMX: Some stats.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.8 KB
Line 
1;$Id: HMInternal.mac 87491 2021-01-30 01:15:50Z vboxsync $
2;; @file
3; HM - Internal header file.
4;
5
6;
7; Copyright (C) 2006-2020 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17
18%ifndef VMX_VMCS_GUEST_FIELD_ES
19 %include "VBox/vmm/hm_vmx.mac" ; For VMXRESTOREHOST
20%endif
21
22struc VMXVMCSINFOSHARED
23 .fWasInRealMode resb 1
24 .fSwitchedTo64on32Obsolete resb 1
25 alignb 8
26 .RealMode.AttrCS resd 1
27 .RealMode.AttrDS resd 1
28 .RealMode.AttrES resd 1
29 .RealMode.AttrFS resd 1
30 .RealMode.AttrGS resd 1
31 .RealMode.AttrSS resd 1
32 .RealMode.Eflags resd 1 ; should be EFlags?
33 .RealMode.fRealOnV86Active resb 1
34
35 alignb 8
36 .au64LbrFromIpMsr resq 32
37 .au64LbrToIpMsr resq 32
38 .u64LbrTosMsr resq 1
39endstruc
40
41
42struc VMXVMCSINFO
43 .pShared RTR0PTR_RES 1
44
45 .HCPhysEPTP RTHCPHYS_RES 1
46 .fVmcsState resd 1
47 .fShadowVmcsState resd 1
48 .idHostCpuState resd 1
49 .idHostCpuExec resd 1
50 .cEntryMsrLoad resd 1
51 .cExitMsrStore resd 1
52 .cExitMsrLoad resd 1
53
54 .u32PinCtls resd 1
55 .u32ProcCtls resd 1
56 .u32ProcCtls2 resd 1
57 .u32EntryCtls resd 1
58 .u32ExitCtls resd 1
59 .u32XcptBitmap resd 1
60 .u32XcptPFMask resd 1
61 .u32XcptPFMatch resd 1
62
63 alignb 8
64 .u64TscOffset resq 1
65 .u64VmcsLinkPtr resq 1
66 .u64Cr0Mask resq 1
67 .u64Cr4Mask resq 1
68 .uHostRip resq 1
69 .uHostRsp resq 1
70
71 .pvVmcs RTR0PTR_RES 1
72 .pvShadowVmcs RTR0PTR_RES 1
73 .pbVirtApic RTR0PTR_RES 1
74 .pvMsrBitmap RTR0PTR_RES 1
75 .pvGuestMsrLoad RTR0PTR_RES 1
76 .pvGuestMsrStore RTR0PTR_RES 1
77 .pvHostMsrLoad RTR0PTR_RES 1
78
79 alignb 8
80 .HCPhysVmcs RTHCPHYS_RES 1
81 .HCPhysShadowVmcs RTHCPHYS_RES 1
82 .HCPhysVirtApic RTHCPHYS_RES 1
83 .HCPhysMsrBitmap RTHCPHYS_RES 1
84 .HCPhysGuestMsrLoad RTHCPHYS_RES 1
85 .HCPhysGuestMsrStore RTHCPHYS_RES 1
86 .HCPhysHostMsrLoad RTHCPHYS_RES 1
87
88 .hMemObj RTR0PTR_RES 1
89endstruc
90
91%define VMX_RESTORE_HOST_SEL_DS 0001h ;RT_BIT(0)
92%define VMX_RESTORE_HOST_SEL_ES 0002h ;RT_BIT(1)
93%define VMX_RESTORE_HOST_SEL_FS 0004h ;RT_BIT(2)
94%define VMX_RESTORE_HOST_SEL_GS 0008h ;RT_BIT(3)
95%define VMX_RESTORE_HOST_SEL_TR 0010h ;RT_BIT(4)
96%define VMX_RESTORE_HOST_GDTR 0020h ;RT_BIT(5)
97%define VMX_RESTORE_HOST_IDTR 0040h ;RT_BIT(6)
98%define VMX_RESTORE_HOST_GDT_READ_ONLY 0080h ;RT_BIT(7)
99%define VMX_RESTORE_HOST_GDT_NEED_WRITABLE 0100h ;RT_BIT(8)
100%define VMX_RESTORE_HOST_CAN_USE_WRFSBASE_AND_WRGSBASE 0200h ;RT_BIT(9)
101%define VMX_RESTORE_HOST_REQUIRED 0400h ;RT_BIT(10) - must be the highest bit!
102struc VMXRESTOREHOST
103 .uHostSelDS resw 1
104 .uHostSelES resw 1
105 .uHostSelFS resw 1
106 .HostGdtr resb 10
107 .uHostSelGS resw 1
108 .uHostSelTR resw 1
109 .uHostSelSS resw 1
110 .HostGdtrRw resb 10
111 .uHostSelCS resw 1
112 .abPadding1 resb 4
113 .HostIdtr resb 10
114 alignb 8
115 .uHostFSBase resq 1
116 .uHostGSBase resq 1
117endstruc
118
119struc HMCPUVMX
120 .VmcsInfo resb VMXVMCSINFOSHARED_size
121 .VmcsInfoNstGst resb VMXVMCSINFOSHARED_size
122 .fSwitchedToNstGstVmcsCopyForRing3 resb 1
123 .fMergedNstGstCtls resb 1
124 .fCopiedNstGstToShadowVmcs resb 1
125 .fSwitchedNstGstFlushTlb resb 1
126
127 alignb 8
128 .u64GstMsrApicBase resq 1
129
130 .LastError.idCurrentCpu resd 1
131 .LastError.idEnteredCpu resd 1
132 .LastError.HCPhysCurrentVmcs resq 1
133 .LastError.u32VmcsRev resd 1
134 .LastError.u32InstrError resd 1
135 .LastError.u32ExitReason resd 1
136 .LastError.u32GuestIntrState resd 1
137endstruc
138
139struc HMCPUSVM
140 .HCPhysVmcbHost RTHCPHYS_RES 1
141
142 .hMemObjVmcbHost RTR0PTR_RES 1
143 .pvPadding RTR0PTR_RES 1 ; pointless padding
144
145 .HCPhysVmcb RTHCPHYS_RES 1
146 .hMemObjVmcb RTR0PTR_RES 1
147 .pVmcb RTR0PTR_RES 1
148
149 .HCPhysMsrBitmap RTHCPHYS_RES 1
150 .hMemObjMsrBitmap RTR0PTR_RES 1
151 .pvMsrBitmap RTR0PTR_RES 1
152
153 .fSyncVTpr resb 1
154 .fEmulateLongModeSysEnterExit resb 1
155
156 alignb 8
157 .u64HostTscAux resq 1
158
159 .NstGstVmcbCache resb 40
160endstruc
161
162struc HMCPU
163 .fCheckedTLBFlush resb 1
164 .fActive resb 1
165 .fUseDebugLoop resb 1
166
167 .fGIMTrapXcptUD resb 1
168 .fTrapXcptGpForLovelyMesaDrv resb 1
169 .fSingleInstruction resb 1
170 alignb 8
171
172 .u32HMError resd 1
173 .rcLastExitToR3 resd 1
174 alignb 8
175 .fCtxChanged resq 1
176
177 alignb 8
178;%if HMCPUVMX_size > HMCPUSVM_size
179 .u resb HMCPUVMX_size
180;%else
181; .u resb HMCPUSVM_size
182;%endif
183
184 .Event.fPending resd 1
185 .Event.u32ErrCode resd 1
186 .Event.cbInstr resd 1
187 alignb 8
188 .Event.u64IntInfo resq 1
189 .Event.GCPtrFaultAddress RTGCPTR_RES 1
190
191 .enmShadowMode resd 1
192 alignb 8
193 .aPdpes resq 4
194
195 .DisState resb 0d8h
196
197 .StatVmxWriteHostRip resq 1
198 .StatVmxWriteHostRsp resq 1
199
200 ; The remainer is disassembly state and statistics.
201endstruc
202
203struc HMR0CPUVMX
204 .pfnStartVm RTR0PTR_RES 1
205
206 .VmcsInfo resb VMXVMCSINFO_size
207 .VmcsInfoNstGst resb VMXVMCSINFO_size
208 .fSwitchedToNstGstVmcs resb 1
209
210 alignb 8
211 .u64HostMsrLStar resq 1
212 .u64HostMsrStar resq 1
213 .u64HostMsrSfMask resq 1
214 .u64HostMsrKernelGsBase resq 1
215 .fLazyMsrs resd 1
216 .fUpdatedHostAutoMsrs resb 1
217 alignb 4
218 .fRestoreHostFlags resd 1
219 alignb 8
220 .RestoreHost resb VMXRESTOREHOST_size
221endstruc
222
223struc HMR0CPUSVM
224 .pfnVMRun RTR0PTR_RES 1
225endstruc
226
227struc HMR0PERVCPU
228 .cWorldSwitchExits resd 1
229 .cTlbFlushes resd 1
230 .idLastCpu resd 1
231 .idEnteredCpu resd 1
232 .uCurrentAsid resd 1
233
234 .fForceTLBFlush resb 1
235 .fLeaveDone resb 1
236 .fUsingHyperDR7 resb 1
237 .fUsingDebugLoop resb 1
238 .fDebugWantRdTscExit resb 1
239 .fLoadSaveGuestXcr0 resb 1
240 .fClearTrapFlag resb 1
241
242 alignb 8
243;%if HMR0CPUVMX_size > HMR0CPUSVM_size
244 .u resb HMR0CPUVMX_size
245;%else
246; .u resb HMR0CPUSVM_size
247;%endif
248endstruc
249
Note: See TracBrowser for help on using the repository browser.

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