VirtualBox

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

Last change on this file since 99582 was 99576, checked in by vboxsync, 20 months ago

VMM: Preparations for getting interrupts injected into the guest. With ARMv8 there are two types of interrupts (normal interrupts and fast interrupts) which need to be mapped to forced action flags. Because the PIC and APIC flags are not needed those are mapped to IRQs and FIQs on ARM respectively, bugref:10389

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