em.h revision 78dea6229e0025891612cc52f77bf0b2beb7c46d
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** @file
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * EM - Execution Monitor.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/*
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Copyright (C) 2006-2010 Oracle Corporation
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync *
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * available from http://www.virtualbox.org. This file is free software;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * you can redistribute it and/or modify it under the terms of the GNU
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * General Public License (GPL) as published by the Free Software
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync *
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * The contents of this file may alternatively be used under the terms
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * of the Common Development and Distribution License Version 1.0
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * VirtualBox OSE distribution, in which case the provisions of the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * CDDL are applicable instead of those of the GPL.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync *
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * You may elect to license modified versions of this file under the
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * terms and conditions of either the GPL or the CDDL or both.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#ifndef ___VBox_vmm_em_h
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#define ___VBox_vmm_em_h
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#include <VBox/types.h>
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#include <VBox/vmm/trpm.h>
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncRT_C_DECLS_BEGIN
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** @defgroup grp_em The Execution Monitor / Manager API
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @{
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** Enable to allow V86 code to run in raw mode. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync#define VBOX_RAW_V86
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync/**
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync * The Execution Manager State.
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync *
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync * @remarks This is used in the saved state!
6ffe15b8a1730e56a0a818da51c4e7a115da5763vboxsync */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef enum EMSTATE
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync{
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Not yet started. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_NONE = 1,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Raw-mode execution. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_RAW,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Hardware accelerated raw-mode execution. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_HWACC,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Value reserved for future use (used to be PARAV). */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_RESERVED,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Recompiled mode execution. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_REM,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Execution is halted. (waiting for interrupt) */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_HALTED,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** Application processor execution is halted. (waiting for startup IPI (SIPI)) */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_WAIT_SIPI,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Execution is suspended. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_SUSPENDED,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** The VM is terminating. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_TERMINATING,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Guest debug event from raw-mode is being processed. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMSTATE_DEBUG_GUEST_RAW,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Guest debug event from hardware accelerated mode is being processed. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMSTATE_DEBUG_GUEST_HWACC,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** Guest debug event from recompiled-mode is being processed. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMSTATE_DEBUG_GUEST_REM,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** Hypervisor debug event being processed. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMSTATE_DEBUG_HYPER,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** The VM has encountered a fatal error. (And everyone is panicing....) */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMSTATE_GURU_MEDITATION,
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** Just a hack to ensure that we get a 32-bit integer. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMSTATE_MAKE_32BIT_HACK = 0x7fffffff
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync} EMSTATE;
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync/**
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * EMInterpretInstructionCPUEx execution modes.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef enum
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync{
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync /** Only supervisor code (CPL=0). */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMCODETYPE_SUPERVISOR,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** User-level code only. */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMCODETYPE_USER,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Supervisor and user-level code (use with great care!). */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync EMCODETYPE_ALL,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync /** Just a hack to ensure that we get a 32-bit integer. */
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync EMCODETYPE_32BIT_HACK = 0x7fffffff
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync} EMCODETYPE;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(EMSTATE) EMGetState(PVMCPU pVCpu);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(void) EMSetState(PVMCPU pVCpu, EMSTATE enmNewState);
e0dec59adb362e8486c0622785420ad10e720972vboxsync
e0dec59adb362e8486c0622785420ad10e720972vboxsync/** @name Callback handlers for instruction emulation functions.
e0dec59adb362e8486c0622785420ad10e720972vboxsync * These are placed here because IOM wants to use them as well.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @{
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM2UINT32(void *pvParam1, uint64_t val2);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef FNEMULATEPARAM2UINT32 *PFNEMULATEPARAM2UINT32;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM2(void *pvParam1, size_t val2);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef FNEMULATEPARAM2 *PFNEMULATEPARAM2;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef DECLCALLBACK(uint32_t) FNEMULATEPARAM3(void *pvParam1, uint64_t val2, size_t val3);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef FNEMULATEPARAM3 *PFNEMULATEPARAM3;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef DECLCALLBACK(int) FNEMULATELOCKPARAM2(void *pvParam1, uint64_t val2, RTGCUINTREG32 *pf);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef FNEMULATELOCKPARAM2 *PFNEMULATELOCKPARAM2;
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsynctypedef DECLCALLBACK(int) FNEMULATELOCKPARAM3(void *pvParam1, uint64_t val2, size_t cb, RTGCUINTREG32 *pf);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsynctypedef FNEMULATELOCKPARAM3 *PFNEMULATELOCKPARAM3;
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/** @} */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
e0dec59adb362e8486c0622785420ad10e720972vboxsync/**
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Checks if raw ring-3 execute mode is enabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync *
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns true if enabled.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @returns false if disabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pVM The VM to operate on.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#define EMIsRawRing3Enabled(pVM) (!(pVM)->fRecompileUser)
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/**
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * Checks if raw ring-0 execute mode is enabled.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync *
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync * @returns true if enabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns false if disabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pVM The VM to operate on.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
e0dec59adb362e8486c0622785420ad10e720972vboxsync#define EMIsRawRing0Enabled(pVM) (!(pVM)->fRecompileSupervisor)
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync/**
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * Checks if execution with hardware assisted virtualization is enabled.
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync *
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns true if enabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @returns false if disabled.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync * @param pVM The VM to operate on.
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync */
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync#define EMIsHwVirtExecutionEnabled(pVM) (!(pVM)->fRecompileSupervisor && !(pVM)->fRecompileSupervisor)
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsync
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(void) EMSetInhibitInterruptsPC(PVMCPU pVCpu, RTGCUINTPTR PC);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(RTGCUINTPTR) EMGetInhibitInterruptsPC(PVMCPU pVCpu);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsyncVMMDECL(int) EMInterpretDisasOne(PVM pVM, PVMCPU pVCpu, PCCPUMCTXCORE pCtxCore, PDISCPUSTATE pCpu, unsigned *pcbInstr);
2c19fa7a35e93931f995c196426585b16f8bf2c0vboxsyncVMMDECL(int) EMInterpretDisasOneEx(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore,
165b506f4c024dabd5a4caaeda31c66712d154eavboxsync PDISCPUSTATE pDISState, unsigned *pcbInstr);
e0dec59adb362e8486c0622785420ad10e720972vboxsyncVMMDECL(VBOXSTRICTRC) EMInterpretInstruction(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(VBOXSTRICTRC) EMInterpretInstructionCPU(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDISState, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, EMCODETYPE enmCodeType, uint32_t *pcbSize);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretCpuId(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretRdtsc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretRdtscp(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(VBOXSTRICTRC) EMInterpretInvlpg(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pAddrGC);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretIret(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
165b506f4c024dabd5a4caaeda31c66712d154eavboxsyncVMMDECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
VMMDECL(int) EMInterpretDRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen);
VMMDECL(int) EMInterpretDRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegDrx);
VMMDECL(int) EMInterpretCRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegCrx, uint32_t SrcRegGen);
VMMDECL(int) EMInterpretCRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegCrx);
VMMDECL(int) EMInterpretLMSW(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint16_t u16Data);
VMMDECL(int) EMInterpretCLTS(PVM pVM, PVMCPU pVCpu);
VMMDECL(VBOXSTRICTRC) EMInterpretPortIO(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, PDISCPUSTATE pCpu, uint32_t cbOp);
VMMDECL(int) EMInterpretRdmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
VMMDECL(int) EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
VMMDECL(bool) EMShouldContinueAfterHalt(PVMCPU pVCpu, PCPUMCTX pCtx);
/** @name Assembly routines
* @{ */
VMMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint64_t u64Param2, size_t cb);
VMMDECL(uint32_t) EMEmulateAnd(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(uint32_t) EMEmulateInc(void *pvParam1, size_t cb);
VMMDECL(uint32_t) EMEmulateDec(void *pvParam1, size_t cb);
VMMDECL(uint32_t) EMEmulateOr(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(int) EMEmulateLockOr(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
VMMDECL(uint32_t) EMEmulateXor(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(int) EMEmulateLockXor(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
VMMDECL(uint32_t) EMEmulateAdd(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(int) EMEmulateLockAnd(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf);
VMMDECL(uint32_t) EMEmulateSub(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(uint32_t) EMEmulateAdcWithCarrySet(void *pvParam1, uint64_t u64Param2, size_t cb);
VMMDECL(uint32_t) EMEmulateBtr(void *pvParam1, uint64_t u64Param2);
VMMDECL(int) EMEmulateLockBtr(void *pvParam1, uint64_t u64Param2, RTGCUINTREG32 *pf);
VMMDECL(uint32_t) EMEmulateBts(void *pvParam1, uint64_t u64Param2);
VMMDECL(uint32_t) EMEmulateBtc(void *pvParam1, uint64_t u64Param2);
VMMDECL(uint32_t) EMEmulateCmpXchg(void *pvParam1, uint64_t *pu32Param2, uint64_t u32Param3, size_t cbSize);
VMMDECL(uint32_t) EMEmulateLockCmpXchg(void *pvParam1, uint64_t *pu64Param2, uint64_t u64Param3, size_t cbSize);
VMMDECL(uint32_t) EMEmulateCmpXchg8b(void *pu32Param1, uint32_t *pEAX, uint32_t *pEDX, uint32_t uEBX, uint32_t uECX);
VMMDECL(uint32_t) EMEmulateLockCmpXchg8b(void *pu32Param1, uint32_t *pEAX, uint32_t *pEDX, uint32_t uEBX, uint32_t uECX);
VMMDECL(uint32_t) EMEmulateXAdd(void *pvParam1, void *pvParam2, size_t cbOp);
VMMDECL(uint32_t) EMEmulateLockXAdd(void *pvParam1, void *pvParam2, size_t cbOp);
/** @} */
/** @name REM locking routines
* @{ */
VMMDECL(void) EMRemUnlock(PVM pVM);
VMMDECL(void) EMRemLock(PVM pVM);
VMMDECL(bool) EMRemIsLockOwner(PVM pVM);
VMMDECL(int) EMRemTryLock(PVM pVM);
/** @} */
#ifdef IN_RING3
/** @defgroup grp_em_r3 The EM Host Context Ring-3 API
* @ingroup grp_em
* @{
*/
VMMR3DECL(int) EMR3Init(PVM pVM);
VMMR3DECL(void) EMR3Relocate(PVM pVM);
VMMR3DECL(void) EMR3ResetCpu(PVMCPU pVCpu);
VMMR3DECL(void) EMR3Reset(PVM pVM);
VMMR3DECL(int) EMR3Term(PVM pVM);
VMMR3DECL(DECLNORETURN(void)) EMR3FatalError(PVMCPU pVCpu, int rc);
VMMR3DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu);
VMMR3DECL(int) EMR3CheckRawForcedActions(PVM pVM, PVMCPU pVCpu);
VMMR3DECL(int) EMR3Interpret(PVM pVM);
/**
* Command argument for EMR3RawSetMode().
*
* It's possible to extend this interface to change several
* execution modes at once should the need arise.
*/
typedef enum EMEXECPOLICY
{
/** The customary invalid zero entry. */
EMEXECPOLICY_INVALID = 0,
/** Whether to recompile ring-0 code or execute it in raw/hm. */
EMEXECPOLICY_RECOMPILE_RING0,
/** Whether to recompile ring-3 code or execute it in raw/hm. */
EMEXECPOLICY_RECOMPILE_RING3,
/** End of valid value (not included). */
EMEXECPOLICY_END,
/** The customary 32-bit type blowup. */
EMEXECPOLICY_32BIT_HACK = 0x7fffffff
} EMEXECPOLICY;
VMMR3DECL(int) EMR3SetExecutionPolicy(PVM pVM, EMEXECPOLICY enmPolicy, bool fEnforce);
/** @} */
#endif /* IN_RING3 */
#ifdef IN_RC
/** @defgroup grp_em_gc The EM Guest Context API
* @ingroup grp_em
* @{
*/
VMMRCDECL(int) EMGCTrap(PVM pVM, unsigned uTrap, PCPUMCTXCORE pRegFrame);
/** @} */
#endif /* IN_RC */
/** @} */
RT_C_DECLS_END
#endif