VirtualBox

source: vbox/trunk/include/VBox/vmm/vmapi.h@ 72619

Last change on this file since 72619 was 72327, checked in by vboxsync, 7 years ago

VMM: Expose VM::bMainExecutionEngine thru external API EMR3QueryMainExecutionEngine. bugref:9044

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.1 KB
Line 
1/** @file
2 * VM - The Virtual Machine, API.
3 */
4
5/*
6 * Copyright (C) 2006-2017 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_vmapi_h
27#define ___VBox_vmm_vmapi_h
28
29#include <VBox/types.h>
30#include <VBox/vmm/stam.h>
31#include <VBox/vmm/cfgm.h>
32
33#include <iprt/stdarg.h>
34
35RT_C_DECLS_BEGIN
36
37/** @defgroup grp_vm_apis VM All Contexts API
38 * @ingroup grp_vm
39 * @{ */
40
41/** @name VM_EXEC_ENGINE_XXX - VM::bMainExecutionEngine values.
42 * @sa EMR3QueryMainExecutionEngine, VM_IS_RAW_MODE_ENABLED, VM_IS_HM_ENABLED,
43 * VM_IS_HM_OR_NEM_ENABLED, VM_IS_NEM_ENABLED, VM_SET_MAIN_EXECUTION_ENGINE
44 * @{ */
45/** Has not yet been set. */
46#define VM_EXEC_ENGINE_NOT_SET UINT8_C(0)
47/** Raw-mode. */
48#define VM_EXEC_ENGINE_RAW_MODE UINT8_C(1)
49/** Hardware assisted virtualization thru HM. */
50#define VM_EXEC_ENGINE_HW_VIRT UINT8_C(2)
51/** Hardware assisted virtualization thru native API (NEM). */
52#define VM_EXEC_ENGINE_NATIVE_API UINT8_C(3)
53/** @} */
54
55
56/** @def VM_RC_ADDR
57 * Converts a current context address of data within the VM structure to the equivalent
58 * raw-mode address.
59 *
60 * @returns raw-mode virtual address.
61 * @param pVM The cross context VM structure.
62 * @param pvInVM CC Pointer within the VM.
63 */
64#ifdef IN_RING3
65# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
66#elif defined(IN_RING0)
67# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)((RTRCUINTPTR)pVM->pVMRC + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
68#else
69# define VM_RC_ADDR(pVM, pvInVM) ( (RTRCPTR)(pvInVM) )
70#endif
71
72/** @def VM_R3_ADDR
73 * Converts a current context address of data within the VM structure to the equivalent
74 * ring-3 host address.
75 *
76 * @returns host virtual address.
77 * @param pVM The cross context VM structure.
78 * @param pvInVM CC pointer within the VM.
79 */
80#ifdef IN_RC
81# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
82#elif defined(IN_RING0)
83# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)((RTR3UINTPTR)pVM->pVMR3 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR0)) )
84#else
85# define VM_R3_ADDR(pVM, pvInVM) ( (RTR3PTR)(pvInVM) )
86#endif
87
88
89/** @def VM_R0_ADDR
90 * Converts a current context address of data within the VM structure to the equivalent
91 * ring-0 host address.
92 *
93 * @returns host virtual address.
94 * @param pVM The cross context VM structure.
95 * @param pvInVM CC pointer within the VM.
96 */
97#ifdef IN_RC
98# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMRC)) )
99#elif defined(IN_RING3)
100# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)((RTR0UINTPTR)pVM->pVMR0 + (uint32_t)((uintptr_t)(pvInVM) - (uintptr_t)pVM->pVMR3)) )
101#else
102# define VM_R0_ADDR(pVM, pvInVM) ( (RTR0PTR)(pvInVM) )
103#endif
104
105
106
107/**
108 * VM error callback function.
109 *
110 * @param pUVM The user mode VM handle. Can be NULL if an error
111 * occurred before successfully creating a VM.
112 * @param pvUser The user argument.
113 * @param rc VBox status code.
114 * @param SRC_POS The source position arguments. See RT_SRC_POS and RT_SRC_POS_ARGS.
115 * @param pszFormat Error message format string.
116 * @param args Error message arguments.
117 */
118typedef DECLCALLBACK(void) FNVMATERROR(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszError, va_list args);
119/** Pointer to a VM error callback. */
120typedef FNVMATERROR *PFNVMATERROR;
121
122VMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
123VMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(6, 7);
124
125/** @def VM_SET_ERROR
126 * Macro for setting a simple VM error message.
127 * Don't use '%' in the message!
128 *
129 * @returns rc. Meaning you can do:
130 * @code
131 * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
132 * @endcode
133 * @param pVM The cross context VM structure.
134 * @param rc VBox status code.
135 * @param pszMessage Error message string.
136 * @thread Any
137 */
138#define VM_SET_ERROR(pVM, rc, pszMessage) (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
139
140/** @def VM_SET_ERROR
141 * Macro for setting a simple VM error message.
142 * Don't use '%' in the message!
143 *
144 * @returns rc. Meaning you can do:
145 * @code
146 * return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
147 * @endcode
148 * @param pVM The cross context VM structure.
149 * @param rc VBox status code.
150 * @param pszMessage Error message string.
151 * @thread Any
152 */
153#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage) (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
154
155
156/**
157 * VM runtime error callback function.
158 *
159 * See VMSetRuntimeError for the detailed description of parameters.
160 *
161 * @param pUVM The user mode VM handle.
162 * @param pvUser The user argument.
163 * @param fFlags The error flags.
164 * @param pszErrorId Error ID string.
165 * @param pszFormat Error message format string.
166 * @param va Error message arguments.
167 */
168typedef DECLCALLBACK(void) FNVMATRUNTIMEERROR(PUVM pUVM, void *pvUser, uint32_t fFlags, const char *pszErrorId,
169 const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(5, 0);
170/** Pointer to a VM runtime error callback. */
171typedef FNVMATRUNTIMEERROR *PFNVMATRUNTIMEERROR;
172
173VMMDECL(int) VMSetRuntimeError(PVM pVM, uint32_t fFlags, const char *pszErrorId,
174 const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5);
175VMMDECL(int) VMSetRuntimeErrorV(PVM pVM, uint32_t fFlags, const char *pszErrorId,
176 const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(4, 0);
177
178/** @name VMSetRuntimeError fFlags
179 * When no flags are given the VM will continue running and it's up to the front
180 * end to take action on the error condition.
181 *
182 * @{ */
183/** The error is fatal.
184 * The VM is not in a state where it can be saved and will enter a state
185 * where it can no longer execute code. The caller <b>must</b> propagate status
186 * codes. */
187#define VMSETRTERR_FLAGS_FATAL RT_BIT_32(0)
188/** Suspend the VM after, or if possible before, raising the error on EMT. The
189 * caller <b>must</b> propagate status codes. */
190#define VMSETRTERR_FLAGS_SUSPEND RT_BIT_32(1)
191/** Don't wait for the EMT to handle the request.
192 * Only valid when on a worker thread and there is a high risk of a dead
193 * lock. Be careful not to flood the user with errors. */
194#define VMSETRTERR_FLAGS_NO_WAIT RT_BIT_32(2)
195/** @} */
196
197/**
198 * VM state change callback function.
199 *
200 * You are not allowed to call any function which changes the VM state from a
201 * state callback, except VMR3Destroy().
202 *
203 * @param pUVM The user mode VM handle.
204 * @param enmState The new state.
205 * @param enmOldState The old state.
206 * @param pvUser The user argument.
207 */
208typedef DECLCALLBACK(void) FNVMATSTATE(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
209/** Pointer to a VM state callback. */
210typedef FNVMATSTATE *PFNVMATSTATE;
211
212VMMDECL(const char *) VMGetStateName(VMSTATE enmState);
213
214
215/**
216 * Request type.
217 */
218typedef enum VMREQTYPE
219{
220 /** Invalid request. */
221 VMREQTYPE_INVALID = 0,
222 /** VM: Internal. */
223 VMREQTYPE_INTERNAL,
224 /** Maximum request type (exclusive). Used for validation. */
225 VMREQTYPE_MAX
226} VMREQTYPE;
227
228/**
229 * Request state.
230 */
231typedef enum VMREQSTATE
232{
233 /** The state is invalid. */
234 VMREQSTATE_INVALID = 0,
235 /** The request have been allocated and is in the process of being filed. */
236 VMREQSTATE_ALLOCATED,
237 /** The request is queued by the requester. */
238 VMREQSTATE_QUEUED,
239 /** The request is begin processed. */
240 VMREQSTATE_PROCESSING,
241 /** The request is completed, the requester is begin notified. */
242 VMREQSTATE_COMPLETED,
243 /** The request packet is in the free chain. (The requester */
244 VMREQSTATE_FREE
245} VMREQSTATE;
246
247/**
248 * Request flags.
249 */
250typedef enum VMREQFLAGS
251{
252 /** The request returns a VBox status code. */
253 VMREQFLAGS_VBOX_STATUS = 0,
254 /** The request is a void request and have no status code. */
255 VMREQFLAGS_VOID = 1,
256 /** Return type mask. */
257 VMREQFLAGS_RETURN_MASK = 1,
258 /** Caller does not wait on the packet, EMT will free it. */
259 VMREQFLAGS_NO_WAIT = 2,
260 /** Poke the destination EMT(s) if executing guest code. Use with care. */
261 VMREQFLAGS_POKE = 4,
262 /** Priority request that can safely be processed while doing async
263 * suspend and power off. */
264 VMREQFLAGS_PRIORITY = 8
265} VMREQFLAGS;
266
267
268/**
269 * VM Request packet.
270 *
271 * This is used to request an action in the EMT. Usually the requester is
272 * another thread, but EMT can also end up being the requester in which case
273 * it's carried out synchronously.
274 */
275typedef struct VMREQ
276{
277 /** Pointer to the next request in the chain. */
278 struct VMREQ * volatile pNext;
279 /** Pointer to ring-3 VM structure which this request belongs to. */
280 PUVM pUVM;
281 /** Request state. */
282 volatile VMREQSTATE enmState;
283 /** VBox status code for the completed request. */
284 volatile int32_t iStatus;
285 /** Requester event sem.
286 * The request can use this event semaphore to wait/poll for completion
287 * of the request.
288 */
289 RTSEMEVENT EventSem;
290 /** Set if the event semaphore is clear. */
291 volatile bool fEventSemClear;
292 /** Flags, VMR3REQ_FLAGS_*. */
293 unsigned fFlags;
294 /** Request type. */
295 VMREQTYPE enmType;
296 /** Request destination. */
297 VMCPUID idDstCpu;
298 /** Request specific data. */
299 union VMREQ_U
300 {
301 /** VMREQTYPE_INTERNAL. */
302 struct
303 {
304 /** Pointer to the function to be called. */
305 PFNRT pfn;
306 /** Number of arguments. */
307 unsigned cArgs;
308 /** Array of arguments. */
309 uintptr_t aArgs[64];
310 } Internal;
311 } u;
312} VMREQ;
313/** Pointer to a VM request packet. */
314typedef VMREQ *PVMREQ;
315
316/** @} */
317
318
319#ifndef IN_RC
320/** @defgroup grp_vmm_apis_hc VM Host Context API
321 * @ingroup grp_vm
322 * @{ */
323
324/** @} */
325#endif
326
327
328#ifdef IN_RING3
329/** @defgroup grp_vmm_apis_r3 VM Host Context Ring 3 API
330 * This interface is a _draft_!
331 * @ingroup grp_vm
332 * @{ */
333
334/**
335 * Completion notification codes.
336 */
337typedef enum VMINITCOMPLETED
338{
339 /** The ring-3 init is completed. */
340 VMINITCOMPLETED_RING3 = 1,
341 /** The ring-0 init is completed. */
342 VMINITCOMPLETED_RING0,
343 /** The hardware accelerated virtualization init is completed.
344 * Used to make decisision depending on HM* bits being completely
345 * initialized. */
346 VMINITCOMPLETED_HM,
347 /** The RC init is completed. */
348 VMINITCOMPLETED_RC
349} VMINITCOMPLETED;
350
351
352/** Reason for VM resume. */
353typedef enum VMRESUMEREASON
354{
355 VMRESUMEREASON_INVALID = 0,
356 /** User decided to do so. */
357 VMRESUMEREASON_USER,
358 /** VM reconfiguration (like changing DVD). */
359 VMRESUMEREASON_RECONFIG,
360 /** The host resumed. */
361 VMRESUMEREASON_HOST_RESUME,
362 /** Restored state. */
363 VMRESUMEREASON_STATE_RESTORED,
364 /** Snapshot / saved state. */
365 VMRESUMEREASON_STATE_SAVED,
366 /** Teleported to a new box / instance. */
367 VMRESUMEREASON_TELEPORTED,
368 /** Teleportation failed. */
369 VMRESUMEREASON_TELEPORT_FAILED,
370 /** FTM temporarily suspended the VM. */
371 VMRESUMEREASON_FTM_SYNC,
372 /** End of valid reasons. */
373 VMRESUMEREASON_END,
374 /** Blow the type up to 32-bits. */
375 VMRESUMEREASON_32BIT_HACK = 0x7fffffff
376} VMRESUMEREASON;
377
378/** Reason for VM suspend. */
379typedef enum VMSUSPENDREASON
380{
381 VMSUSPENDREASON_INVALID = 0,
382 /** User decided to do so. */
383 VMSUSPENDREASON_USER,
384 /** VM reconfiguration (like changing DVD). */
385 VMSUSPENDREASON_RECONFIG,
386 /** The VM is suspending itself. */
387 VMSUSPENDREASON_VM,
388 /** The Vm is suspending because of a runtime error. */
389 VMSUSPENDREASON_RUNTIME_ERROR,
390 /** The host was suspended. */
391 VMSUSPENDREASON_HOST_SUSPEND,
392 /** The host is running low on battery power. */
393 VMSUSPENDREASON_HOST_BATTERY_LOW,
394 /** FTM is temporarily suspending the VM. */
395 VMSUSPENDREASON_FTM_SYNC,
396 /** End of valid reasons. */
397 VMSUSPENDREASON_END,
398 /** Blow the type up to 32-bits. */
399 VMSUSPENDREASON_32BIT_HACK = 0x7fffffff
400} VMSUSPENDREASON;
401
402
403/**
404 * Progress callback.
405 *
406 * This will report the completion percentage of an operation.
407 *
408 * @returns VINF_SUCCESS.
409 * @returns Error code to cancel the operation with.
410 * @param pUVM The user mode VM handle.
411 * @param uPercent Completion percentage (0-100).
412 * @param pvUser User specified argument.
413 */
414typedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
415/** Pointer to a FNVMPROGRESS function. */
416typedef FNVMPROGRESS *PFNVMPROGRESS;
417
418
419VMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
420 PFNVMATERROR pfnVMAtError, void *pvUserVM,
421 PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
422 PVM *ppVM, PUVM *ppUVM);
423VMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
424VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
425VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
426VMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason);
427VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM);
428VMMR3DECL(int) VMR3Reset(PUVM pUVM);
429VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetFF(PVM pVM);
430VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetTripleFault(PVM pVM);
431VMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
432VMMR3_INT_DECL(int) VMR3SaveFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
433VMMR3DECL(int) VMR3Teleport(PUVM pUVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
434VMMR3DECL(int) VMR3LoadFromFile(PUVM pUVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
435VMMR3DECL(int) VMR3LoadFromStream(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
436 PFNVMPROGRESS pfnProgress, void *pvProgressUser);
437VMMR3_INT_DECL(int) VMR3LoadFromStreamFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
438
439VMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
440VMMR3DECL(int) VMR3Destroy(PUVM pUVM);
441VMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
442
443VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
444VMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
445VMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
446VMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
447VMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
448VMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
449VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
450VMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
451VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
452VMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
453VMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
454VMMR3_INT_DECL(bool) VMR3SetGuruMeditation(PVM pVM);
455VMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
456VMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
457VMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
458VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
459VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(6, 0);
460VMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
461VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
462VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
463VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
464VMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
465VMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
466
467VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
468VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
469VMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
470VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
471VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
472VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
473VMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
474VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
475VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
476VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
477VMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
478VMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
479VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
480VMMR3DECL(int) VMR3ReqFree(PVMREQ pReq);
481VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies);
482VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies);
483VMMR3_INT_DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly);
484
485/** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU.
486 * @{ */
487/** Whether we've done REM or not. */
488#define VMNOTIFYFF_FLAGS_DONE_REM RT_BIT_32(0)
489/** Whether we should poke the CPU if it's executing guest code. */
490#define VMNOTIFYFF_FLAGS_POKE RT_BIT_32(1)
491/** @} */
492VMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
493VMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
494VMMR3DECL(int) VMR3NotifyCpuDeviceReady(PVM pVM, VMCPUID idCpu);
495VMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
496VMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
497VMMR3DECL(int) VMR3WaitForDeviceReady(PVM pVM, VMCPUID idCpu);
498VMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
499VMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
500VMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
501VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM);
502VMMR3_INT_DECL(RTTHREAD) VMR3GetThreadHandle(PUVMCPU pUVCpu);
503VMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
504VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
505VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
506VMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
507VMMR3_INT_DECL(uint32_t) VMR3GetActiveEmts(PUVM pUVM);
508VMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
509VMMR3DECL(int) VMR3HotPlugCpu(PUVM pUVM, VMCPUID idCpu);
510VMMR3DECL(int) VMR3SetCpuExecutionCap(PUVM pUVM, uint32_t uCpuExecutionCap);
511VMMR3DECL(int) VMR3SetPowerOffInsteadOfReset(PUVM pUVM, bool fPowerOffInsteadOfReset);
512/** @} */
513#endif /* IN_RING3 */
514
515
516#ifdef IN_RC
517/** @defgroup grp_vmm_apis_gc VM Guest Context APIs
518 * @ingroup grp_vm
519 * @{ */
520
521/** @} */
522#endif
523
524RT_C_DECLS_END
525
526/** @} */
527
528#endif
529
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