VirtualBox

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

Last change on this file since 41147 was 41147, checked in by vboxsync, 13 years ago

SUPDrv,VMM: Tracepoints in raw-mode.

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