1 | /** @file
|
---|
2 | * VMM - The Virtual Machine Monitor.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2010 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_vmm_vmm_h
|
---|
27 | #define ___VBox_vmm_vmm_h
|
---|
28 |
|
---|
29 | #include <VBox/types.h>
|
---|
30 | #include <VBox/vmm/vmapi.h>
|
---|
31 | #include <VBox/sup.h>
|
---|
32 | #include <VBox/log.h>
|
---|
33 | #include <iprt/stdarg.h>
|
---|
34 |
|
---|
35 | RT_C_DECLS_BEGIN
|
---|
36 |
|
---|
37 | /** @defgroup grp_vmm The Virtual Machine Monitor API
|
---|
38 | * @{
|
---|
39 | */
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * World switcher identifiers.
|
---|
43 | */
|
---|
44 | typedef enum VMMSWITCHER
|
---|
45 | {
|
---|
46 | /** The usual invalid 0. */
|
---|
47 | VMMSWITCHER_INVALID = 0,
|
---|
48 | /** Switcher for 32-bit host to 32-bit shadow paging. */
|
---|
49 | VMMSWITCHER_32_TO_32,
|
---|
50 | /** Switcher for 32-bit host paging to PAE shadow paging. */
|
---|
51 | VMMSWITCHER_32_TO_PAE,
|
---|
52 | /** Switcher for 32-bit host paging to AMD64 shadow paging. */
|
---|
53 | VMMSWITCHER_32_TO_AMD64,
|
---|
54 | /** Switcher for PAE host to 32-bit shadow paging. */
|
---|
55 | VMMSWITCHER_PAE_TO_32,
|
---|
56 | /** Switcher for PAE host to PAE shadow paging. */
|
---|
57 | VMMSWITCHER_PAE_TO_PAE,
|
---|
58 | /** Switcher for PAE host paging to AMD64 shadow paging. */
|
---|
59 | VMMSWITCHER_PAE_TO_AMD64,
|
---|
60 | /** Switcher for AMD64 host paging to 32-bit shadow paging. */
|
---|
61 | VMMSWITCHER_AMD64_TO_32,
|
---|
62 | /** Switcher for AMD64 host paging to PAE shadow paging. */
|
---|
63 | VMMSWITCHER_AMD64_TO_PAE,
|
---|
64 | /** Switcher for AMD64 host paging to AMD64 shadow paging. */
|
---|
65 | VMMSWITCHER_AMD64_TO_AMD64,
|
---|
66 | /** Used to make a count for array declarations and suchlike. */
|
---|
67 | VMMSWITCHER_MAX,
|
---|
68 | /** The usual 32-bit paranoia. */
|
---|
69 | VMMSWITCHER_32BIT_HACK = 0x7fffffff
|
---|
70 | } VMMSWITCHER;
|
---|
71 |
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * VMMRZCallRing3 operations.
|
---|
75 | */
|
---|
76 | typedef enum VMMCALLRING3
|
---|
77 | {
|
---|
78 | /** Invalid operation. */
|
---|
79 | VMMCALLRING3_INVALID = 0,
|
---|
80 | /** Acquire the PDM lock. */
|
---|
81 | VMMCALLRING3_PDM_LOCK,
|
---|
82 | /** Acquire the critical section specified as argument. */
|
---|
83 | VMMCALLRING3_PDM_CRIT_SECT_ENTER,
|
---|
84 | /** Acquire the PGM lock. */
|
---|
85 | VMMCALLRING3_PGM_LOCK,
|
---|
86 | /** Grow the PGM shadow page pool. */
|
---|
87 | VMMCALLRING3_PGM_POOL_GROW,
|
---|
88 | /** Maps a chunk into ring-3. */
|
---|
89 | VMMCALLRING3_PGM_MAP_CHUNK,
|
---|
90 | /** Allocates more handy pages. */
|
---|
91 | VMMCALLRING3_PGM_ALLOCATE_HANDY_PAGES,
|
---|
92 | /** Allocates a large (2MB) page. */
|
---|
93 | VMMCALLRING3_PGM_ALLOCATE_LARGE_HANDY_PAGE,
|
---|
94 | /** Acquire the MM hypervisor heap lock. */
|
---|
95 | VMMCALLRING3_MMHYPER_LOCK,
|
---|
96 | /** Replay the REM handler notifications. */
|
---|
97 | VMMCALLRING3_REM_REPLAY_HANDLER_NOTIFICATIONS,
|
---|
98 | /** Flush the GC/R0 logger. */
|
---|
99 | VMMCALLRING3_VMM_LOGGER_FLUSH,
|
---|
100 | /** Set the VM error message. */
|
---|
101 | VMMCALLRING3_VM_SET_ERROR,
|
---|
102 | /** Set the VM runtime error message. */
|
---|
103 | VMMCALLRING3_VM_SET_RUNTIME_ERROR,
|
---|
104 | /** Signal a ring 0 assertion. */
|
---|
105 | VMMCALLRING3_VM_R0_ASSERTION,
|
---|
106 | /** Ring switch to force preemption. */
|
---|
107 | VMMCALLRING3_VM_R0_PREEMPT,
|
---|
108 | /** Sync the FTM state with the standby node. */
|
---|
109 | VMMCALLRING3_FTM_SET_CHECKPOINT,
|
---|
110 | /** The usual 32-bit hack. */
|
---|
111 | VMMCALLRING3_32BIT_HACK = 0x7fffffff
|
---|
112 | } VMMCALLRING3;
|
---|
113 |
|
---|
114 | /**
|
---|
115 | * VMMR3AtomicExecuteHandler callback function.
|
---|
116 | *
|
---|
117 | * @returns VBox status code.
|
---|
118 | * @param pVM Pointer to the shared VM structure.
|
---|
119 | * @param pvUser User specified argument
|
---|
120 | *
|
---|
121 | * @todo missing prefix.
|
---|
122 | */
|
---|
123 | typedef DECLCALLBACK(int) FNATOMICHANDLER(PVM pVM, void *pvUser);
|
---|
124 | /** Pointer to a FNMMATOMICHANDLER(). */
|
---|
125 | typedef FNATOMICHANDLER *PFNATOMICHANDLER;
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * Rendezvous callback.
|
---|
129 | *
|
---|
130 | * @returns VBox strict status code - EM scheduling. Do not return
|
---|
131 | * informational status code other than the ones used by EM for
|
---|
132 | * scheduling.
|
---|
133 | *
|
---|
134 | * @param pVM The VM handle.
|
---|
135 | * @param pVCpu The handle of the calling virtual CPU.
|
---|
136 | * @param pvUser The user argument.
|
---|
137 | */
|
---|
138 | typedef DECLCALLBACK(VBOXSTRICTRC) FNVMMEMTRENDEZVOUS(PVM pVM, PVMCPU pVCpu, void *pvUser);
|
---|
139 | /** Pointer to a rendezvous callback function. */
|
---|
140 | typedef FNVMMEMTRENDEZVOUS *PFNVMMEMTRENDEZVOUS;
|
---|
141 |
|
---|
142 | /**
|
---|
143 | * Method table that the VMM uses to call back the user of the VMM.
|
---|
144 | */
|
---|
145 | typedef struct VMM2USERMETHODS
|
---|
146 | {
|
---|
147 | /** Magic value (VMM2USERMETHODS_MAGIC). */
|
---|
148 | uint32_t u32Magic;
|
---|
149 | /** Structure version (VMM2USERMETHODS_VERSION). */
|
---|
150 | uint32_t u32Version;
|
---|
151 |
|
---|
152 | /**
|
---|
153 | * Save the VM state.
|
---|
154 | *
|
---|
155 | * @returns VBox status code.
|
---|
156 | * @param pThis Pointer to the callback method table.
|
---|
157 | * @param pUVM The user mode VM handle.
|
---|
158 | *
|
---|
159 | * @remarks This member shall be set to NULL if the operation is not
|
---|
160 | * supported.
|
---|
161 | */
|
---|
162 | DECLR3CALLBACKMEMBER(int, pfnSaveState,(PCVMM2USERMETHODS pThis, PUVM pUVM));
|
---|
163 | /** @todo Move pfnVMAtError and pfnCFGMConstructor here? */
|
---|
164 |
|
---|
165 | /**
|
---|
166 | * EMT initialization notification callback.
|
---|
167 | *
|
---|
168 | * This is intended for doing per-thread initialization for EMTs (like COM
|
---|
169 | * init).
|
---|
170 | *
|
---|
171 | * @param pThis Pointer to the callback method table.
|
---|
172 | * @param pUVM The user mode VM handle.
|
---|
173 | * @param pUVCpu The user mode virtual CPU handle.
|
---|
174 | *
|
---|
175 | * @remarks This is optional and shall be set to NULL if not wanted.
|
---|
176 | */
|
---|
177 | DECLR3CALLBACKMEMBER(void, pfnNotifyEmtInit,(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu));
|
---|
178 |
|
---|
179 | /**
|
---|
180 | * EMT termination notification callback.
|
---|
181 | *
|
---|
182 | * This is intended for doing per-thread cleanups for EMTs (like COM).
|
---|
183 | *
|
---|
184 | * @param pThis Pointer to the callback method table.
|
---|
185 | * @param pUVM The user mode VM handle.
|
---|
186 | * @param pUVCpu The user mode virtual CPU handle.
|
---|
187 | *
|
---|
188 | * @remarks This is optional and shall be set to NULL if not wanted.
|
---|
189 | */
|
---|
190 | DECLR3CALLBACKMEMBER(void, pfnNotifyEmtTerm,(PCVMM2USERMETHODS pThis, PUVM pUVM, PUVMCPU pUVCpu));
|
---|
191 |
|
---|
192 | /**
|
---|
193 | * PDM thread initialization notification callback.
|
---|
194 | *
|
---|
195 | * This is intended for doing per-thread initialization (like COM init).
|
---|
196 | *
|
---|
197 | * @param pThis Pointer to the callback method table.
|
---|
198 | * @param pUVM The user mode VM handle.
|
---|
199 | *
|
---|
200 | * @remarks This is optional and shall be set to NULL if not wanted.
|
---|
201 | */
|
---|
202 | DECLR3CALLBACKMEMBER(void, pfnNotifyPdmtInit,(PCVMM2USERMETHODS pThis, PUVM pUVM));
|
---|
203 |
|
---|
204 | /**
|
---|
205 | * EMT termination notification callback.
|
---|
206 | *
|
---|
207 | * This is intended for doing per-thread cleanups for EMTs (like COM).
|
---|
208 | *
|
---|
209 | * @param pThis Pointer to the callback method table.
|
---|
210 | * @param pUVM The user mode VM handle.
|
---|
211 | *
|
---|
212 | * @remarks This is optional and shall be set to NULL if not wanted.
|
---|
213 | */
|
---|
214 | DECLR3CALLBACKMEMBER(void, pfnNotifyPdmtTerm,(PCVMM2USERMETHODS pThis, PUVM pUVM));
|
---|
215 |
|
---|
216 | /** Magic value (VMM2USERMETHODS_MAGIC) marking the end of the structure. */
|
---|
217 | uint32_t u32EndMagic;
|
---|
218 | } VMM2USERMETHODS;
|
---|
219 |
|
---|
220 | /** Magic value of the VMM2USERMETHODS (Franz Kafka). */
|
---|
221 | #define VMM2USERMETHODS_MAGIC UINT32_C(0x18830703)
|
---|
222 | /** The VMM2USERMETHODS structure version. */
|
---|
223 | #define VMM2USERMETHODS_VERSION UINT32_C(0x00020000)
|
---|
224 |
|
---|
225 |
|
---|
226 | VMMDECL(RTRCPTR) VMMGetStackRC(PVMCPU pVCpu);
|
---|
227 | VMMDECL(VMCPUID) VMMGetCpuId(PVM pVM);
|
---|
228 | VMMDECL(PVMCPU) VMMGetCpu(PVM pVM);
|
---|
229 | VMMDECL(PVMCPU) VMMGetCpu0(PVM pVM);
|
---|
230 | VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, VMCPUID idCpu);
|
---|
231 | VMMDECL(uint32_t) VMMGetSvnRev(void);
|
---|
232 | VMMDECL(VMMSWITCHER) VMMGetSwitcher(PVM pVM);
|
---|
233 | VMMDECL(void) VMMTrashVolatileXMMRegs(void);
|
---|
234 |
|
---|
235 | /** @def VMMIsHwVirtExtForced
|
---|
236 | * Checks if forced to use the hardware assisted virtualization extensions.
|
---|
237 | *
|
---|
238 | * This is intended for making setup decisions where we can save resources when
|
---|
239 | * using hardware assisted virtualization.
|
---|
240 | *
|
---|
241 | * @returns true / false.
|
---|
242 | * @param pVM Pointer to the shared VM structure.
|
---|
243 | */
|
---|
244 | #define VMMIsHwVirtExtForced(pVM) ((pVM)->fHwVirtExtForced)
|
---|
245 |
|
---|
246 |
|
---|
247 | #ifdef IN_RING3
|
---|
248 | /** @defgroup grp_vmm_r3 The VMM Host Context Ring 3 API
|
---|
249 | * @ingroup grp_vmm
|
---|
250 | * @{
|
---|
251 | */
|
---|
252 | VMMR3_INT_DECL(int) VMMR3Init(PVM pVM);
|
---|
253 | VMMR3_INT_DECL(int) VMMR3InitR0(PVM pVM);
|
---|
254 | VMMR3_INT_DECL(int) VMMR3InitRC(PVM pVM);
|
---|
255 | VMMR3_INT_DECL(int) VMMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat);
|
---|
256 | VMMR3_INT_DECL(int) VMMR3Term(PVM pVM);
|
---|
257 | VMMR3_INT_DECL(void) VMMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
|
---|
258 | VMMR3_INT_DECL(int) VMMR3UpdateLoggers(PVM pVM);
|
---|
259 | VMMR3DECL(const char *) VMMR3GetRZAssertMsg1(PVM pVM);
|
---|
260 | VMMR3DECL(const char *) VMMR3GetRZAssertMsg2(PVM pVM);
|
---|
261 | VMMR3_INT_DECL(int) VMMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
|
---|
262 | VMMR3_INT_DECL(int) VMMR3SelectSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
|
---|
263 | VMMR3_INT_DECL(int) VMMR3DisableSwitcher(PVM pVM);
|
---|
264 | VMMR3_INT_DECL(RTR0PTR) VMMR3GetHostToGuestSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
|
---|
265 | VMMR3_INT_DECL(int) VMMR3RawRunGC(PVM pVM, PVMCPU pVCpu);
|
---|
266 | VMMR3_INT_DECL(int) VMMR3HmRunGC(PVM pVM, PVMCPU pVCpu);
|
---|
267 | VMMR3DECL(int) VMMR3CallRC(PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, ...);
|
---|
268 | VMMR3DECL(int) VMMR3CallRCV(PVM pVM, RTRCPTR RCPtrEntry, unsigned cArgs, va_list args);
|
---|
269 | VMMR3DECL(int) VMMR3CallR0(PVM pVM, uint32_t uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr);
|
---|
270 | VMMR3DECL(int) VMMR3ResumeHyper(PVM pVM, PVMCPU pVCpu);
|
---|
271 | VMMR3DECL(void) VMMR3FatalDump(PVM pVM, PVMCPU pVCpu, int rcErr);
|
---|
272 | VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM);
|
---|
273 | VMMR3_INT_DECL(void) VMMR3YieldStop(PVM pVM);
|
---|
274 | VMMR3_INT_DECL(void) VMMR3YieldResume(PVM pVM);
|
---|
275 | VMMR3_INT_DECL(void) VMMR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector);
|
---|
276 | VMMR3_INT_DECL(void) VMMR3SendInitIpi(PVM pVM, VMCPUID idCpu);
|
---|
277 | VMMR3DECL(int) VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
|
---|
278 | VMMR3DECL(int) VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
|
---|
279 | VMMR3DECL(int) VMMR3EmtRendezvous(PVM pVM, uint32_t fFlags, PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser);
|
---|
280 | VMMR3_INT_DECL(bool) VMMR3EmtRendezvousSetDisabled(PVMCPU pVCpu, bool fDisabled);
|
---|
281 | /** @defgroup grp_VMMR3EmtRendezvous_fFlags VMMR3EmtRendezvous flags
|
---|
282 | * @{ */
|
---|
283 | /** Execution type mask. */
|
---|
284 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_MASK UINT32_C(0x00000007)
|
---|
285 | /** Invalid execution type. */
|
---|
286 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_INVALID UINT32_C(0)
|
---|
287 | /** Let the EMTs execute the callback one by one (in no particular order). */
|
---|
288 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_ONE_BY_ONE UINT32_C(1)
|
---|
289 | /** Let all the EMTs execute the callback at the same time. */
|
---|
290 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE UINT32_C(2)
|
---|
291 | /** Only execute the callback on one EMT (no particular one). */
|
---|
292 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE UINT32_C(3)
|
---|
293 | /** Let the EMTs execute the callback one by one in ascending order. */
|
---|
294 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_ASCENDING UINT32_C(4)
|
---|
295 | /** Let the EMTs execute the callback one by one in descending order. */
|
---|
296 | #define VMMEMTRENDEZVOUS_FLAGS_TYPE_DESCENDING UINT32_C(5)
|
---|
297 | /** Stop after the first error.
|
---|
298 | * This is not valid for any execution type where more than one EMT is active
|
---|
299 | * at a time. */
|
---|
300 | #define VMMEMTRENDEZVOUS_FLAGS_STOP_ON_ERROR UINT32_C(0x00000008)
|
---|
301 | /** The valid flags. */
|
---|
302 | #define VMMEMTRENDEZVOUS_FLAGS_VALID_MASK UINT32_C(0x0000000f)
|
---|
303 | /** @} */
|
---|
304 | VMMR3_INT_DECL(int) VMMR3EmtRendezvousFF(PVM pVM, PVMCPU pVCpu);
|
---|
305 | VMMR3_INT_DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR R0Addr, void *pvBuf, size_t cbRead);
|
---|
306 | /** @} */
|
---|
307 | #endif /* IN_RING3 */
|
---|
308 |
|
---|
309 |
|
---|
310 | /** @defgroup grp_vmm_r0 The VMM Host Context Ring 0 API
|
---|
311 | * @ingroup grp_vmm
|
---|
312 | * @{
|
---|
313 | */
|
---|
314 |
|
---|
315 | /**
|
---|
316 | * The VMMR0Entry() codes.
|
---|
317 | */
|
---|
318 | typedef enum VMMR0OPERATION
|
---|
319 | {
|
---|
320 | /** Run guest context. */
|
---|
321 | VMMR0_DO_RAW_RUN = SUP_VMMR0_DO_RAW_RUN,
|
---|
322 | /** Run guest code using the available hardware acceleration technology. */
|
---|
323 | VMMR0_DO_HM_RUN = SUP_VMMR0_DO_HM_RUN,
|
---|
324 | /** Official NOP that we use for profiling. */
|
---|
325 | VMMR0_DO_NOP = SUP_VMMR0_DO_NOP,
|
---|
326 | /** Official slow iocl NOP that we use for profiling. */
|
---|
327 | VMMR0_DO_SLOW_NOP,
|
---|
328 |
|
---|
329 | /** Ask the GVMM to create a new VM. */
|
---|
330 | VMMR0_DO_GVMM_CREATE_VM,
|
---|
331 | /** Ask the GVMM to destroy the VM. */
|
---|
332 | VMMR0_DO_GVMM_DESTROY_VM,
|
---|
333 | /** Call GVMMR0SchedHalt(). */
|
---|
334 | VMMR0_DO_GVMM_SCHED_HALT,
|
---|
335 | /** Call GVMMR0SchedWakeUp(). */
|
---|
336 | VMMR0_DO_GVMM_SCHED_WAKE_UP,
|
---|
337 | /** Call GVMMR0SchedPoke(). */
|
---|
338 | VMMR0_DO_GVMM_SCHED_POKE,
|
---|
339 | /** Call GVMMR0SchedWakeUpAndPokeCpus(). */
|
---|
340 | VMMR0_DO_GVMM_SCHED_WAKE_UP_AND_POKE_CPUS,
|
---|
341 | /** Call GVMMR0SchedPoll(). */
|
---|
342 | VMMR0_DO_GVMM_SCHED_POLL,
|
---|
343 | /** Call GVMMR0QueryStatistics(). */
|
---|
344 | VMMR0_DO_GVMM_QUERY_STATISTICS,
|
---|
345 | /** Call GVMMR0ResetStatistics(). */
|
---|
346 | VMMR0_DO_GVMM_RESET_STATISTICS,
|
---|
347 | /** Call GVMMR0RegisterVCpu(). */
|
---|
348 | VMMR0_DO_GVMM_REGISTER_VMCPU,
|
---|
349 |
|
---|
350 | /** Call VMMR0 Per VM Init. */
|
---|
351 | VMMR0_DO_VMMR0_INIT,
|
---|
352 | /** Call VMMR0 Per VM Termination. */
|
---|
353 | VMMR0_DO_VMMR0_TERM,
|
---|
354 | /** Setup the hardware accelerated raw-mode session. */
|
---|
355 | VMMR0_DO_HM_SETUP_VM,
|
---|
356 | /** Attempt to enable or disable hardware accelerated raw-mode. */
|
---|
357 | VMMR0_DO_HM_ENABLE,
|
---|
358 | /** Calls function in the hypervisor.
|
---|
359 | * The caller must setup the hypervisor context so the call will be performed.
|
---|
360 | * The difference between VMMR0_DO_RUN_GC and this one is the handling of
|
---|
361 | * the return GC code. The return code will not be interpreted by this operation.
|
---|
362 | */
|
---|
363 | VMMR0_DO_CALL_HYPERVISOR,
|
---|
364 |
|
---|
365 | /** Call PGMR0PhysAllocateHandyPages(). */
|
---|
366 | VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES,
|
---|
367 | /** Call PGMR0PhysFlushHandyPages(). */
|
---|
368 | VMMR0_DO_PGM_FLUSH_HANDY_PAGES,
|
---|
369 | /** Call PGMR0AllocateLargePage(). */
|
---|
370 | VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE,
|
---|
371 | /** Call PGMR0PhysSetupIommu(). */
|
---|
372 | VMMR0_DO_PGM_PHYS_SETUP_IOMMU,
|
---|
373 |
|
---|
374 | /** Call GMMR0InitialReservation(). */
|
---|
375 | VMMR0_DO_GMM_INITIAL_RESERVATION,
|
---|
376 | /** Call GMMR0UpdateReservation(). */
|
---|
377 | VMMR0_DO_GMM_UPDATE_RESERVATION,
|
---|
378 | /** Call GMMR0AllocatePages(). */
|
---|
379 | VMMR0_DO_GMM_ALLOCATE_PAGES,
|
---|
380 | /** Call GMMR0FreePages(). */
|
---|
381 | VMMR0_DO_GMM_FREE_PAGES,
|
---|
382 | /** Call GMMR0FreeLargePage(). */
|
---|
383 | VMMR0_DO_GMM_FREE_LARGE_PAGE,
|
---|
384 | /** Call GMMR0QueryHypervisorMemoryStatsReq(). */
|
---|
385 | VMMR0_DO_GMM_QUERY_HYPERVISOR_MEM_STATS,
|
---|
386 | /** Call GMMR0QueryMemoryStatsReq(). */
|
---|
387 | VMMR0_DO_GMM_QUERY_MEM_STATS,
|
---|
388 | /** Call GMMR0BalloonedPages(). */
|
---|
389 | VMMR0_DO_GMM_BALLOONED_PAGES,
|
---|
390 | /** Call GMMR0MapUnmapChunk(). */
|
---|
391 | VMMR0_DO_GMM_MAP_UNMAP_CHUNK,
|
---|
392 | /** Call GMMR0SeedChunk(). */
|
---|
393 | VMMR0_DO_GMM_SEED_CHUNK,
|
---|
394 | /** Call GMMR0RegisterSharedModule. */
|
---|
395 | VMMR0_DO_GMM_REGISTER_SHARED_MODULE,
|
---|
396 | /** Call GMMR0UnregisterSharedModule. */
|
---|
397 | VMMR0_DO_GMM_UNREGISTER_SHARED_MODULE,
|
---|
398 | /** Call GMMR0ResetSharedModules. */
|
---|
399 | VMMR0_DO_GMM_RESET_SHARED_MODULES,
|
---|
400 | /** Call GMMR0CheckSharedModules. */
|
---|
401 | VMMR0_DO_GMM_CHECK_SHARED_MODULES,
|
---|
402 | /** Call GMMR0FindDuplicatePage. */
|
---|
403 | VMMR0_DO_GMM_FIND_DUPLICATE_PAGE,
|
---|
404 | /** Call GMMR0QueryStatistics(). */
|
---|
405 | VMMR0_DO_GMM_QUERY_STATISTICS,
|
---|
406 | /** Call GMMR0ResetStatistics(). */
|
---|
407 | VMMR0_DO_GMM_RESET_STATISTICS,
|
---|
408 |
|
---|
409 | /** Set a GVMM or GMM configuration value. */
|
---|
410 | VMMR0_DO_GCFGM_SET_VALUE,
|
---|
411 | /** Query a GVMM or GMM configuration value. */
|
---|
412 | VMMR0_DO_GCFGM_QUERY_VALUE,
|
---|
413 |
|
---|
414 | /** Call PDMR0DriverCallReqHandler. */
|
---|
415 | VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER,
|
---|
416 | /** Call PDMR0DeviceCallReqHandler. */
|
---|
417 | VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER,
|
---|
418 |
|
---|
419 | /** The start of the R0 service operations. */
|
---|
420 | VMMR0_DO_SRV_START,
|
---|
421 | /** Call IntNetR0Open(). */
|
---|
422 | VMMR0_DO_INTNET_OPEN,
|
---|
423 | /** Call IntNetR0IfClose(). */
|
---|
424 | VMMR0_DO_INTNET_IF_CLOSE,
|
---|
425 | /** Call IntNetR0IfGetBufferPtrs(). */
|
---|
426 | VMMR0_DO_INTNET_IF_GET_BUFFER_PTRS,
|
---|
427 | /** Call IntNetR0IfSetPromiscuousMode(). */
|
---|
428 | VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE,
|
---|
429 | /** Call IntNetR0IfSetMacAddress(). */
|
---|
430 | VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS,
|
---|
431 | /** Call IntNetR0IfSetActive(). */
|
---|
432 | VMMR0_DO_INTNET_IF_SET_ACTIVE,
|
---|
433 | /** Call IntNetR0IfSend(). */
|
---|
434 | VMMR0_DO_INTNET_IF_SEND,
|
---|
435 | /** Call IntNetR0IfWait(). */
|
---|
436 | VMMR0_DO_INTNET_IF_WAIT,
|
---|
437 | /** Call IntNetR0IfAbortWait(). */
|
---|
438 | VMMR0_DO_INTNET_IF_ABORT_WAIT,
|
---|
439 |
|
---|
440 | /** Forward call to the PCI driver */
|
---|
441 | VMMR0_DO_PCIRAW_REQ,
|
---|
442 |
|
---|
443 | /** The end of the R0 service operations. */
|
---|
444 | VMMR0_DO_SRV_END,
|
---|
445 |
|
---|
446 | /** Official call we use for testing Ring-0 APIs. */
|
---|
447 | VMMR0_DO_TESTS,
|
---|
448 | /** Test the 32->64 bits switcher. */
|
---|
449 | VMMR0_DO_TEST_SWITCHER3264,
|
---|
450 |
|
---|
451 | /** The usual 32-bit type blow up. */
|
---|
452 | VMMR0_DO_32BIT_HACK = 0x7fffffff
|
---|
453 | } VMMR0OPERATION;
|
---|
454 |
|
---|
455 |
|
---|
456 | /**
|
---|
457 | * Request buffer for VMMR0_DO_GCFGM_SET_VALUE and VMMR0_DO_GCFGM_QUERY_VALUE.
|
---|
458 | * @todo Move got GCFGM.h when it's implemented.
|
---|
459 | */
|
---|
460 | typedef struct GCFGMVALUEREQ
|
---|
461 | {
|
---|
462 | /** The request header.*/
|
---|
463 | SUPVMMR0REQHDR Hdr;
|
---|
464 | /** The support driver session handle. */
|
---|
465 | PSUPDRVSESSION pSession;
|
---|
466 | /** The value.
|
---|
467 | * This is input for the set request and output for the query. */
|
---|
468 | uint64_t u64Value;
|
---|
469 | /** The variable name.
|
---|
470 | * This is fixed sized just to make things simple for the mock-up. */
|
---|
471 | char szName[48];
|
---|
472 | } GCFGMVALUEREQ;
|
---|
473 | /** Pointer to a VMMR0_DO_GCFGM_SET_VALUE and VMMR0_DO_GCFGM_QUERY_VALUE request buffer.
|
---|
474 | * @todo Move got GCFGM.h when it's implemented.
|
---|
475 | */
|
---|
476 | typedef GCFGMVALUEREQ *PGCFGMVALUEREQ;
|
---|
477 |
|
---|
478 | VMMR0DECL(int) VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg);
|
---|
479 | VMMR0DECL(void) VMMR0EntryFast(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation);
|
---|
480 | VMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION);
|
---|
481 | VMMR0DECL(int) VMMR0TermVM(PVM pVM, PGVM pGVM);
|
---|
482 |
|
---|
483 | #ifdef LOG_ENABLED
|
---|
484 | VMMR0DECL(void) VMMR0LogFlushDisable(PVMCPU pVCpu);
|
---|
485 | VMMR0DECL(void) VMMR0LogFlushEnable(PVMCPU pVCpu);
|
---|
486 | VMMR0DECL(bool) VMMR0IsLogFlushDisabled(PVMCPU pVCpu);
|
---|
487 | #else
|
---|
488 | #define VMMR0LogFlushDisable(pVCpu) do { } while(0)
|
---|
489 | #define VMMR0LogFlushEnable(pVCpu) do { } while(0)
|
---|
490 | #define VMMR0IsLogFlushDisabled(pVCpu) (true)
|
---|
491 | #endif
|
---|
492 |
|
---|
493 | /** @} */
|
---|
494 |
|
---|
495 |
|
---|
496 | #ifdef IN_RC
|
---|
497 | /** @defgroup grp_vmm_rc The VMM Raw-Mode Context API
|
---|
498 | * @ingroup grp_vmm
|
---|
499 | * @{
|
---|
500 | */
|
---|
501 | VMMRCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg, ...);
|
---|
502 | VMMRCDECL(void) VMMGCGuestToHost(PVM pVM, int rc);
|
---|
503 | VMMRCDECL(void) VMMGCLogFlushIfFull(PVM pVM);
|
---|
504 | /** @} */
|
---|
505 | #endif /* IN_RC */
|
---|
506 |
|
---|
507 | #if defined(IN_RC) || defined(IN_RING0)
|
---|
508 | /** @defgroup grp_vmm_rz The VMM Raw-Mode and Ring-0 Context API
|
---|
509 | * @ingroup grp_vmm
|
---|
510 | * @{
|
---|
511 | */
|
---|
512 | VMMRZDECL(int) VMMRZCallRing3(PVM pVM, PVMCPU pVCpu, VMMCALLRING3 enmOperation, uint64_t uArg);
|
---|
513 | VMMRZDECL(int) VMMRZCallRing3NoCpu(PVM pVM, VMMCALLRING3 enmOperation, uint64_t uArg);
|
---|
514 | VMMRZDECL(void) VMMRZCallRing3Disable(PVMCPU pVCpu);
|
---|
515 | VMMRZDECL(void) VMMRZCallRing3Enable(PVMCPU pVCpu);
|
---|
516 | VMMRZDECL(bool) VMMRZCallRing3IsEnabled(PVMCPU pVCpu);
|
---|
517 | /** @} */
|
---|
518 | #endif
|
---|
519 |
|
---|
520 |
|
---|
521 | /** @} */
|
---|
522 | RT_C_DECLS_END
|
---|
523 |
|
---|
524 | #endif
|
---|