VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/HMVMXR0.h@ 78927

Last change on this file since 78927 was 78220, checked in by vboxsync, 6 years ago

VMM: Nested VMX: bugref:9180 Hardware-assisted nested VT-x infrastructure changes and VM-entry implementation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 3.4 KB
Line 
1/* $Id: HMVMXR0.h 78220 2019-04-20 04:08:44Z vboxsync $ */
2/** @file
3 * HM VMX (VT-x) - Internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VMM_INCLUDED_SRC_VMMR0_HMVMXR0_h
19#define VMM_INCLUDED_SRC_VMMR0_HMVMXR0_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24RT_C_DECLS_BEGIN
25
26/** @defgroup grp_vmx_int Internal
27 * @ingroup grp_vmx
28 * @internal
29 * @{
30 */
31
32#ifdef IN_RING0
33
34VMMR0DECL(int) VMXR0Enter(PVMCPU pVCpu);
35VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);
36VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys,
37 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs);
38VMMR0DECL(int) VMXR0DisableCpu(void *pvPageCpu, RTHCPHYS pPageCpuPhys);
39VMMR0DECL(int) VMXR0GlobalInit(void);
40VMMR0DECL(void) VMXR0GlobalTerm(void);
41VMMR0DECL(int) VMXR0InitVM(PVM pVM);
42VMMR0DECL(int) VMXR0TermVM(PVM pVM);
43VMMR0DECL(int) VMXR0SetupVM(PVM pVM);
44VMMR0DECL(int) VMXR0ExportHostState(PVMCPU pVCpu);
45VMMR0DECL(int) VMXR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt);
46VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat);
47VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu);
48DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu);
49DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu);
50
51# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
52DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMXVMCSCACHE pVmcsCache, PVM pVM, PVMCPU pVCpu);
53VMMR0DECL(int) VMXR0Execute64BitsHandler(PVMCPU pVCpu, HM64ON32OP enmOp, uint32_t cbParam, uint32_t *paParam);
54# endif
55
56/* Cached VMCS accesses -- defined only for 32-bit hosts (with 64-bit guest support). */
57# ifdef VMX_USE_CACHED_VMCS_ACCESSES
58VMMR0DECL(int) VMXWriteCachedVmcsEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val);
59
60DECLINLINE(int) VMXReadCachedVmcsEx(PVMCPU pVCpu, uint32_t idxCache, RTGCUINTREG *pVal)
61{
62 Assert(idxCache <= VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX);
63 *pVal = pVCpu->hm.s.vmx.VmcsCache.Read.aFieldVal[idxCache];
64 return VINF_SUCCESS;
65}
66# endif
67
68# if HC_ARCH_BITS == 32
69# define VMXReadVmcsHstN VMXReadVmcs32
70# define VMXReadVmcsGstN(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField##_CACHE_IDX, pVal)
71# define VMXReadVmcsGstNByIdxVal(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField, pVal)
72# else /* HC_ARCH_BITS == 64 */
73# define VMXReadVmcsHstN VMXReadVmcs64
74# define VMXReadVmcsGstN VMXReadVmcs64
75# define VMXReadVmcsGstNByIdxVal VMXReadVmcs64
76# endif
77
78#endif /* IN_RING0 */
79
80/** @} */
81
82RT_C_DECLS_END
83
84#endif /* !VMM_INCLUDED_SRC_VMMR0_HMVMXR0_h */
85
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