vmm.h revision 75525d41095e220a39e222114dcd9d2d6d8b7757
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @file
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * VMM - The Virtual Machine Monitor.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/*
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Copyright (C) 2006-2007 innotek GmbH
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
a0a3a26a4065b9401681a8c99a11bd83e08f94ccvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * available from http://www.virtualbox.org. This file is free software;
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * you can redistribute it and/or modify it under the terms of the GNU
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * General Public License as published by the Free Software Foundation,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#ifndef ___VBox_vmm_h
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#define ___VBox_vmm_h
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#include <VBox/cdefs.h>
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#include <VBox/types.h>
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync#include <VBox/vmapi.h>
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync#include <VBox/sup.h>
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync#include <iprt/stdarg.h>
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync__BEGIN_DECLS
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @defgroup grp_vmm The Virtual Machine Monitor API
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @{
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * World switcher identifiers.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsynctypedef enum VMMSWITCHER
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync{
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The usual invalid 0. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_INVALID = 0,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for 32-bit host to 32-bit shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_32_TO_32,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for 32-bit host paging to PAE shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_32_TO_PAE,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for 32-bit host paging to AMD64 shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_32_TO_AMD64,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for PAE host to 32-bit shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_PAE_TO_32,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for PAE host to PAE shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_PAE_TO_PAE,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for PAE host paging to AMD64 shadow paging. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_PAE_TO_AMD64,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Switcher for AMD64 host paging to PAE shadow paging. */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync VMMSWITCHER_AMD64_TO_PAE,
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync /** Switcher for AMD64 host paging to AMD64 shadow paging. */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync VMMSWITCHER_AMD64_TO_AMD64,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Used to make a count for array declarations and suchlike. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMSWITCHER_MAX,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The usual 32-bit paranoia. */
acca7ab818eb8c2832aa27e27ce53133fba927dbvboxsync VMMSWITCHER_32BIT_HACK = 0x7fffffff
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync} VMMSWITCHER;
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync/**
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync * VMMGCCallHost operations.
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsynctypedef enum VMMCALLHOST
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync{
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync /** Invalid operation. */
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync VMMCALLHOST_INVALID = 0,
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync /** Acquire the PDM lock. */
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync VMMCALLHOST_PDM_LOCK,
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync /** Call PDMR3QueueFlushWorker. */
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync VMMCALLHOST_PDM_QUEUE_FLUSH,
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync /** Acquire the PGM lock. */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync VMMCALLHOST_PGM_LOCK,
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync /** Grow the PGM shadow page pool. */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync VMMCALLHOST_PGM_POOL_GROW,
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync /** Maps a chunk into ring-3. */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync VMMCALLHOST_PGM_MAP_CHUNK,
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync /** Allocates more handy pages. */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync VMMCALLHOST_PGM_ALLOCATE_HANDY_PAGES,
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync#ifndef NEW_PHYS_CODE
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync /** Dynamically allocate physical guest RAM. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_PGM_RAM_GROW_RANGE,
ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8vboxsync#endif
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Replay the REM handler notifications. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_REM_REPLAY_HANDLER_NOTIFICATIONS,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Flush the GC/R0 logger. */
5eb36887f6970e0033f63fa135f3bb8fbfd6059bvboxsync VMMCALLHOST_VMM_LOGGER_FLUSH,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Set the VM error message. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_VM_SET_ERROR,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Set the VM runtime error message. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_VM_SET_RUNTIME_ERROR,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Signal a ring 0 hypervisor assertion. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_VM_R0_HYPER_ASSERTION,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The usual 32-bit hack. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMCALLHOST_32BIT_HACK = 0x7fffffff
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync} VMMCALLHOST;
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Gets the bottom of the hypervisor stack - GC Ptr.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * I.e. the returned address is not actually writable.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns bottom of the stack.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncRTGCPTR VMMGetStackGC(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync * Gets the bottom of the hypervisor stack - HC Ptr.
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync * I.e. the returned address is not actually writable.
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync *
63a3c5be7ac89d0d5b3386988f8c2f78df0cacf6vboxsync * @returns bottom of the stack.
ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8vboxsync * @param pVM The VM handle.
ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8vboxsync */
47e063db54028c020dd3e85a2467d7a279e47a8avboxsyncRTHCPTR VMMGetHCStack(PVM pVM);
ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8vboxsync
ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8vboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#ifdef IN_RING3
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @defgroup grp_vmm_r3 The VMM Host Context Ring 3 API
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @ingroup grp_vmm
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @{
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Initializes the VMM.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync * @param pVM The VM to operate on.
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync */
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsyncVMMR3DECL(int) VMMR3Init(PVM pVM);
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync * Ring-3 init finalizing.
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync *
f3abe19bdaeea1b354674327ee95707281a6ad83vboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3InitFinalize(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Initializes the R0 VMM.
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync *
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM to operate on.
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync */
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsyncVMMR3DECL(int) VMMR3InitR0(PVM pVM);
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync
97803398b9554900b4dd45f88b2eb2056e2c606bvboxsync/**
97803398b9554900b4dd45f88b2eb2056e2c606bvboxsync * Initializes the GC VMM.
97803398b9554900b4dd45f88b2eb2056e2c606bvboxsync *
25c15196ec95f6a53e802167c815286cecfeb278vboxsync * @returns VBox status code.
25c15196ec95f6a53e802167c815286cecfeb278vboxsync * @param pVM The VM to operate on.
25c15196ec95f6a53e802167c815286cecfeb278vboxsync */
97803398b9554900b4dd45f88b2eb2056e2c606bvboxsyncVMMR3DECL(int) VMMR3InitGC(PVM pVM);
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync
ae5fc6ddd3d2ccdb941b1aacd23f6791fecc3354vboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Destroy the VMM bits.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VINF_SUCCESS.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3Term(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Applies relocations to data and code managed by this
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * component. This function will be called at init and
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * whenever the VMM need to relocate it self inside the GC.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * The VMM will need to apply relocations to the core code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param offDelta The relocation delta.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(void) VMMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
a0a3a26a4065b9401681a8c99a11bd83e08f94ccvboxsync * Updates the settings for the GC (and R0?) loggers.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
a0a3a26a4065b9401681a8c99a11bd83e08f94ccvboxsyncVMMR3DECL(int) VMMR3UpdateLoggers(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Gets the pointer to g_szRTAssertMsg1 in GC.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns Pointer to VMMGC::g_szRTAssertMsg1.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Returns NULL if not present.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(const char *) VMMR3GetGCAssertMsg1(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Gets the pointer to g_szRTAssertMsg2 in GC.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns Pointer to VMMGC::g_szRTAssertMsg2.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Returns NULL if not present.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(const char *) VMMR3GetGCAssertMsg2(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Resolve a builtin GC symbol.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Called by PDM when loading or relocating GC modules.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM VM Handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pszSymbol Symbol to resolv
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pGCPtrValue Where to store the symbol value.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @remark This has to work before VMMR3Relocate() is called.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3GetImportGC(PVM pVM, const char *pszSymbol, PRTGCPTR pGCPtrValue);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Selects the switcher to be used for switching to GC.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param enmSwitcher The new switcher.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @remark This function may be called before the VMM is initialized.
a0a3a26a4065b9401681a8c99a11bd83e08f94ccvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3SelectSwitcher(PVM pVM, VMMSWITCHER enmSwitcher);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Disable the switcher logic permanently.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3DisableSwitcher(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Executes guest code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3RawRunGC(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
7755c0a4b7b215f612d9d27848c2584ffafe7a66vboxsync * Executes guest code (Intel VMX and AMD SVM).
7755c0a4b7b215f612d9d27848c2584ffafe7a66vboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3HwAccRunGC(PVM pVM);
316572fd6bf59ec1038f0476f6536fc10163beebvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Calls GC a function.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param GCPtrEntry The GC function address.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param cArgs The number of arguments in the ....
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param ... Arguments to the function.
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync */
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsyncVMMR3DECL(int) VMMR3CallGC(PVM pVM, RTGCPTR GCPtrEntry, unsigned cArgs, ...);
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync/**
b14965bee0bfb359e6ce9db6beaa4add9935fe3cvboxsync * Calls GC a function.
602e0e27740395dba64bee2e0a8aef023ebd7650vboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param GCPtrEntry The GC function address.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param cArgs The number of arguments in the ....
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param args Arguments to the function.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3CallGCV(PVM pVM, RTGCPTR GCPtrEntry, unsigned cArgs, va_list args);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Resumes executing hypervisor code when interrupted
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * by a queue flush or a debug event.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @returns VBox status code.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @param pVM VM handle.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsyncVMMR3DECL(int) VMMR3ResumeHyper(PVM pVM);
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * Dumps the VM state on a fatal error.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync *
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @param pVM VM Handle.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @param rcErr VBox status code.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsyncVMMR3DECL(void) VMMR3FatalDump(PVM pVM, int rcErr);
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * Acquire global VM lock
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync *
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @returns VBox status code
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM to operate on.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(int) VMMR3Lock(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Release global VM lock
78df65edff21c11c537f38e736707ea434ab5623vboxsync *
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns VBox status code
78df65edff21c11c537f38e736707ea434ab5623vboxsync * @param pVM The VM to operate on.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync */
489fcf2b60b2dfc27a2fcb590aad04ad2c4f9b75vboxsyncVMMR3DECL(int) VMMR3Unlock(PVM pVM);
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * Return global VM lock owner
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync *
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns NIL_RTNATIVETHREAD -> no owner, otherwise thread id of owner
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param pVM The VM to operate on.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync */
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsyncVMMR3DECL(RTNATIVETHREAD) VMMR3LockGetOwner(PVM pVM);
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * Checks if the current thread is the owner of the global VM lock.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync *
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns true if owner.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns false if not owner.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param pVM The VM to operate on.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync */
78df65edff21c11c537f38e736707ea434ab5623vboxsyncVMMR3DECL(bool) VMMR3LockIsOwner(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Suspends the the CPU yielder.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsyncVMMR3DECL(void) VMMR3YieldSuspend(PVM pVM);
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync/**
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * Stops the the CPU yielder.
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync *
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(void) VMMR3YieldStop(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Resumes the CPU yielder when it has been a suspended or stopped.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR3DECL(void) VMMR3YieldResume(PVM pVM);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @} */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#endif
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @defgroup grp_vmm_r0 The VMM Host Context Ring 0 API
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @ingroup grp_vmm
78df65edff21c11c537f38e736707ea434ab5623vboxsync * @{
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * The VMMR0Entry() codes.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync */
e43d0b86db65e202efb63f0fc5fce1f981267a32vboxsynctypedef enum VMMR0OPERATION
e43d0b86db65e202efb63f0fc5fce1f981267a32vboxsync{
e43d0b86db65e202efb63f0fc5fce1f981267a32vboxsync /** Run guest context. */
e43d0b86db65e202efb63f0fc5fce1f981267a32vboxsync VMMR0_DO_RAW_RUN = SUP_VMMR0_DO_RAW_RUN,
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync /** Run guest code using the available hardware acceleration technology. */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync VMMR0_DO_HWACC_RUN = SUP_VMMR0_DO_HWACC_RUN,
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync /** Official NOP that we use for profiling. */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync VMMR0_DO_NOP = SUP_VMMR0_DO_NOP,
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync /** Call VMMR0 Per VM Init. */
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync VMMR0_DO_VMMR0_INIT,
f632be0ea31134f1ce343e84c90d7984d2bf96b2vboxsync /** Call VMMR0 Per VM Termination. */
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync VMMR0_DO_VMMR0_TERM,
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync /** Setup the hardware accelerated raw-mode session. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_HWACC_SETUP_VM,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Calls function in the hypervisor.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * The caller must setup the hypervisor context so the call will be performed.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * The difference between VMMR0_DO_RUN_GC and this one is the handling of
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * the return GC code. The return code will not be interpreted by this operation.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_CALL_HYPERVISOR,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call PGMR0PhysAllocateHandyPages(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call GMMR0AllocatePages(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_GMM_ALLOCATE_PAGES,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call GMMR0FreePages(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_GMM_FREE_PAGES,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call GMMR0MapUnmapChunk(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_GMM_MAP_UNMAP_CHUNK,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call GMMR0SeedChunk(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_GMM_SEED_CHUNK,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The start of the R0 service operations. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_SRV_START,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0Open(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_OPEN,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0IfClose(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_IF_CLOSE,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0IfGetRing3Buffer(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_IF_GET_RING3_BUFFER,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0IfSetPromiscuousMode(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0IfSend(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_IF_SEND,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Call INTNETR0IfWait(). */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_INTNET_IF_WAIT,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The end of the R0 service operations. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_SRV_END,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** Official call we use for testing Ring-0 APIs. */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync VMMR0_DO_TESTS,
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync /** The usual 32-bit type blow up. */
84cbac6212750be6733ce171fcdec2e24fd378c8vboxsync VMMR0_DO_32BIT_HACK = 0x7fffffff
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync} VMMR0OPERATION;
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * The Ring 0 entry point, called by the interrupt gate.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync *
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns VBox status code.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param pVM The VM to operate on.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param enmOperation Which operation to execute.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param pvArg Argument to the operation.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @remarks Assume called with interrupts disabled.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync */
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsyncVMMR0DECL(int) VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg);
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync/**
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * The Ring 0 entry point, called by the fast-ioctl path.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync *
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @returns VBox status code.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param pVM The VM to operate on.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @param enmOperation Which operation to execute.
a5d4a2a6365cbfa15e179bc79d291133c4a0ff1evboxsync * @remarks Assume called with interrupts _enabled_.
84cbac6212750be6733ce171fcdec2e24fd378c8vboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR0DECL(int) VMMR0EntryFast(PVM pVM, VMMR0OPERATION enmOperation);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * The Ring 0 entry point, called by the support library (SUP).
5d6df5999c0e844db1af3c6def0a9abac5120d3bvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM to operate on.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param enmOperation Which operation to execute.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pReq This points to a SUPVMMR0REQHDR packet. Optional.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param u64Arg Some simple constant argument.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @remarks Assume called with interrupts _enabled_.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMR0DECL(int) VMMR0EntryEx(PVM pVM, VMMR0OPERATION enmOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Calls the ring-3 host code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code of the ring-3 call.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param enmOperation The operation.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param uArg The argument to the operation.
2c6c9da3f26e8e769901a041f182037452cffafdvboxsync */
2c6c9da3f26e8e769901a041f182037452cffafdvboxsyncVMMR0DECL(int) VMMR0CallHost(PVM pVM, VMMCALLHOST enmOperation, uint64_t uArg);
2c6c9da3f26e8e769901a041f182037452cffafdvboxsync
2c6c9da3f26e8e769901a041f182037452cffafdvboxsync/** @} */
2c6c9da3f26e8e769901a041f182037452cffafdvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#ifdef IN_GC
c87c6e10b608762972b76bfc734daaec9070b50bvboxsync/** @defgroup grp_vmm_gc The VMM Guest Context API
11e81238706f1510eabb4be04811da8f87706519vboxsync * @ingroup grp_vmm
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @{
48807baed22246206b9855f41d1fd106f0679b3avboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
11e81238706f1510eabb4be04811da8f87706519vboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * The GC entry point.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM to operate on.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param uOperation Which operation to execute (VMMGCOPERATION).
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param uArg Argument to that operation.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param ... Additional arguments.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMGCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg, ...);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Switches from guest context to host context.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param rc The status code.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMGCDECL(void) VMMGCGuestToHost(PVM pVM, int rc);
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/**
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * Calls the ring-3 host code.
c87c6e10b608762972b76bfc734daaec9070b50bvboxsync *
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @returns VBox status code of the ring-3 call.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param pVM The VM handle.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param enmOperation The operation.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync * @param uArg The argument to the operation.
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsyncVMMGCDECL(int) VMMGCCallHost(PVM pVM, VMMCALLHOST enmOperation, uint64_t uArg);
7fee49908ea4b9f6cb4f9cc745633c4969ed6318vboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @} */
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#endif
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync/** @} */
7fee49908ea4b9f6cb4f9cc745633c4969ed6318vboxsync__END_DECLS
7fee49908ea4b9f6cb4f9cc745633c4969ed6318vboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync#endif
30a23dfc653298a09d77d3045cf873b1bd6ddecfvboxsync