VirtualBox

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

Last change on this file since 73768 was 73351, checked in by vboxsync, 6 years ago

VBoxGuest,VMMDev,DBGF,VM: Added bug check report to VBoxGuest/VMMDev and hooked it up to DBGF. Made DBGF remember the last reported bug check, adding an info handler for displaying it. Added VM reset counters w/ getters for use in bug check reporting.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.2 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
214VMMDECL(uint32_t) VMGetResetCount(PVM pVM);
215VMMDECL(uint32_t) VMGetSoftResetCount(PVM pVM);
216VMMDECL(uint32_t) VMGetHardResetCount(PVM pVM);
217
218
219/**
220 * Request type.
221 */
222typedef enum VMREQTYPE
223{
224 /** Invalid request. */
225 VMREQTYPE_INVALID = 0,
226 /** VM: Internal. */
227 VMREQTYPE_INTERNAL,
228 /** Maximum request type (exclusive). Used for validation. */
229 VMREQTYPE_MAX
230} VMREQTYPE;
231
232/**
233 * Request state.
234 */
235typedef enum VMREQSTATE
236{
237 /** The state is invalid. */
238 VMREQSTATE_INVALID = 0,
239 /** The request have been allocated and is in the process of being filed. */
240 VMREQSTATE_ALLOCATED,
241 /** The request is queued by the requester. */
242 VMREQSTATE_QUEUED,
243 /** The request is begin processed. */
244 VMREQSTATE_PROCESSING,
245 /** The request is completed, the requester is begin notified. */
246 VMREQSTATE_COMPLETED,
247 /** The request packet is in the free chain. (The requester */
248 VMREQSTATE_FREE
249} VMREQSTATE;
250
251/**
252 * Request flags.
253 */
254typedef enum VMREQFLAGS
255{
256 /** The request returns a VBox status code. */
257 VMREQFLAGS_VBOX_STATUS = 0,
258 /** The request is a void request and have no status code. */
259 VMREQFLAGS_VOID = 1,
260 /** Return type mask. */
261 VMREQFLAGS_RETURN_MASK = 1,
262 /** Caller does not wait on the packet, EMT will free it. */
263 VMREQFLAGS_NO_WAIT = 2,
264 /** Poke the destination EMT(s) if executing guest code. Use with care. */
265 VMREQFLAGS_POKE = 4,
266 /** Priority request that can safely be processed while doing async
267 * suspend and power off. */
268 VMREQFLAGS_PRIORITY = 8
269} VMREQFLAGS;
270
271
272/**
273 * VM Request packet.
274 *
275 * This is used to request an action in the EMT. Usually the requester is
276 * another thread, but EMT can also end up being the requester in which case
277 * it's carried out synchronously.
278 */
279typedef struct VMREQ
280{
281 /** Pointer to the next request in the chain. */
282 struct VMREQ * volatile pNext;
283 /** Pointer to ring-3 VM structure which this request belongs to. */
284 PUVM pUVM;
285 /** Request state. */
286 volatile VMREQSTATE enmState;
287 /** VBox status code for the completed request. */
288 volatile int32_t iStatus;
289 /** Requester event sem.
290 * The request can use this event semaphore to wait/poll for completion
291 * of the request.
292 */
293 RTSEMEVENT EventSem;
294 /** Set if the event semaphore is clear. */
295 volatile bool fEventSemClear;
296 /** Flags, VMR3REQ_FLAGS_*. */
297 unsigned fFlags;
298 /** Request type. */
299 VMREQTYPE enmType;
300 /** Request destination. */
301 VMCPUID idDstCpu;
302 /** Request specific data. */
303 union VMREQ_U
304 {
305 /** VMREQTYPE_INTERNAL. */
306 struct
307 {
308 /** Pointer to the function to be called. */
309 PFNRT pfn;
310 /** Number of arguments. */
311 unsigned cArgs;
312 /** Array of arguments. */
313 uintptr_t aArgs[64];
314 } Internal;
315 } u;
316} VMREQ;
317/** Pointer to a VM request packet. */
318typedef VMREQ *PVMREQ;
319
320/** @} */
321
322
323#ifndef IN_RC
324/** @defgroup grp_vmm_apis_hc VM Host Context API
325 * @ingroup grp_vm
326 * @{ */
327
328/** @} */
329#endif
330
331
332#ifdef IN_RING3
333/** @defgroup grp_vmm_apis_r3 VM Host Context Ring 3 API
334 * This interface is a _draft_!
335 * @ingroup grp_vm
336 * @{ */
337
338/**
339 * Completion notification codes.
340 */
341typedef enum VMINITCOMPLETED
342{
343 /** The ring-3 init is completed. */
344 VMINITCOMPLETED_RING3 = 1,
345 /** The ring-0 init is completed. */
346 VMINITCOMPLETED_RING0,
347 /** The hardware accelerated virtualization init is completed.
348 * Used to make decisision depending on HM* bits being completely
349 * initialized. */
350 VMINITCOMPLETED_HM,
351 /** The RC init is completed. */
352 VMINITCOMPLETED_RC
353} VMINITCOMPLETED;
354
355
356/** Reason for VM resume. */
357typedef enum VMRESUMEREASON
358{
359 VMRESUMEREASON_INVALID = 0,
360 /** User decided to do so. */
361 VMRESUMEREASON_USER,
362 /** VM reconfiguration (like changing DVD). */
363 VMRESUMEREASON_RECONFIG,
364 /** The host resumed. */
365 VMRESUMEREASON_HOST_RESUME,
366 /** Restored state. */
367 VMRESUMEREASON_STATE_RESTORED,
368 /** Snapshot / saved state. */
369 VMRESUMEREASON_STATE_SAVED,
370 /** Teleported to a new box / instance. */
371 VMRESUMEREASON_TELEPORTED,
372 /** Teleportation failed. */
373 VMRESUMEREASON_TELEPORT_FAILED,
374 /** FTM temporarily suspended the VM. */
375 VMRESUMEREASON_FTM_SYNC,
376 /** End of valid reasons. */
377 VMRESUMEREASON_END,
378 /** Blow the type up to 32-bits. */
379 VMRESUMEREASON_32BIT_HACK = 0x7fffffff
380} VMRESUMEREASON;
381
382/** Reason for VM suspend. */
383typedef enum VMSUSPENDREASON
384{
385 VMSUSPENDREASON_INVALID = 0,
386 /** User decided to do so. */
387 VMSUSPENDREASON_USER,
388 /** VM reconfiguration (like changing DVD). */
389 VMSUSPENDREASON_RECONFIG,
390 /** The VM is suspending itself. */
391 VMSUSPENDREASON_VM,
392 /** The Vm is suspending because of a runtime error. */
393 VMSUSPENDREASON_RUNTIME_ERROR,
394 /** The host was suspended. */
395 VMSUSPENDREASON_HOST_SUSPEND,
396 /** The host is running low on battery power. */
397 VMSUSPENDREASON_HOST_BATTERY_LOW,
398 /** FTM is temporarily suspending the VM. */
399 VMSUSPENDREASON_FTM_SYNC,
400 /** End of valid reasons. */
401 VMSUSPENDREASON_END,
402 /** Blow the type up to 32-bits. */
403 VMSUSPENDREASON_32BIT_HACK = 0x7fffffff
404} VMSUSPENDREASON;
405
406
407/**
408 * Progress callback.
409 *
410 * This will report the completion percentage of an operation.
411 *
412 * @returns VINF_SUCCESS.
413 * @returns Error code to cancel the operation with.
414 * @param pUVM The user mode VM handle.
415 * @param uPercent Completion percentage (0-100).
416 * @param pvUser User specified argument.
417 */
418typedef DECLCALLBACK(int) FNVMPROGRESS(PUVM pUVM, unsigned uPercent, void *pvUser);
419/** Pointer to a FNVMPROGRESS function. */
420typedef FNVMPROGRESS *PFNVMPROGRESS;
421
422
423VMMR3DECL(int) VMR3Create(uint32_t cCpus, PCVMM2USERMETHODS pVm2UserCbs,
424 PFNVMATERROR pfnVMAtError, void *pvUserVM,
425 PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM,
426 PVM *ppVM, PUVM *ppUVM);
427VMMR3DECL(int) VMR3PowerOn(PUVM pUVM);
428VMMR3DECL(int) VMR3Suspend(PUVM pUVM, VMSUSPENDREASON enmReason);
429VMMR3DECL(VMSUSPENDREASON) VMR3GetSuspendReason(PUVM);
430VMMR3DECL(int) VMR3Resume(PUVM pUVM, VMRESUMEREASON enmReason);
431VMMR3DECL(VMRESUMEREASON) VMR3GetResumeReason(PUVM);
432VMMR3DECL(int) VMR3Reset(PUVM pUVM);
433VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetFF(PVM pVM);
434VMMR3_INT_DECL(VBOXSTRICTRC) VMR3ResetTripleFault(PVM pVM);
435VMMR3DECL(int) VMR3Save(PUVM pUVM, const char *pszFilename, bool fContinueAfterwards, PFNVMPROGRESS pfnProgress, void *pvUser, bool *pfSuspended);
436VMMR3_INT_DECL(int) VMR3SaveFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, bool *pfSuspended, bool fSkipStateChanges);
437VMMR3DECL(int) VMR3Teleport(PUVM pUVM, uint32_t cMsDowntime, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, PFNVMPROGRESS pfnProgress, void *pvProgressUser, bool *pfSuspended);
438VMMR3DECL(int) VMR3LoadFromFile(PUVM pUVM, const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser);
439VMMR3DECL(int) VMR3LoadFromStream(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
440 PFNVMPROGRESS pfnProgress, void *pvProgressUser);
441VMMR3_INT_DECL(int) VMR3LoadFromStreamFT(PUVM pUVM, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser);
442
443VMMR3DECL(int) VMR3PowerOff(PUVM pUVM);
444VMMR3DECL(int) VMR3Destroy(PUVM pUVM);
445VMMR3_INT_DECL(void) VMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
446
447VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM);
448VMMR3DECL(PUVM) VMR3GetUVM(PVM pVM);
449VMMR3DECL(uint32_t) VMR3RetainUVM(PUVM pUVM);
450VMMR3DECL(uint32_t) VMR3ReleaseUVM(PUVM pUVM);
451VMMR3DECL(const char *) VMR3GetName(PUVM pUVM);
452VMMR3DECL(PRTUUID) VMR3GetUuid(PUVM pUVM, PRTUUID pUuid);
453VMMR3DECL(VMSTATE) VMR3GetState(PVM pVM);
454VMMR3DECL(VMSTATE) VMR3GetStateU(PUVM pUVM);
455VMMR3DECL(const char *) VMR3GetStateName(VMSTATE enmState);
456VMMR3DECL(int) VMR3AtStateRegister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
457VMMR3DECL(int) VMR3AtStateDeregister(PUVM pUVM, PFNVMATSTATE pfnAtState, void *pvUser);
458VMMR3_INT_DECL(bool) VMR3SetGuruMeditation(PVM pVM);
459VMMR3_INT_DECL(bool) VMR3TeleportedAndNotFullyResumedYet(PVM pVM);
460VMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
461VMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
462VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7);
463VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(6, 0);
464VMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM);
465VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
466VMMR3DECL(int) VMR3AtRuntimeErrorRegister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
467VMMR3DECL(int) VMR3AtRuntimeErrorDeregister(PUVM pUVM, PFNVMATRUNTIMEERROR pfnAtRuntimeError, void *pvUser);
468VMMR3_INT_DECL(int) VMR3SetRuntimeErrorWorker(PVM pVM);
469VMMR3_INT_DECL(uint32_t) VMR3GetRuntimeErrorCount(PUVM pUVM);
470
471VMMR3DECL(int) VMR3ReqCallU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, ...);
472VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args);
473VMMR3_INT_DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
474VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
475VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
476VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
477VMMR3_INT_DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
478VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
479VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
480VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
481VMMR3DECL(int) VMR3ReqPriorityCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
482VMMR3DECL(int) VMR3ReqPriorityCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);
483VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu);
484VMMR3DECL(int) VMR3ReqFree(PVMREQ pReq);
485VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies);
486VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies);
487VMMR3_INT_DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly);
488
489/** @name Flags for VMR3NotifyCpuFFU and VMR3NotifyGlobalFFU.
490 * @{ */
491/** Whether we've done REM or not. */
492#define VMNOTIFYFF_FLAGS_DONE_REM RT_BIT_32(0)
493/** Whether we should poke the CPU if it's executing guest code. */
494#define VMNOTIFYFF_FLAGS_POKE RT_BIT_32(1)
495/** @} */
496VMMR3_INT_DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags);
497VMMR3_INT_DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags);
498VMMR3DECL(int) VMR3NotifyCpuDeviceReady(PVM pVM, VMCPUID idCpu);
499VMMR3_INT_DECL(int) VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
500VMMR3_INT_DECL(int) VMR3WaitU(PUVMCPU pUVMCpu);
501VMMR3DECL(int) VMR3WaitForDeviceReady(PVM pVM, VMCPUID idCpu);
502VMMR3_INT_DECL(int) VMR3AsyncPdmNotificationWaitU(PUVMCPU pUVCpu);
503VMMR3_INT_DECL(void) VMR3AsyncPdmNotificationWakeupU(PUVM pUVM);
504VMMR3_INT_DECL(RTCPUID) VMR3GetVMCPUId(PVM pVM);
505VMMR3_INT_DECL(bool) VMR3IsLongModeAllowed(PVM pVM);
506VMMR3_INT_DECL(RTTHREAD) VMR3GetThreadHandle(PUVMCPU pUVCpu);
507VMMR3DECL(RTTHREAD) VMR3GetVMCPUThread(PUVM pUVM);
508VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThread(PVM pVM);
509VMMR3DECL(RTNATIVETHREAD) VMR3GetVMCPUNativeThreadU(PUVM pUVM);
510VMMR3DECL(int) VMR3GetCpuCoreAndPackageIdFromCpuId(PUVM pUVM, VMCPUID idCpu, uint32_t *pidCpuCore, uint32_t *pidCpuPackage);
511VMMR3_INT_DECL(uint32_t) VMR3GetActiveEmts(PUVM pUVM);
512VMMR3DECL(int) VMR3HotUnplugCpu(PUVM pUVM, VMCPUID idCpu);
513VMMR3DECL(int) VMR3HotPlugCpu(PUVM pUVM, VMCPUID idCpu);
514VMMR3DECL(int) VMR3SetCpuExecutionCap(PUVM pUVM, uint32_t uCpuExecutionCap);
515VMMR3DECL(int) VMR3SetPowerOffInsteadOfReset(PUVM pUVM, bool fPowerOffInsteadOfReset);
516/** @} */
517#endif /* IN_RING3 */
518
519
520#ifdef IN_RC
521/** @defgroup grp_vmm_apis_gc VM Guest Context APIs
522 * @ingroup grp_vm
523 * @{ */
524
525/** @} */
526#endif
527
528RT_C_DECLS_END
529
530/** @} */
531
532#endif
533
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use