hwaccm.h revision e17bd6c32a8dd64f2d42838f9028216465e2caf0
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/** @file
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * HWACCM - Intel/AMD VM Hardware Support Manager
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/*
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * available from http://www.virtualbox.org. This file is free software;
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * General Public License (GPL) as published by the Free Software
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * The contents of this file may alternatively be used under the terms
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * of the Common Development and Distribution License Version 1.0
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * CDDL are applicable instead of those of the GPL.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * You may elect to license modified versions of this file under the
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync * terms and conditions of either the GPL or the CDDL or both.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * additional information or have any questions.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsync#ifndef ___VBox_hwaccm_h
4651430e55b9df9726347e3e3968618e540fe729vboxsync#define ___VBox_hwaccm_h
4651430e55b9df9726347e3e3968618e540fe729vboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsync#include <VBox/cdefs.h>
76f5d3db08b007661ae4af93200838d24683af52vboxsync#include <VBox/types.h>
8a99522dee886d4ed00c8cd18788e9e722febd71vboxsync#include <VBox/pgm.h>
8a99522dee886d4ed00c8cd18788e9e722febd71vboxsync#include <iprt/mp.h>
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync
4651430e55b9df9726347e3e3968618e540fe729vboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync/** @defgroup grp_hwaccm The VM Hardware Manager API
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync * @{
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync */
21293ca6a2967f796ed30a6c8492911619476a48vboxsync
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync/**
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync * HWACCM state
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync */
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsynctypedef enum HWACCMSTATE
4651430e55b9df9726347e3e3968618e540fe729vboxsync{
4651430e55b9df9726347e3e3968618e540fe729vboxsync /* Not yet set */
025f9c7729f643fb8780153dc0e6f1c76baddd69vboxsync HWACCMSTATE_UNINITIALIZED = 0,
4651430e55b9df9726347e3e3968618e540fe729vboxsync /* Enabled */
4651430e55b9df9726347e3e3968618e540fe729vboxsync HWACCMSTATE_ENABLED,
4651430e55b9df9726347e3e3968618e540fe729vboxsync /* Disabled */
4651430e55b9df9726347e3e3968618e540fe729vboxsync HWACCMSTATE_DISABLED,
4651430e55b9df9726347e3e3968618e540fe729vboxsync /** The usual 32-bit hack. */
4651430e55b9df9726347e3e3968618e540fe729vboxsync HWACCMSTATE_32BIT_HACK = 0x7fffffff
4651430e55b9df9726347e3e3968618e540fe729vboxsync} HWACCMSTATE;
4651430e55b9df9726347e3e3968618e540fe729vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync__BEGIN_DECLS
eeb2d581c99b451fb1a26a5870af65981dc9cd5dvboxsync
0ce6ae9d6efed5d54222a13bbdabce9e688e4447vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Query HWACCM state (enabled/disabled)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
e07acfb7f2dbb8bb40804024c79fd3139bdb3f24vboxsync * @returns 0 - disabled, 1 - enabled
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#define HWACCMIsEnabled(a) (a->fHWACCMEnabled)
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Invalidates a guest page
c7a378ed2fbad681c0b674351d698ef20a368935vboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @returns VBox status code.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param GCVirt Page to invalidate
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
f2490dbf97c8247439446844458461b00e50beb0vboxsyncHWACCMDECL(int) HWACCMInvalidatePage(PVM pVM, RTGCPTR GCVirt);
f2490dbf97c8247439446844458461b00e50beb0vboxsync
f2490dbf97c8247439446844458461b00e50beb0vboxsync/**
f2490dbf97c8247439446844458461b00e50beb0vboxsync * Checks if an interrupt event is currently pending.
f2490dbf97c8247439446844458461b00e50beb0vboxsync *
f2490dbf97c8247439446844458461b00e50beb0vboxsync * @returns Interrupt event pending state.
f2490dbf97c8247439446844458461b00e50beb0vboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
c7a378ed2fbad681c0b674351d698ef20a368935vboxsyncHWACCMDECL(bool) HWACCMHasPendingIrq(PVM pVM);
c7a378ed2fbad681c0b674351d698ef20a368935vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#ifndef IN_GC
e52c9984c4f6b8ea141bc50a3bdaf31941d8cd7dvboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Flushes the guest TLB
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @returns VBox status code.
ee5869bb73f07de9c139dc6a608836a7b5767933vboxsync * @param pVM The VM to operate on.
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync */
f6dde23cd488aee26203b38ec67220270f5c4273vboxsyncHWACCMDECL(int) HWACCMFlushTLB(PVM pVM);
22ea904a6fe5c95f54c4374502747cc844ce8204vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Invalidates a guest page by physical address
dc311b529996345ea65d51c87b60b6849642d894vboxsync *
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync * NOTE: Assumes the current instruction references this physical page though a virtual address!!
ee5869bb73f07de9c139dc6a608836a7b5767933vboxsync *
e52c9984c4f6b8ea141bc50a3bdaf31941d8cd7dvboxsync * @returns VBox status code.
dc311b529996345ea65d51c87b60b6849642d894vboxsync * @param pVM The VM to operate on.
dc311b529996345ea65d51c87b60b6849642d894vboxsync * @param GCPhys Page to invalidate
231051c77670a4142b7545d51bd2251ae603189dvboxsync */
dc311b529996345ea65d51c87b60b6849642d894vboxsyncHWACCMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Checks if nested paging is enabled
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync * @returns boolean
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync * @param pVM The VM to operate on.
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync */
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsyncHWACCMDECL(bool) HWACCMIsNestedPagingActive(PVM pVM);
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync
c2029891dc7fbce0f08a378d0335568cf9cbb4c5vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Return the shadow paging mode for nested paging/ept
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
482a222498aae619afda0255a7edf4ebda97268cvboxsync * @returns shadow paging mode
d19316699d7f91959d88c850fd7e0d64840f39a7vboxsync * @param pVM The VM to operate on.
482a222498aae619afda0255a7edf4ebda97268cvboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncHWACCMDECL(PGMMODE) HWACCMGetPagingMode(PVM pVM);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
d020036eb167a2f97f5010276fda5daa3f4773b3vboxsync#else
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/* Nop in GC */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync#define HWACCMFlushTLB(pVM) do { } while (0)
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync#define HWACCMIsNestedPagingActive(pVM) false
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync#endif
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync#ifdef IN_RING0
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/** @defgroup grp_hwaccm_r0 The VM Hardware Manager API
25c5ce7baf4b227ea80250c46d427d0e9fdab4c1vboxsync * @ingroup grp_hwaccm
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @{
d91dc86210d602f51a4701762488a5e696c80a45vboxsync */
d91dc86210d602f51a4701762488a5e696c80a45vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/**
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * Does global Ring-0 HWACCM initialization.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync *
59d96bafa78f7257869e30b88f2f98142ef5928evboxsync * @returns VBox status code.
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync */
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsyncHWACCMR0DECL(int) HWACCMR0Init();
e07acfb7f2dbb8bb40804024c79fd3139bdb3f24vboxsync
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync/**
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync * Does global Ring-0 HWACCM termination.
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @returns VBox status code.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncHWACCMR0DECL(int) HWACCMR0Term();
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/**
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * Does Ring-0 per VM HWACCM initialization.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * This is mainly to check that the Host CPU mode is compatible
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * with VMX or SVM.
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync *
6b9316bfe743cc7d2ee00d925f4ab455bc224e86vboxsync * @returns VBox status code.
b8ae33177906f4130b85b7c861cae0e78ed4859bvboxsync * @param pVM The VM to operate on.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncHWACCMR0DECL(int) HWACCMR0InitVM(PVM pVM);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/**
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * Does Ring-0 per VM HWACCM termination.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @returns VBox status code.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @param pVM The VM to operate on.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncHWACCMR0DECL(int) HWACCMR0TermVM(PVM pVM);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync/**
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync * Sets up HWACCM on all cpus.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @returns VBox status code.
d5bf937d132098565e18a0d1fc408fb777c5e5b6vboxsync * @param pVM The VM to operate on.
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync * @param enmNewHwAccmState New hwaccm state
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync *
15760030457c4d8548d42a9d543646b27eae7040vboxsync */
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsyncHWACCMR0DECL(int) HWACCMR0EnableAllCpus(PVM pVM, HWACCMSTATE enmNewHwAccmState);
d76ca6cbea4e45aa218c74e33c784bde5e997ffcvboxsync
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync/** @} */
151d00780265beb420bf27f96edfb4909d5fc76avboxsync#endif
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync#ifdef IN_RING3
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync/** @defgroup grp_hwaccm_r3 The VM Hardware Manager API
21293ca6a2967f796ed30a6c8492911619476a48vboxsync * @ingroup grp_hwaccm
21293ca6a2967f796ed30a6c8492911619476a48vboxsync * @{
21293ca6a2967f796ed30a6c8492911619476a48vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/**
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync * Checks if internal events are pending
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync *
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync * @returns boolean
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @param pVM The VM to operate on.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsyncHWACCMR3DECL(bool) HWACCMR3IsEventPending(PVM pVM);
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync/**
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync * Initializes the HWACCM.
35d8d2372afb180daa0ba01af33a1922511d6b07vboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @returns VBox status code.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @param pVM The VM to operate on.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
7a71f66d53a7dcdf19a7a357e99e560fda812dc3vboxsyncHWACCMR3DECL(int) HWACCMR3Init(PVM pVM);
f2490dbf97c8247439446844458461b00e50beb0vboxsync
d20e5d189feff7841cc3f40e5c9cca8c86b45eb5vboxsync/**
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * Initialize VT-x or AMD-V
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync *
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync * @returns VBox status code.
badc6d0a88e64de11285f73127a7e1651b69a00bvboxsync * @param pVM The VM handle.
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsync */
382dd16193dd5770e53a99d3e3f3bc4e96f1ddd8vboxsyncHWACCMR3DECL(int) HWACCMR3InitFinalizeR0(PVM pVM);
f2490dbf97c8247439446844458461b00e50beb0vboxsync
025f9c7729f643fb8780153dc0e6f1c76baddd69vboxsync/**
025f9c7729f643fb8780153dc0e6f1c76baddd69vboxsync * Applies relocations to data and code managed by this
025f9c7729f643fb8780153dc0e6f1c76baddd69vboxsync * component. This function will be called at init and
6a801286d1ede5d68a7490a9cd2a6ba0634ff18avboxsync * whenever the VMM need to relocate it self inside the GC.
f2490dbf97c8247439446844458461b00e50beb0vboxsync *
f2490dbf97c8247439446844458461b00e50beb0vboxsync * The HWACCM will update the addresses used by the switcher.
f2490dbf97c8247439446844458461b00e50beb0vboxsync *
f2490dbf97c8247439446844458461b00e50beb0vboxsync * @param pVM The VM.
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync */
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsyncHWACCMR3DECL(void) HWACCMR3Relocate(PVM pVM);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/**
76f5d3db08b007661ae4af93200838d24683af52vboxsync * Terminates the VMXM.
76f5d3db08b007661ae4af93200838d24683af52vboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Termination means cleaning up and freeing all resources,
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * the VM it self is at this point powered off or suspended.
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync *
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync * @returns VBox status code.
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync * @param pVM The VM to operate on.
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync */
fbf482cad760a830bc8789ad639162019954ba80vboxsyncHWACCMR3DECL(int) HWACCMR3Term(PVM pVM);
fbf482cad760a830bc8789ad639162019954ba80vboxsync
fbf482cad760a830bc8789ad639162019954ba80vboxsync/**
fbf482cad760a830bc8789ad639162019954ba80vboxsync * VMXM reset callback.
50453af238fcec34bf98f91cc4c32bf57f738bd3vboxsync *
2c1d8cd8efdd4c486ff681135035d24111b03af8vboxsync * @param pVM The VM which is reset.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncHWACCMR3DECL(void) HWACCMR3Reset(PVM pVM);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
eeb2d581c99b451fb1a26a5870af65981dc9cd5dvboxsync
0ce6ae9d6efed5d54222a13bbdabce9e688e4447vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Checks if we can currently use hardware accelerated raw mode.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
c4d6c81bd0de216d0f42db2e477b1d788fbaefb4vboxsync * @returns boolean
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param pVM The VM to operate on.
e07acfb7f2dbb8bb40804024c79fd3139bdb3f24vboxsync * @param pCtx Partial VM execution context
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncHWACCMR3DECL(bool) HWACCMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Checks if we are currently using hardware accelerated raw mode.
c7a378ed2fbad681c0b674351d698ef20a368935vboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @returns boolean
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncHWACCMR3DECL(bool) HWACCMR3IsActive(PVM pVM);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
c7a378ed2fbad681c0b674351d698ef20a368935vboxsync/**
c7a378ed2fbad681c0b674351d698ef20a368935vboxsync * Checks if we are currently using nested paging.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @returns boolean
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncHWACCMR3DECL(bool) HWACCMR3IsNestedPagingActive(PVM pVM);
23ab2e25f17cdd6af9c0448ee70905a8c1c82896vboxsync
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Checks hardware accelerated raw mode is allowed.
f6dde23cd488aee26203b38ec67220270f5c4273vboxsync *
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync * @returns boolean
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync * @param pVM The VM to operate on.
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync */
43e9355f77c0463e7ace350984bb5a09fb8c50a1vboxsyncHWACCMR3DECL(bool) HWACCMR3IsAllowed(PVM pVM);
611af5c9fc04865215e86b6e4906c9dfdfb6a381vboxsync
d07e901177d22a8f66c66f155c423a524ac07776vboxsync/**
d07e901177d22a8f66c66f155c423a524ac07776vboxsync * Notification callback which is called whenever there is a chance that a CR3
d07e901177d22a8f66c66f155c423a524ac07776vboxsync * value might have changed.
d07e901177d22a8f66c66f155c423a524ac07776vboxsync * This is called by PGM.
d07e901177d22a8f66c66f155c423a524ac07776vboxsync *
d07e901177d22a8f66c66f155c423a524ac07776vboxsync * @param pVM The VM to operate on.
d07e901177d22a8f66c66f155c423a524ac07776vboxsync * @param enmShadowMode New paging mode.
f48fe310f85f13db0140bef980de1f56c2007957vboxsync */
f48fe310f85f13db0140bef980de1f56c2007957vboxsyncHWACCMR3DECL(void) HWACCMR3PagingModeChanged(PVM pVM, PGMMODE enmShadowMode);
f48fe310f85f13db0140bef980de1f56c2007957vboxsync
f48fe310f85f13db0140bef980de1f56c2007957vboxsync/** @} */
1b186b95b77faa977d3651bbfc13afb3f13e0225vboxsync#endif
40becad9511726726c5959a8ad8b62fb3e1c020cvboxsync
0b10203d41681eb80716c97a34ed6c3b6d5318ccvboxsync#ifdef IN_RING0
611af5c9fc04865215e86b6e4906c9dfdfb6a381vboxsync/** @addtogroup grp_hwaccm_r0
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync * @{
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync */
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync
d4f7483a46e1c44ae5fcc4195be291545ae720a4vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Sets up a VT-x or AMD-V session
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync * @returns VBox status code.
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync * @param pVM The VM to operate on.
2bb146bb69b6bb39e697cc915e53f4059c15b1bfvboxsync */
2bb146bb69b6bb39e697cc915e53f4059c15b1bfvboxsyncHWACCMR0DECL(int) HWACCMR0SetupVM(PVM pVM);
50453af238fcec34bf98f91cc4c32bf57f738bd3vboxsync
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync/**
f9cac318205d74ee5b35dabcf2bd39118f6293d7vboxsync * Runs guest code in a VMX/SVM VM.
4831e82ecaa3c813398d2f343e9d38ee34a3acf4vboxsync *
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * @returns VBox status code.
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync * @param pVM The VM to operate on.
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsync */
f7c0f913c4c22ee18059ff97055442566d0f14a1vboxsyncHWACCMR0DECL(int) HWACCMR0RunGuestCode(PVM pVM);
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync
db85b6b8ce514217c1fb35d04b0854a65dc299f3vboxsync/**
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync * Enters the VT-x or AMD-V session
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync *
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync * @returns VBox status code.
3221ae1f7bf53d9cccdd578099f55f782dba1447vboxsync * @param pVM The VM to operate on.
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync */
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsyncHWACCMR0DECL(int) HWACCMR0Enter(PVM pVM);
8184f68cdef3c26869cdebc6a18829c854d0d17dvboxsync
5e3a885d489b1c99d79d576813f8f321bae46927vboxsync
/**
* Leaves the VT-x or AMD-V session
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
HWACCMR0DECL(int) HWACCMR0Leave(PVM pVM);
/**
* Invalidates a guest page
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param GCVirt Page to invalidate
*/
HWACCMR0DECL(int) HWACCMR0InvalidatePage(PVM pVM, RTGCPTR GCVirt);
/**
* Flushes the guest TLB
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
HWACCMR0DECL(int) HWACCMR0FlushTLB(PVM pVM);
/** @} */
#endif
/** @} */
__END_DECLS
#endif