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