HWVMXR0.h revision 5c0c16a890a7447da4713a5e3eac208cbff325fe
/* $Id$ */
/** @file
* HWACCM VT-x - Internal header file.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___HWVMXR0_h
#define ___HWVMXR0_h
#include <VBox/hwacc_vmx.h>
/** @defgroup grp_vmx_int Internal
* @ingroup grp_vmx
* @internal
* @{
*/
#ifdef IN_RING0
/**
* Enters the VT-x session
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param idVCpu VPCPU id.
* @param pCpu CPU info struct
*/
/**
* Leaves the VT-x session
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param idVCpu VPCPU id.
* @param pCtx CPU context
*/
/**
* Sets up and activates VT-x on the current CPU
*
* @returns VBox status code.
* @param pCpu CPU info struct
* @param pVM The VM to operate on. (can be NULL after a resume)
* @param pvPageCpu Pointer to the global cpu page
* @param pPageCpuPhys Physical address of the global cpu page
*/
VMMR0DECL(int) VMXR0EnableCpu(PHWACCM_CPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys);
/**
* Deactivates VT-x on the current CPU
*
* @returns VBox status code.
* @param pCpu CPU info struct
* @param pvPageCpu Pointer to the global cpu page
* @param pPageCpuPhys Physical address of the global cpu page
*/
/**
* Does Ring-0 per VM VT-x init.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
/**
* Does Ring-0 per VM VT-x termination.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
/**
* Sets up VT-x for the specified VM
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
/**
* Save the host state
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param idVCpu VPCPU id.
*/
/**
* Loads the guest state
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param idVCpu VPCPU id.
* @param pCtx Guest context
*/
/**
* Runs guest code in a VT-x VM.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param idVCpu VPCPU id.
* @param pCtx Guest context
*/
{ \
else \
if (CPUMIsGuestInRealModeEx(pCtx)) \
{ \
/* Must override this or else VT-x will fail with invalid guest state errors. */ \
val = 0xf3; \
} \
else \
else \
\
}
{ \
}
{ \
}
/**
* Prepares for and executes VMLAUNCH (32 bits guest mode)
*
* @returns VBox status code
* @param pCtx Guest context
*/
/**
* Prepares for and executes VMLAUNCH (64 bits guest mode)
*
* @returns VBox status code
* @param pCtx Guest context
*/
#endif /* IN_RING0 */
/** @} */
#endif