VirtualBox

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

Last change on this file since 72687 was 72643, checked in by vboxsync, 7 years ago

VMM: Make SVM R0 code use CPUMCTX_EXTRN_xxx flags and cleanups. bugref:9193

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 3.5 KB
Line 
1/* $Id: HMVMXR0.h 72643 2018-06-21 16:02:03Z vboxsync $ */
2/** @file
3 * HM VMX (VT-x) - Internal header file.
4 */
5
6/*
7 * Copyright (C) 2006-2017 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 ___HMVMXR0_h
19#define ___HMVMXR0_h
20
21RT_C_DECLS_BEGIN
22
23/** @defgroup grp_vmx_int Internal
24 * @ingroup grp_vmx
25 * @internal
26 * @{
27 */
28
29#ifdef IN_RING0
30
31VMMR0DECL(int) VMXR0Enter(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu);
32VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);
33VMMR0DECL(int) VMXR0EnableCpu(PHMGLOBALCPUINFO pCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys,
34 bool fEnabledBySystem, void *pvMsrs);
35VMMR0DECL(int) VMXR0DisableCpu(PHMGLOBALCPUINFO pCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys);
36VMMR0DECL(int) VMXR0GlobalInit(void);
37VMMR0DECL(void) VMXR0GlobalTerm(void);
38VMMR0DECL(int) VMXR0InitVM(PVM pVM);
39VMMR0DECL(int) VMXR0TermVM(PVM pVM);
40VMMR0DECL(int) VMXR0SetupVM(PVM pVM);
41VMMR0DECL(int) VMXR0SaveHostState(PVM pVM, PVMCPU pVCpu);
42VMMR0DECL(int) VMXR0InvalidatePage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCVirt);
43VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPU pVCpu, PCPUMCTX pCtx, uint64_t fWhat);
44VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
45DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
46DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
47
48# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
49DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
50VMMR0DECL(int) VMXR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, HM64ON32OP enmOp, uint32_t cbParam,
51 uint32_t *paParam);
52# endif
53
54/* Cached VMCS accesses -- defined only for 32-bit hosts (with 64-bit guest support). */
55# ifdef VMX_USE_CACHED_VMCS_ACCESSES
56VMMR0DECL(int) VMXWriteCachedVmcsEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val);
57
58DECLINLINE(int) VMXReadCachedVmcsEx(PVMCPU pVCpu, uint32_t idxCache, RTGCUINTREG *pVal)
59{
60 Assert(idxCache <= VMX_VMCS_MAX_NESTED_PAGING_CACHE_IDX);
61 *pVal = pVCpu->hm.s.vmx.VMCSCache.Read.aFieldVal[idxCache];
62 return VINF_SUCCESS;
63}
64# endif
65
66# if HC_ARCH_BITS == 32
67# define VMXReadVmcsHstN VMXReadVmcs32
68# define VMXReadVmcsGstN(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField##_CACHE_IDX, pVal)
69# define VMXReadVmcsGstNByIdxVal(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField, pVal)
70# else /* HC_ARCH_BITS == 64 */
71# define VMXReadVmcsHstN VMXReadVmcs64
72# define VMXReadVmcsGstN VMXReadVmcs64
73# define VMXReadVmcsGstNByIdxVal VMXReadVmcs64
74# endif
75
76#endif /* IN_RING0 */
77
78/** @} */
79
80RT_C_DECLS_END
81
82#endif /* !___HMVMXR0_h */
83
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