VirtualBox

source: vbox/trunk/include/VBox/vmm/vmm.h@ 45618

Last change on this file since 45618 was 45618, checked in by vboxsync, 12 years ago

Do HMR3Init first in vmR3InitRing3 so the other components can skip raw-mode bits during init.

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