1 | ;$Id: HMInternal.mac 87503 2021-02-01 14:38:38Z 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 |
|
---|
22 | struc VMXVMCSINFOSHARED
|
---|
23 | .fWasInRealMode resb 1
|
---|
24 | alignb 8
|
---|
25 | .RealMode.AttrCS resd 1
|
---|
26 | .RealMode.AttrDS resd 1
|
---|
27 | .RealMode.AttrES resd 1
|
---|
28 | .RealMode.AttrFS resd 1
|
---|
29 | .RealMode.AttrGS resd 1
|
---|
30 | .RealMode.AttrSS resd 1
|
---|
31 | .RealMode.Eflags resd 1 ; should be EFlags?
|
---|
32 | .RealMode.fRealOnV86Active resb 1
|
---|
33 |
|
---|
34 | alignb 8
|
---|
35 | .au64LbrFromIpMsr resq 32
|
---|
36 | .au64LbrToIpMsr resq 32
|
---|
37 | .u64LbrTosMsr resq 1
|
---|
38 | endstruc
|
---|
39 |
|
---|
40 |
|
---|
41 | struc VMXVMCSINFO
|
---|
42 | .pShared RTR0PTR_RES 1
|
---|
43 |
|
---|
44 | .HCPhysEPTP RTHCPHYS_RES 1
|
---|
45 | .fVmcsState resd 1
|
---|
46 | .fShadowVmcsState resd 1
|
---|
47 | .idHostCpuState resd 1
|
---|
48 | .idHostCpuExec resd 1
|
---|
49 | .cEntryMsrLoad resd 1
|
---|
50 | .cExitMsrStore resd 1
|
---|
51 | .cExitMsrLoad resd 1
|
---|
52 |
|
---|
53 | .u32PinCtls resd 1
|
---|
54 | .u32ProcCtls resd 1
|
---|
55 | .u32ProcCtls2 resd 1
|
---|
56 | .u32EntryCtls resd 1
|
---|
57 | .u32ExitCtls resd 1
|
---|
58 | .u32XcptBitmap resd 1
|
---|
59 | .u32XcptPFMask resd 1
|
---|
60 | .u32XcptPFMatch resd 1
|
---|
61 |
|
---|
62 | alignb 8
|
---|
63 | .u64TscOffset resq 1
|
---|
64 | .u64VmcsLinkPtr resq 1
|
---|
65 | .u64Cr0Mask resq 1
|
---|
66 | .u64Cr4Mask resq 1
|
---|
67 | .uHostRip resq 1
|
---|
68 | .uHostRsp resq 1
|
---|
69 |
|
---|
70 | .pvVmcs RTR0PTR_RES 1
|
---|
71 | .pvShadowVmcs RTR0PTR_RES 1
|
---|
72 | .pbVirtApic RTR0PTR_RES 1
|
---|
73 | .pvMsrBitmap RTR0PTR_RES 1
|
---|
74 | .pvGuestMsrLoad RTR0PTR_RES 1
|
---|
75 | .pvGuestMsrStore RTR0PTR_RES 1
|
---|
76 | .pvHostMsrLoad RTR0PTR_RES 1
|
---|
77 |
|
---|
78 | alignb 8
|
---|
79 | .HCPhysVmcs RTHCPHYS_RES 1
|
---|
80 | .HCPhysShadowVmcs RTHCPHYS_RES 1
|
---|
81 | .HCPhysVirtApic RTHCPHYS_RES 1
|
---|
82 | .HCPhysMsrBitmap RTHCPHYS_RES 1
|
---|
83 | .HCPhysGuestMsrLoad RTHCPHYS_RES 1
|
---|
84 | .HCPhysGuestMsrStore RTHCPHYS_RES 1
|
---|
85 | .HCPhysHostMsrLoad RTHCPHYS_RES 1
|
---|
86 |
|
---|
87 | .hMemObj RTR0PTR_RES 1
|
---|
88 | endstruc
|
---|
89 |
|
---|
90 | %define VMX_RESTORE_HOST_SEL_DS 0001h ;RT_BIT(0)
|
---|
91 | %define VMX_RESTORE_HOST_SEL_ES 0002h ;RT_BIT(1)
|
---|
92 | %define VMX_RESTORE_HOST_SEL_FS 0004h ;RT_BIT(2)
|
---|
93 | %define VMX_RESTORE_HOST_SEL_GS 0008h ;RT_BIT(3)
|
---|
94 | %define VMX_RESTORE_HOST_SEL_TR 0010h ;RT_BIT(4)
|
---|
95 | %define VMX_RESTORE_HOST_GDTR 0020h ;RT_BIT(5)
|
---|
96 | %define VMX_RESTORE_HOST_IDTR 0040h ;RT_BIT(6)
|
---|
97 | %define VMX_RESTORE_HOST_GDT_READ_ONLY 0080h ;RT_BIT(7)
|
---|
98 | %define VMX_RESTORE_HOST_GDT_NEED_WRITABLE 0100h ;RT_BIT(8)
|
---|
99 | %define VMX_RESTORE_HOST_CAN_USE_WRFSBASE_AND_WRGSBASE 0200h ;RT_BIT(9)
|
---|
100 | %define VMX_RESTORE_HOST_REQUIRED 0400h ;RT_BIT(10) - must be the highest bit!
|
---|
101 | struc VMXRESTOREHOST
|
---|
102 | .uHostSelDS resw 1
|
---|
103 | .uHostSelES resw 1
|
---|
104 | .uHostSelFS resw 1
|
---|
105 | .HostGdtr resb 10
|
---|
106 | .uHostSelGS resw 1
|
---|
107 | .uHostSelTR resw 1
|
---|
108 | .uHostSelSS resw 1
|
---|
109 | .HostGdtrRw resb 10
|
---|
110 | .uHostSelCS resw 1
|
---|
111 | .abPadding1 resb 4
|
---|
112 | .HostIdtr resb 10
|
---|
113 | alignb 8
|
---|
114 | .uHostFSBase resq 1
|
---|
115 | .uHostGSBase resq 1
|
---|
116 | endstruc
|
---|
117 |
|
---|
118 | struc HMCPUVMX
|
---|
119 | .VmcsInfo resb VMXVMCSINFOSHARED_size
|
---|
120 | .VmcsInfoNstGst resb VMXVMCSINFOSHARED_size
|
---|
121 | .fSwitchedToNstGstVmcsCopyForRing3 resb 1
|
---|
122 | .fMergedNstGstCtls resb 1
|
---|
123 | .fCopiedNstGstToShadowVmcs resb 1
|
---|
124 | .fSwitchedNstGstFlushTlb resb 1
|
---|
125 |
|
---|
126 | alignb 8
|
---|
127 | .u64GstMsrApicBase resq 1
|
---|
128 |
|
---|
129 | .LastError.idCurrentCpu resd 1
|
---|
130 | .LastError.idEnteredCpu resd 1
|
---|
131 | .LastError.HCPhysCurrentVmcs resq 1
|
---|
132 | .LastError.u32VmcsRev resd 1
|
---|
133 | .LastError.u32InstrError resd 1
|
---|
134 | .LastError.u32ExitReason resd 1
|
---|
135 | .LastError.u32GuestIntrState resd 1
|
---|
136 | endstruc
|
---|
137 |
|
---|
138 | struc HMCPUSVM
|
---|
139 | .fSyncVTpr resb 1
|
---|
140 | .fEmulateLongModeSysEnterExit resb 1
|
---|
141 |
|
---|
142 | alignb 8
|
---|
143 | .u64HostTscAux resq 1
|
---|
144 |
|
---|
145 | .NstGstVmcbCache resb 40
|
---|
146 | endstruc
|
---|
147 |
|
---|
148 | struc HMCPU
|
---|
149 | .fCheckedTLBFlush resb 1
|
---|
150 | .fActive resb 1
|
---|
151 | .fUseDebugLoop resb 1
|
---|
152 |
|
---|
153 | .fGIMTrapXcptUD resb 1
|
---|
154 | .fTrapXcptGpForLovelyMesaDrv resb 1
|
---|
155 | .fSingleInstruction resb 1
|
---|
156 | alignb 8
|
---|
157 |
|
---|
158 | .u32HMError resd 1
|
---|
159 | .rcLastExitToR3 resd 1
|
---|
160 | alignb 8
|
---|
161 | .fCtxChanged resq 1
|
---|
162 |
|
---|
163 | alignb 8
|
---|
164 | .vmx resb HMCPUVMX_size
|
---|
165 | alignb 8
|
---|
166 | .svm resb HMCPUSVM_size
|
---|
167 |
|
---|
168 | .Event.fPending resd 1
|
---|
169 | .Event.u32ErrCode resd 1
|
---|
170 | .Event.cbInstr resd 1
|
---|
171 | alignb 8
|
---|
172 | .Event.u64IntInfo resq 1
|
---|
173 | .Event.GCPtrFaultAddress RTGCPTR_RES 1
|
---|
174 |
|
---|
175 | .enmShadowMode resd 1
|
---|
176 | alignb 8
|
---|
177 | .aPdpes resq 4
|
---|
178 |
|
---|
179 | .StatVmxWriteHostRip resq 1
|
---|
180 | .StatVmxWriteHostRsp resq 1
|
---|
181 |
|
---|
182 | ; The remainer is disassembly state and statistics.
|
---|
183 | endstruc
|
---|
184 |
|
---|
185 | struc HMR0CPUVMX
|
---|
186 | .pfnStartVm RTR0PTR_RES 1
|
---|
187 |
|
---|
188 | .VmcsInfo resb VMXVMCSINFO_size
|
---|
189 | .VmcsInfoNstGst resb VMXVMCSINFO_size
|
---|
190 | .fSwitchedToNstGstVmcs resb 1
|
---|
191 |
|
---|
192 | alignb 8
|
---|
193 | .u64HostMsrLStar resq 1
|
---|
194 | .u64HostMsrStar resq 1
|
---|
195 | .u64HostMsrSfMask resq 1
|
---|
196 | .u64HostMsrKernelGsBase resq 1
|
---|
197 | .fLazyMsrs resd 1
|
---|
198 | .fUpdatedHostAutoMsrs resb 1
|
---|
199 | alignb 4
|
---|
200 | .fRestoreHostFlags resd 1
|
---|
201 | alignb 8
|
---|
202 | .RestoreHost resb VMXRESTOREHOST_size
|
---|
203 | endstruc
|
---|
204 |
|
---|
205 | struc HMR0CPUSVM
|
---|
206 | .pfnVMRun RTR0PTR_RES 1
|
---|
207 |
|
---|
208 | alignb 8
|
---|
209 | .HCPhysVmcbHost RTHCPHYS_RES 1
|
---|
210 |
|
---|
211 | alignb 8
|
---|
212 | .hMemObjVmcbHost RTR0PTR_RES 1
|
---|
213 |
|
---|
214 | alignb 8
|
---|
215 | .HCPhysVmcb RTHCPHYS_RES 1
|
---|
216 | .hMemObjVmcb RTR0PTR_RES 1
|
---|
217 | .pVmcb RTR0PTR_RES 1
|
---|
218 |
|
---|
219 | alignb 8
|
---|
220 | .HCPhysMsrBitmap RTHCPHYS_RES 1
|
---|
221 | .hMemObjMsrBitmap RTR0PTR_RES 1
|
---|
222 | .pvMsrBitmap RTR0PTR_RES 1
|
---|
223 |
|
---|
224 | .DisState resb 0d8h
|
---|
225 | endstruc
|
---|
226 |
|
---|
227 | struc 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 | .vmx resb HMR0CPUVMX_size
|
---|
244 | alignb 8
|
---|
245 | .svm resb HMR0CPUSVM_size
|
---|
246 | endstruc
|
---|
247 |
|
---|