Changeset 80274 in vbox for trunk/src/VBox
- Timestamp:
- Aug 14, 2019 2:34:38 PM (5 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r80268 r80274 87 87 * Internal Functions * 88 88 *********************************************************************************************************************************/ 89 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,89 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, 90 90 uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged); 91 91 … … 105 105 * @param fFlags HV_MAP_GPA_XXX. 106 106 */ 107 DECLINLINE(int) nemHCWinHypercallMapPage(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, uint32_t fFlags)107 DECLINLINE(int) nemHCWinHypercallMapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, uint32_t fFlags) 108 108 { 109 109 #ifdef IN_RING0 … … 133 133 * @param GCPhys The page to unmap. Does not need to be page aligned. 134 134 */ 135 DECLINLINE(int) nemHCWinHypercallUnmapPage(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhys)135 DECLINLINE(int) nemHCWinHypercallUnmapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys) 136 136 { 137 137 # ifdef IN_RING0 … … 149 149 #ifndef IN_RING0 150 150 151 NEM_TMPL_STATIC int nemHCWinCopyStateToHyperV(PVM pVM, PVMCPUpVCpu)151 NEM_TMPL_STATIC int nemHCWinCopyStateToHyperV(PVMCC pVM, PVMCPUCC pVCpu) 152 152 { 153 153 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP) … … 483 483 484 484 485 NEM_TMPL_STATIC int nemHCWinCopyStateFromHyperV(PVM pVM, PVMCPUpVCpu, uint64_t fWhat)485 NEM_TMPL_STATIC int nemHCWinCopyStateFromHyperV(PVMCC pVM, PVMCPUCC pVCpu, uint64_t fWhat) 486 486 { 487 487 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP) … … 1125 1125 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 1126 1126 */ 1127 VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat)1127 VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat) 1128 1128 { 1129 1129 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatImportOnDemand); … … 1132 1132 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1133 1133 /** @todo improve and secure this translation */ 1134 # ifdef VBOX_BUGREF_9217 1135 return nemR0WinImportState(pVCpu->pGVM, pVCpu, &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/); 1136 # else 1134 1137 PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf); 1135 1138 AssertReturn(pGVM, VERR_INVALID_VMCPU_HANDLE); … … 1139 1142 1140 1143 return nemR0WinImportState(pGVM, &pGVM->aCpus[idCpu], &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/); 1144 # endif 1141 1145 # else 1142 1146 RT_NOREF(pVCpu, fWhat); … … 1157 1161 * @param puAux Where to return the TSC_AUX register value. 1158 1162 */ 1159 VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPU pVCpu, uint64_t *pcTicks, uint32_t *puAux)1163 VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPUCC pVCpu, uint64_t *pcTicks, uint32_t *puAux) 1160 1164 { 1161 1165 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatQueryCpuTick); 1162 1166 1163 1167 #ifdef IN_RING3 1164 PVM pVM = pVCpu->CTX_SUFF(pVM);1168 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1165 1169 VMCPU_ASSERT_EMT_RETURN(pVCpu, VERR_VM_THREAD_NOT_EMT); 1166 1170 AssertReturn(VM_IS_NEM_ENABLED(pVM), VERR_NEM_IPE_9); … … 1198 1202 #else /* IN_RING0 */ 1199 1203 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1204 # ifdef VBOX_BUGREF_9217 1205 int rc = nemR0WinQueryCpuTick(pVCpu->pGVM, pVCpu, pcTicks, puAux); 1206 # else 1200 1207 /** @todo improve and secure this translation */ 1201 1208 PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf); … … 1204 1211 ASMCompilerBarrier(); 1205 1212 AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_VMCPU_HANDLE); 1206 1207 1213 int rc = nemR0WinQueryCpuTick(pGVM, &pGVM->aCpus[idCpu], pcTicks, puAux); 1214 # endif 1208 1215 if (RT_SUCCESS(rc) && puAux && !(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX)) 1209 1216 *puAux = CPUMGetGuestTscAux(pVCpu); … … 1227 1234 * @param uPausedTscValue The TSC value at the time of pausing. 1228 1235 */ 1229 VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVM pVM, PVMCPUpVCpu, uint64_t uPausedTscValue)1236 VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVMCC pVM, PVMCPUCC pVCpu, uint64_t uPausedTscValue) 1230 1237 { 1231 1238 #ifdef IN_RING0 1232 1239 # ifdef NEM_WIN_WITH_RING0_RUNLOOP 1240 # ifdef VBOX_BUGREF_9217 1241 return nemR0WinResumeCpuTickOnAll(pVM, pVCpu, uPausedTscValue); 1242 # else 1233 1243 /** @todo improve and secure this translation */ 1234 1244 PGVM pGVM = GVMMR0ByHandle(pVM->hSelf); … … 1239 1249 1240 1250 return nemR0WinResumeCpuTickOnAll(pGVM, &pGVM->aCpus[idCpu], uPausedTscValue); 1251 # endif 1241 1252 # else 1242 1253 RT_NOREF(pVM, pVCpu, uPausedTscValue); … … 1296 1307 # if defined(IN_RING0) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) 1297 1308 /** Worker for assertion macro. */ 1298 NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPU pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue)1309 NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue) 1299 1310 { 1300 1311 RT_ZERO(*pRetValue); … … 1336 1347 # else 1337 1348 /** Worker for assertion macro. */ 1338 NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPU a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue)1349 NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPUCC a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue) 1339 1350 { 1340 1351 RT_ZERO(*pRetValue); … … 1350 1361 * Get the virtual processor running status. 1351 1362 */ 1352 DECLINLINE(VID_PROCESSOR_STATUS) nemHCWinCpuGetRunningStatus(PVMCPU pVCpu)1363 DECLINLINE(VID_PROCESSOR_STATUS) nemHCWinCpuGetRunningStatus(PVMCPUCC pVCpu) 1353 1364 { 1354 1365 # ifdef IN_RING0 … … 1386 1397 * calling EMT. 1387 1398 */ 1388 NEM_TMPL_STATIC int nemHCWinCancelRunVirtualProcessor(PVM pVM, PVMCPUpVCpu)1399 NEM_TMPL_STATIC int nemHCWinCancelRunVirtualProcessor(PVMCC pVM, PVMCPUCC pVCpu) 1389 1400 { 1390 1401 /* … … 1448 1459 * Logs the current CPU state. 1449 1460 */ 1450 NEM_TMPL_STATIC void nemHCWinLogState(PVM pVM, PVMCPUpVCpu)1461 NEM_TMPL_STATIC void nemHCWinLogState(PVMCC pVM, PVMCPUCC pVCpu) 1451 1462 { 1452 1463 if (LogIs3Enabled()) … … 1565 1576 */ 1566 1577 DECLINLINE(void) 1567 nemHCWinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, uint8_t cbMinInstr)1578 nemHCWinAdvanceGuestRipAndClearRF(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, uint8_t cbMinInstr) 1568 1579 { 1569 1580 Assert(!(pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS))); … … 1590 1601 * @param cbMinInstr The minimum instruction length, or 1 if not unknown. 1591 1602 */ 1592 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx, uint8_t cbMinInstr)1603 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPUCC pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx, uint8_t cbMinInstr) 1593 1604 { 1594 1605 Assert(!(pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS))); … … 1610 1621 1611 1622 NEM_TMPL_STATIC DECLCALLBACK(int) 1612 nemHCWinUnmapOnePageCallback(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhys, uint8_t *pu2NemState, void *pvUser)1623 nemHCWinUnmapOnePageCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, uint8_t *pu2NemState, void *pvUser) 1613 1624 { 1614 1625 RT_NOREF_PV(pvUser); … … 1663 1674 */ 1664 1675 NEM_TMPL_STATIC DECLCALLBACK(int) 1665 nemHCWinHandleMemoryAccessPageCheckerCallback(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhys, PPGMPHYSNEMPAGEINFO pInfo, void *pvUser)1676 nemHCWinHandleMemoryAccessPageCheckerCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, PPGMPHYSNEMPAGEINFO pInfo, void *pvUser) 1666 1677 { 1667 1678 NEMHCWINHMACPCCSTATE *pState = (NEMHCWINHMACPCCSTATE *)pvUser; … … 1848 1859 * @param pszCaller Who is doing the importing. 1849 1860 */ 1850 DECLINLINE(VBOXSTRICTRC) nemR0WinImportStateStrict(PGVM pGVM, PGVMCPU pGVCpu, PVMCPU pVCpu, uint64_t fWhat, const char *pszCaller)1861 DECLINLINE(VBOXSTRICTRC) nemR0WinImportStateStrict(PGVM pGVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu, uint64_t fWhat, const char *pszCaller) 1851 1862 { 1852 1863 int rc = nemR0WinImportState(pGVM, pGVCpu, &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/); … … 1879 1890 * @param pszCaller Who is doing the importing. 1880 1891 */ 1881 DECLINLINE(VBOXSTRICTRC) nemHCWinImportStateIfNeededStrict(PVMCPU pVCpu, PGVMCPU pGVCpu, uint64_t fWhat, const char *pszCaller)1892 DECLINLINE(VBOXSTRICTRC) nemHCWinImportStateIfNeededStrict(PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint64_t fWhat, const char *pszCaller) 1882 1893 { 1883 1894 if (pVCpu->cpum.GstCtx.fExtrn & fWhat) … … 1905 1916 * @sa nemR3WinCopyStateFromX64Header 1906 1917 */ 1907 DECLINLINE(void) nemHCWinCopyStateFromX64Header(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pHdr)1918 DECLINLINE(void) nemHCWinCopyStateFromX64Header(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pHdr) 1908 1919 { 1909 1920 Assert( (pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_NEM_WIN_INHIBIT_INT)) … … 1936 1947 * @sa nemHCWinCopyStateFromX64Header 1937 1948 */ 1938 DECLINLINE(void) nemR3WinCopyStateFromX64Header(PVMCPU pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx)1949 DECLINLINE(void) nemR3WinCopyStateFromX64Header(PVMCPUCC pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx) 1939 1950 { 1940 1951 Assert( (pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_NEM_WIN_INHIBIT_INT)) … … 1972 1983 */ 1973 1984 NEM_TMPL_STATIC VBOXSTRICTRC 1974 nemHCWinHandleMessageMemory(PVM pVM, PVMCPUpVCpu, HV_X64_MEMORY_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)1985 nemHCWinHandleMessageMemory(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_MEMORY_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu) 1975 1986 { 1976 1987 uint64_t const uHostTsc = ASMReadTSC(); … … 2098 2109 */ 2099 2110 NEM_TMPL_STATIC VBOXSTRICTRC 2100 nemR3WinHandleExitMemory(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)2111 nemR3WinHandleExitMemory(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2101 2112 { 2102 2113 uint64_t const uHostTsc = ASMReadTSC(); … … 2196 2207 */ 2197 2208 NEM_TMPL_STATIC VBOXSTRICTRC 2198 nemHCWinHandleMessageIoPort(PVM pVM, PVMCPUpVCpu, HV_X64_IO_PORT_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)2209 nemHCWinHandleMessageIoPort(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_IO_PORT_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu) 2199 2210 { 2200 2211 /* … … 2411 2422 * @sa nemHCWinHandleMessageIoPort 2412 2423 */ 2413 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitIoPort(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)2424 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitIoPort(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2414 2425 { 2415 2426 Assert( pExit->IoPortAccess.AccessInfo.AccessSize == 1 … … 2579 2590 */ 2580 2591 NEM_TMPL_STATIC VBOXSTRICTRC 2581 nemHCWinHandleMessageInterruptWindow(PVM pVM, PVMCPUpVCpu, HV_X64_INTERRUPT_WINDOW_MESSAGE const *pMsg, PGVMCPU pGVCpu)2592 nemHCWinHandleMessageInterruptWindow(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_INTERRUPT_WINDOW_MESSAGE const *pMsg, PGVMCPU pGVCpu) 2582 2593 { 2583 2594 /* … … 2614 2625 * @sa nemHCWinHandleMessageInterruptWindow 2615 2626 */ 2616 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitInterruptWindow(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)2627 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitInterruptWindow(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2617 2628 { 2618 2629 /* … … 2653 2664 * @sa nemR3WinHandleExitCpuId 2654 2665 */ 2655 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVM pVM, PVMCPUpVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg,2666 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg, 2656 2667 PGVMCPU pGVCpu) 2657 2668 { … … 2745 2756 */ 2746 2757 NEM_TMPL_STATIC VBOXSTRICTRC 2747 nemR3WinHandleExitCpuId(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)2758 nemR3WinHandleExitCpuId(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2748 2759 { 2749 2760 PCEMEXITREC pExitRec = EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FT(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID), … … 2820 2831 * @sa nemR3WinHandleExitMsr 2821 2832 */ 2822 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageMsr(PVMCPU pVCpu, HV_X64_MSR_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)2833 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageMsr(PVMCPUCC pVCpu, HV_X64_MSR_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu) 2823 2834 { 2824 2835 /* … … 2972 2983 * @sa nemHCWinHandleMessageMsr 2973 2984 */ 2974 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitMsr(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)2985 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitMsr(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 2975 2986 { 2976 2987 /* … … 3168 3179 */ 3169 3180 DECLINLINE(void) 3170 nemHCWinCopyStateFromExceptionMessage(PVMCPU pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, bool fClearXcpt)3181 nemHCWinCopyStateFromExceptionMessage(PVMCPUCC pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, bool fClearXcpt) 3171 3182 { 3172 3183 nemHCWinCopyStateFromX64Header(pVCpu, &pMsg->Header); … … 3200 3211 * @param fClearXcpt Clear pending exception. 3201 3212 */ 3202 DECLINLINE(void) nemR3WinCopyStateFromExceptionMessage(PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, bool fClearXcpt)3213 DECLINLINE(void) nemR3WinCopyStateFromExceptionMessage(PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, bool fClearXcpt) 3203 3214 { 3204 3215 nemR3WinCopyStateFromX64Header(pVCpu, &pExit->VpContext); … … 3220 3231 */ 3221 3232 NEM_TMPL_STATIC VBOXSTRICTRC 3222 nemHCWinHandleMessageException(PVMCPU pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)3233 nemHCWinHandleMessageException(PVMCPUCC pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu) 3223 3234 { 3224 3235 /* … … 3347 3358 * @sa nemR3WinHandleExitException 3348 3359 */ 3349 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitException(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)3360 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitException(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 3350 3361 { 3351 3362 /* … … 3456 3467 */ 3457 3468 NEM_TMPL_STATIC VBOXSTRICTRC 3458 nemHCWinHandleMessageUnrecoverableException(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, PGVMCPU pGVCpu)3469 nemHCWinHandleMessageUnrecoverableException(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, PGVMCPU pGVCpu) 3459 3470 { 3460 3471 /* Check message register value sanity. */ … … 3514 3525 * @sa nemHCWinHandleMessageUnrecoverableException 3515 3526 */ 3516 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitUnrecoverableException(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)3527 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitUnrecoverableException(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 3517 3528 { 3518 3529 # if 0 … … 3574 3585 */ 3575 3586 NEM_TMPL_STATIC VBOXSTRICTRC 3576 nemHCWinHandleMessage(PVM pVM, PVMCPUpVCpu, VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader, PGVMCPU pGVCpu)3587 nemHCWinHandleMessage(PVMCC pVM, PVMCPUCC pVCpu, VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader, PGVMCPU pGVCpu) 3577 3588 { 3578 3589 if (pMappingHeader->enmVidMsgType == VidMessageHypervisorMessage) … … 3668 3679 * @sa nemHCWinHandleMessage 3669 3680 */ 3670 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExit(PVM pVM, PVMCPUpVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)3681 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExit(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit) 3671 3682 { 3672 3683 switch (pExit->ExitReason) … … 3738 3749 * @param cMillies The timeout in milliseconds 3739 3750 */ 3740 static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, PVMCPU pVCpu,3751 static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu, 3741 3752 uint32_t fFlags, uint32_t cMillies) 3742 3753 { … … 3744 3755 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = fFlags; 3745 3756 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies; 3746 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, p GVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,3757 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3747 3758 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3748 3759 pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput, … … 3768 3779 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = fFlags & ~VID_MSHAGN_F_HANDLE_MESSAGE; 3769 3780 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies; 3770 rcNt = nemR0NtPerformIoControl(pGVM, p GVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,3781 rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 3771 3782 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 3772 3783 pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput, … … 3798 3809 * @param pGVCpu The global (ring-0) per CPU structure (NULL in r3). 3799 3810 */ 3800 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinStopCpu(PVM pVM, PVMCPUpVCpu, VBOXSTRICTRC rcStrict,3811 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinStopCpu(PVMCC pVM, PVMCPUCC pVCpu, VBOXSTRICTRC rcStrict, 3801 3812 VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader, 3802 3813 PGVM pGVM, PGVMCPU pGVCpu) … … 3813 3824 # ifdef IN_RING0 3814 3825 pVCpu->nem.s.uIoCtlBuf.idCpu = pGVCpu->idCpu; 3815 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, p GVM->nemr0.s.IoCtlStopVirtualProcessor.uFunction,3826 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlStopVirtualProcessor.uFunction, 3816 3827 &pVCpu->nem.s.uIoCtlBuf.idCpu, sizeof(pVCpu->nem.s.uIoCtlBuf.idCpu), 3817 3828 NULL, 0); … … 3951 3962 * @param pfInterruptWindows Where to return interrupt window flags. 3952 3963 */ 3953 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleInterruptFF(PVM pVM, PVMCPUpVCpu, PGVMCPU pGVCpu, uint8_t *pfInterruptWindows)3964 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleInterruptFF(PVMCC pVM, PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint8_t *pfInterruptWindows) 3954 3965 { 3955 3966 Assert(!TRPMHasTrap(pVCpu)); … … 4059 4070 * @param pGVCpu The ring-0 per CPU structure (NULL in ring-3). 4060 4071 */ 4061 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinRunGC(PVM pVM, PVMCPUpVCpu, PGVM pGVM, PGVMCPU pGVCpu)4072 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinRunGC(PVMCC pVM, PVMCPUCC pVCpu, PGVM pGVM, PGVMCPU pGVCpu) 4062 4073 { 4063 4074 LogFlow(("NEM/%u: %04x:%08RX64 efl=%#08RX64 <=\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.rip, pVCpu->cpum.GstCtx.rflags)); … … 4198 4209 # ifdef IN_RING0 4199 4210 pVCpu->nem.s.uIoCtlBuf.idCpu = pGVCpu->idCpu; 4200 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, p GVM->nemr0.s.IoCtlStartVirtualProcessor.uFunction,4211 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlStartVirtualProcessor.uFunction, 4201 4212 &pVCpu->nem.s.uIoCtlBuf.idCpu, sizeof(pVCpu->nem.s.uIoCtlBuf.idCpu), 4202 4213 NULL, 0); … … 4235 4246 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = pVCpu->nem.s.fHandleAndGetFlags; 4236 4247 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMsWait; 4237 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, p GVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,4248 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 4238 4249 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, 4239 4250 pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput, … … 4412 4423 * @callback_method_impl{FNPGMPHYSNEMCHECKPAGE} 4413 4424 */ 4414 NEM_TMPL_STATIC DECLCALLBACK(int) nemHCWinUnsetForA20CheckerCallback(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhys,4425 NEM_TMPL_STATIC DECLCALLBACK(int) nemHCWinUnsetForA20CheckerCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, 4415 4426 PPGMPHYSNEMPAGEINFO pInfo, void *pvUser) 4416 4427 { … … 4456 4467 * @param GCPhys The page to unmap. 4457 4468 */ 4458 NEM_TMPL_STATIC int nemHCWinUnmapPageForA20Gate(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhys)4469 NEM_TMPL_STATIC int nemHCWinUnmapPageForA20Gate(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys) 4459 4470 { 4460 4471 PGMPHYSNEMPAGEINFO Info; … … 4464 4475 4465 4476 4466 void nemHCNativeNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb)4477 void nemHCNativeNotifyHandlerPhysicalRegister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb) 4467 4478 { 4468 4479 Log5(("nemHCNativeNotifyHandlerPhysicalRegister: %RGp LB %RGp enmKind=%d\n", GCPhys, cb, enmKind)); … … 4471 4482 4472 4483 4473 void nemHCNativeNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,4484 void nemHCNativeNotifyHandlerPhysicalDeregister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, 4474 4485 int fRestoreAsRAM, bool fRestoreAsRAM2) 4475 4486 { … … 4480 4491 4481 4492 4482 void nemHCNativeNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,4493 void nemHCNativeNotifyHandlerPhysicalModify(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, 4483 4494 RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM) 4484 4495 { … … 4507 4518 * @thread EMT(pVCpu) 4508 4519 */ 4509 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVM pVM, PVMCPUpVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,4520 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, 4510 4521 uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged) 4511 4522 { … … 4727 4738 4728 4739 4729 NEM_TMPL_STATIC int nemHCJustUnmapPageFromHyperV(PVM pVM, RTGCPHYS GCPhysDst, uint8_t *pu2State)4740 NEM_TMPL_STATIC int nemHCJustUnmapPageFromHyperV(PVMCC pVM, RTGCPHYS GCPhysDst, uint8_t *pu2State) 4730 4741 { 4731 4742 if (*pu2State <= NEM_WIN_PAGE_STATE_UNMAPPED) … … 4737 4748 4738 4749 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0) 4739 PVMCPU pVCpu = VMMGetCpu(pVM);4750 PVMCPUCC pVCpu = VMMGetCpu(pVM); 4740 4751 int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhysDst); 4741 4752 AssertRC(rc); … … 4765 4776 4766 4777 4767 int nemHCNativeNotifyPhysPageAllocated(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,4778 int nemHCNativeNotifyPhysPageAllocated(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt, 4768 4779 PGMPAGETYPE enmType, uint8_t *pu2State) 4769 4780 { … … 4774 4785 int rc; 4775 4786 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0) 4776 PVMCPU pVCpu = VMMGetCpu(pVM);4787 PVMCPUCC pVCpu = VMMGetCpu(pVM); 4777 4788 if ( pVM->nem.s.fA20Enabled 4778 4789 || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys)) … … 4800 4811 4801 4812 4802 void nemHCNativeNotifyPhysPageProtChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,4813 void nemHCNativeNotifyPhysPageProtChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt, 4803 4814 PGMPAGETYPE enmType, uint8_t *pu2State) 4804 4815 { … … 4808 4819 4809 4820 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0) 4810 PVMCPU pVCpu = VMMGetCpu(pVM);4821 PVMCPUCC pVCpu = VMMGetCpu(pVM); 4811 4822 if ( pVM->nem.s.fA20Enabled 4812 4823 || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys)) … … 4831 4842 4832 4843 4833 void nemHCNativeNotifyPhysPageChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,4844 void nemHCNativeNotifyPhysPageChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew, 4834 4845 uint32_t fPageProt, PGMPAGETYPE enmType, uint8_t *pu2State) 4835 4846 { … … 4839 4850 4840 4851 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0) 4841 PVMCPU pVCpu = VMMGetCpu(pVM);4852 PVMCPUCC pVCpu = VMMGetCpu(pVM); 4842 4853 if ( pVM->nem.s.fA20Enabled 4843 4854 || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys)) -
trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp
r80064 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_CPUM 23 24 #include <VBox/vmm/cpum.h> 24 25 #include "CPUMInternal.h" 25 #include <VBox/vmm/vm .h>26 #include <VBox/vmm/vmcc.h> 26 27 #include <VBox/vmm/gvm.h> 27 28 #include <VBox/err.h> … … 102 103 static void cpumR0UnmapLocalApics(void); 103 104 #endif 104 static int cpumR0SaveHostDebugState(PVMCPU pVCpu);105 static int cpumR0SaveHostDebugState(PVMCPUCC pVCpu); 105 106 106 107 … … 145 146 static DECLCALLBACK(void) cpumR0CheckCpuid(RTCPUID idCpu, void *pvUser1, void *pvUser2) 146 147 { 147 PVM pVM = (PVM)pvUser1;148 PVMCC pVM = (PVMCC)pvUser1; 148 149 149 150 NOREF(idCpu); NOREF(pvUser2); … … 183 184 * @param pVM The cross context VM structure. 184 185 */ 185 VMMR0_INT_DECL(int) CPUMR0InitVM(PVM pVM)186 VMMR0_INT_DECL(int) CPUMR0InitVM(PVMCC pVM) 186 187 { 187 188 LogFlow(("CPUMR0Init: %p\n", pVM)); … … 297 298 298 299 if (pVM->cpum.s.GuestFeatures.fArchCap) 299 for (VMCPUID i = 0; i < pVM->cCpus; i++) 300 pVM->aCpus[i].cpum.s.GuestMsrs.msr.ArchCaps = fArchVal; 300 VMCC_FOR_EACH_VMCPU_STMT(pVM, pVCpu->cpum.s.GuestMsrs.msr.ArchCaps = fArchVal); 301 301 } 302 302 else … … 347 347 if (u32DR7 & X86_DR7_ENABLED_MASK) 348 348 { 349 #ifdef VBOX_BUGREF_9217 350 PGVM pGVM = (PGVM)pVM; 351 for (VMCPUID i = 0; i < pGVM->cCpusSafe; i++) 352 pGVM->aCpus[i].cpum.s.fUseFlags |= CPUM_USE_DEBUG_REGS_HOST; 353 #else 354 for (VMCPUID i = 0; i < pVM->cCpus; i++) 355 pVM->aCpus[i].cpum.s.fUseFlags |= CPUM_USE_DEBUG_REGS_HOST; 356 #endif 349 VMCC_FOR_EACH_VMCPU_STMT(pVM, pVCpu->cpum.s.fUseFlags |= CPUM_USE_DEBUG_REGS_HOST); 357 350 Log(("CPUMR0Init: host uses debug registers (dr7=%x)\n", u32DR7)); 358 351 } … … 374 367 * @param pVCpu The cross context virtual CPU structure. 375 368 */ 376 VMMR0_INT_DECL(int) CPUMR0Trap07Handler(PVM pVM, PVMCPUpVCpu)369 VMMR0_INT_DECL(int) CPUMR0Trap07Handler(PVMCC pVM, PVMCPUCC pVCpu) 377 370 { 378 371 Assert(pVM->cpum.s.HostFeatures.fFxSaveRstor); … … 436 429 * @param pVCpu The cross context virtual CPU structure. 437 430 */ 438 VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(PVM pVM, PVMCPUpVCpu)431 VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(PVMCC pVM, PVMCPUCC pVCpu) 439 432 { 440 433 int rc; … … 480 473 * @param pVCpu The cross context virtual CPU structure. 481 474 */ 482 VMMR0_INT_DECL(bool) CPUMR0FpuStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu)475 VMMR0_INT_DECL(bool) CPUMR0FpuStateMaybeSaveGuestAndRestoreHost(PVMCPUCC pVCpu) 483 476 { 484 477 bool fSavedGuest; … … 523 516 * @param pVCpu The cross context virtual CPU structure. 524 517 */ 525 static int cpumR0SaveHostDebugState(PVMCPU pVCpu)518 static int cpumR0SaveHostDebugState(PVMCPUCC pVCpu) 526 519 { 527 520 /* … … 564 557 * @thread EMT(pVCpu) 565 558 */ 566 VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu, bool fDr6)559 VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPUCC pVCpu, bool fDr6) 567 560 { 568 561 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 623 616 * @thread EMT(pVCpu) 624 617 */ 625 VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuest(PVMCPU pVCpu, bool fDr6)618 VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuest(PVMCPUCC pVCpu, bool fDr6) 626 619 { 627 620 /* … … 650 643 * @thread EMT(pVCpu) 651 644 */ 652 VMMR0_INT_DECL(void) CPUMR0LoadGuestDebugState(PVMCPU pVCpu, bool fDr6)645 VMMR0_INT_DECL(void) CPUMR0LoadGuestDebugState(PVMCPUCC pVCpu, bool fDr6) 653 646 { 654 647 /* … … 681 674 * @thread EMT(pVCpu) 682 675 */ 683 VMMR0_INT_DECL(void) CPUMR0LoadHyperDebugState(PVMCPU pVCpu, bool fDr6)676 VMMR0_INT_DECL(void) CPUMR0LoadHyperDebugState(PVMCPUCC pVCpu, bool fDr6) 684 677 { 685 678 /* … … 944 937 * @param iHostCpuSet The CPU set index of the current host CPU. 945 938 */ 946 VMMR0_INT_DECL(void) CPUMR0SetLApic(PVMCPU pVCpu, uint32_t iHostCpuSet)939 VMMR0_INT_DECL(void) CPUMR0SetLApic(PVMCPUCC pVCpu, uint32_t iHostCpuSet) 947 940 { 948 941 Assert(iHostCpuSet <= RT_ELEMENTS(g_aLApics)); -
trunk/src/VBox/VMM/VMMR0/EMR0.cpp
r78431 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_EM 23 24 #include <VBox/vmm/em.h> 24 25 #include "EMInternal.h" 25 #include <VBox/vmm/vm .h>26 #include <VBox/vmm/vmcc.h> 26 27 #include <VBox/vmm/gvm.h> 27 28 #include <iprt/errcore.h> … … 41 42 #ifdef VBOX_BUGREF_9217 42 43 VMMR0_INT_DECL(int) EMR0InitVM(PGVM pGVM) 43 # define pVM pGVM /* temp hack */44 44 #else 45 VMMR0_INT_DECL(int) EMR0InitVM(PGVM pGVM, PVM pVM)45 VMMR0_INT_DECL(int) EMR0InitVM(PGVM pGVM, PVMCC pVM) 46 46 #endif 47 47 { … … 49 49 * Override ring-0 exit optimizations settings. 50 50 */ 51 bool fEnabledR0 = pVM->aCpus[0].em.s.fExitOptimizationEnabled 52 && pVM->aCpus[0].em.s.fExitOptimizationEnabledR0 51 #ifdef VBOX_BUGREF_9217 52 PVMCPUCC pVCpu0 = &pGVM->aCpus[0]; 53 #else 54 PVMCPUCC pVCpu0 = VMCC_GET_CPU_0(pVM); 55 #endif 56 57 bool fEnabledR0 = pVCpu0->em.s.fExitOptimizationEnabled 58 && pVCpu0->em.s.fExitOptimizationEnabledR0 53 59 && (RTThreadPreemptIsPossible() || RTThreadPreemptIsPendingTrusty()); 54 60 bool fEnabledR0PreemptDisabled = fEnabledR0 55 && pV M->aCpus[0].em.s.fExitOptimizationEnabledR0PreemptDisabled61 && pVCpu0->em.s.fExitOptimizationEnabledR0PreemptDisabled 56 62 && RTThreadPreemptIsPendingTrusty(); 63 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) 64 { 57 65 #ifdef VBOX_BUGREF_9217 58 for (VMCPUID i = 0; i < pGVM->cCpusSafe; i++)66 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 59 67 #else 60 for (VMCPUID i = 0; i < pGVM->cCpus; i++)68 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 61 69 #endif 62 { 63 pVM->aCpus[i].em.s.fExitOptimizationEnabledR0 = fEnabledR0; 64 pVM->aCpus[i].em.s.fExitOptimizationEnabledR0PreemptDisabled = fEnabledR0PreemptDisabled; 70 pVCpu->em.s.fExitOptimizationEnabledR0 = fEnabledR0; 71 pVCpu->em.s.fExitOptimizationEnabledR0PreemptDisabled = fEnabledR0PreemptDisabled; 65 72 } 66 73 -
trunk/src/VBox/VMM/VMMR0/GIMR0.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_GIM 23 24 #include <VBox/vmm/gim.h> 24 25 #include "GIMInternal.h" 25 26 #include "GIMHvInternal.h" 26 #include <VBox/vmm/vm .h>27 #include <VBox/vmm/vmcc.h> 27 28 28 29 #include <VBox/err.h> … … 35 36 * @param pVM The cross context VM structure. 36 37 */ 37 VMMR0_INT_DECL(int) GIMR0InitVM(PVM pVM)38 VMMR0_INT_DECL(int) GIMR0InitVM(PVMCC pVM) 38 39 { 39 40 if (!GIMIsEnabled(pVM)) … … 61 62 * @param pVM The cross context VM structure. 62 63 */ 63 VMMR0_INT_DECL(int) GIMR0TermVM(PVM pVM)64 VMMR0_INT_DECL(int) GIMR0TermVM(PVMCC pVM) 64 65 { 65 66 if (!GIMIsEnabled(pVM)) … … 97 98 * @thread EMT(pVCpu) 98 99 */ 99 VMMR0_INT_DECL(int) GIMR0UpdateParavirtTsc(PVM pVM, uint64_t u64Offset)100 VMMR0_INT_DECL(int) GIMR0UpdateParavirtTsc(PVMCC pVM, uint64_t u64Offset) 100 101 { 101 102 switch (pVM->gim.s.enmProviderId) -
trunk/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_GIM 23 24 #include <VBox/vmm/gim.h> … … 25 26 #include "GIMInternal.h" 26 27 #include "GIMHvInternal.h" 27 #include <VBox/vmm/vm .h>28 #include <VBox/vmm/vmcc.h> 28 29 29 30 #include <VBox/err.h> … … 93 94 * @thread EMT. 94 95 */ 95 VMM_INT_DECL(int) gimR0HvUpdateParavirtTsc(PVM pVM, uint64_t u64Offset)96 VMM_INT_DECL(int) gimR0HvUpdateParavirtTsc(PVMCC pVM, uint64_t u64Offset) 96 97 { 97 98 Assert(GIMIsEnabled(pVM)); … … 150 151 * @param pVM The cross context VM structure. 151 152 */ 152 VMMR0_INT_DECL(int) gimR0HvInitVM(PVM pVM)153 VMMR0_INT_DECL(int) gimR0HvInitVM(PVMCC pVM) 153 154 { 154 155 AssertPtr(pVM); … … 169 170 * @param pVM The cross context VM structure. 170 171 */ 171 VMMR0_INT_DECL(int) gimR0HvTermVM(PVM pVM)172 VMMR0_INT_DECL(int) gimR0HvTermVM(PVMCC pVM) 172 173 { 173 174 AssertPtr(pVM); -
trunk/src/VBox/VMM/VMMR0/GIMR0Kvm.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_GIM 23 24 #include <VBox/vmm/gim.h> … … 25 26 #include "GIMInternal.h" 26 27 #include "GIMKvmInternal.h" 27 #include <VBox/vmm/vm .h>28 #include <VBox/vmm/vmcc.h> 28 29 29 30 #include <VBox/err.h> … … 41 42 * @remarks Can be called with preemption disabled! 42 43 */ 43 VMM_INT_DECL(int) gimR0KvmUpdateSystemTime(PVM pVM, PVMCPUpVCpu)44 VMM_INT_DECL(int) gimR0KvmUpdateSystemTime(PVMCC pVM, PVMCPUCC pVCpu) 44 45 { 45 46 /* … … 65 66 */ 66 67 RTSpinlockAcquire(pKvm->hSpinlockR0); 67 for ( uint32_t i = 0; i < pVM->cCpus; i++)68 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 68 69 { 69 PGIMKVMCPU pKvmCpu = & pVM->aCpus[i].gim.s.u.KvmCpu;70 PGIMKVMCPU pKvmCpu = &VMCC_GET_CPU(pVM, idCpu)->gim.s.u.KvmCpu; 70 71 if ( !pKvmCpu->uTsc 71 72 && !pKvmCpu->uVirtNanoTS) … … 87 88 * @param pVM The cross context VM structure. 88 89 */ 89 VMMR0_INT_DECL(int) gimR0KvmInitVM(PVM pVM)90 VMMR0_INT_DECL(int) gimR0KvmInitVM(PVMCC pVM) 90 91 { 91 92 AssertPtr(pVM); … … 106 107 * @param pVM The cross context VM structure. 107 108 */ 108 VMMR0_INT_DECL(int) gimR0KvmTermVM(PVM pVM)109 VMMR0_INT_DECL(int) gimR0KvmTermVM(PVMCC pVM) 109 110 { 110 111 AssertPtr(pVM); -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r76553 r80274 150 150 * Header Files * 151 151 *********************************************************************************************************************************/ 152 #define VBOX_BUGREF_9217_PART_I 152 153 #define LOG_GROUP LOG_GROUP_GMM 153 154 #include <VBox/rawpci.h> 154 #include <VBox/vmm/vm.h>155 155 #include <VBox/vmm/gmm.h> 156 156 #include "GMMR0Internal.h" 157 #include <VBox/vmm/ gvm.h>157 #include <VBox/vmm/vmcc.h> 158 158 #include <VBox/vmm/pgm.h> 159 159 #include <VBox/log.h> … … 1226 1226 GMMR0DECL(void) GMMR0CleanupVM(PGVM pGVM) 1227 1227 { 1228 #ifdef VBOX_BUGREF_9217 1229 LogFlow(("GMMR0CleanupVM: pGVM=%p:{.hSelf=%#x}\n", pGVM, pGVM->hSelf)); 1230 #else 1228 1231 LogFlow(("GMMR0CleanupVM: pGVM=%p:{.pVM=%p, .hSelf=%#x}\n", pGVM, pGVM->pVM, pGVM->hSelf)); 1232 #endif 1229 1233 1230 1234 PGMM pGMM; … … 1554 1558 * @thread The creator thread / EMT(0). 1555 1559 */ 1556 GMMR0DECL(int) GMMR0InitialReservation(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages,1560 GMMR0DECL(int) GMMR0InitialReservation(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, 1557 1561 uint32_t cFixedPages, GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority) 1558 1562 { … … 1624 1628 * @param pReq Pointer to the request packet. 1625 1629 */ 1626 GMMR0DECL(int) GMMR0InitialReservationReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq)1630 GMMR0DECL(int) GMMR0InitialReservationReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq) 1627 1631 { 1628 1632 /* … … 1655 1659 * @thread EMT(idCpu) 1656 1660 */ 1657 GMMR0DECL(int) GMMR0UpdateReservation(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t cBasePages,1661 GMMR0DECL(int) GMMR0UpdateReservation(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t cBasePages, 1658 1662 uint32_t cShadowPages, uint32_t cFixedPages) 1659 1663 { … … 1721 1725 * @param pReq Pointer to the request packet. 1722 1726 */ 1723 GMMR0DECL(int) GMMR0UpdateReservationReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq)1727 GMMR0DECL(int) GMMR0UpdateReservationReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq) 1724 1728 { 1725 1729 /* … … 2738 2742 * @thread EMT(idCpu) 2739 2743 */ 2740 GMMR0DECL(int) GMMR0AllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cPagesToUpdate,2744 GMMR0DECL(int) GMMR0AllocateHandyPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint32_t cPagesToUpdate, 2741 2745 uint32_t cPagesToAlloc, PGMMPAGEDESC paPages) 2742 2746 { … … 2936 2940 * @thread EMT. 2937 2941 */ 2938 GMMR0DECL(int) GMMR0AllocatePages(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount)2942 GMMR0DECL(int) GMMR0AllocatePages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount) 2939 2943 { 2940 2944 LogFlow(("GMMR0AllocatePages: pGVM=%p pVM=%p cPages=%#x paPages=%p enmAccount=%d\n", pGVM, pVM, cPages, paPages, enmAccount)); … … 2996 3000 * @param pReq Pointer to the request packet. 2997 3001 */ 2998 GMMR0DECL(int) GMMR0AllocatePagesReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq)3002 GMMR0DECL(int) GMMR0AllocatePagesReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq) 2999 3003 { 3000 3004 /* … … 3034 3038 * @param pHCPhys Where to return the host physical address of the page. 3035 3039 */ 3036 GMMR0DECL(int) GMMR0AllocateLargePage(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys)3040 GMMR0DECL(int) GMMR0AllocateLargePage(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys) 3037 3041 { 3038 3042 LogFlow(("GMMR0AllocateLargePage: pGVM=%p pVM=%p cbPage=%x\n", pGVM, pVM, cbPage)); … … 3139 3143 * @param idPage The large page id. 3140 3144 */ 3141 GMMR0DECL(int) GMMR0FreeLargePage(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t idPage)3145 GMMR0DECL(int) GMMR0FreeLargePage(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint32_t idPage) 3142 3146 { 3143 3147 LogFlow(("GMMR0FreeLargePage: pGVM=%p pVM=%p idPage=%x\n", pGVM, pVM, idPage)); … … 3206 3210 * @param pReq Pointer to the request packet. 3207 3211 */ 3208 GMMR0DECL(int) GMMR0FreeLargePageReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMFREELARGEPAGEREQ pReq)3212 GMMR0DECL(int) GMMR0FreeLargePageReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMFREELARGEPAGEREQ pReq) 3209 3213 { 3210 3214 /* … … 3571 3575 * @thread EMT. 3572 3576 */ 3573 GMMR0DECL(int) GMMR0FreePages(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount)3577 GMMR0DECL(int) GMMR0FreePages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount) 3574 3578 { 3575 3579 LogFlow(("GMMR0FreePages: pGVM=%p pVM=%p cPages=%#x paPages=%p enmAccount=%d\n", pGVM, pVM, cPages, paPages, enmAccount)); … … 3619 3623 * @param pReq Pointer to the request packet. 3620 3624 */ 3621 GMMR0DECL(int) GMMR0FreePagesReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq)3625 GMMR0DECL(int) GMMR0FreePagesReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq) 3622 3626 { 3623 3627 /* … … 3660 3664 * @thread EMT(idCpu) 3661 3665 */ 3662 GMMR0DECL(int) GMMR0BalloonedPages(PGVM pGVM, PVM pVM, VMCPUID idCpu, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages)3666 GMMR0DECL(int) GMMR0BalloonedPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages) 3663 3667 { 3664 3668 LogFlow(("GMMR0BalloonedPages: pGVM=%p pVM=%p enmAction=%d cBalloonedPages=%#x\n", … … 3789 3793 * @param pReq Pointer to the request packet. 3790 3794 */ 3791 GMMR0DECL(int) GMMR0BalloonedPagesReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq)3795 GMMR0DECL(int) GMMR0BalloonedPagesReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq) 3792 3796 { 3793 3797 /* … … 3846 3850 * @thread EMT(idCpu) 3847 3851 */ 3848 GMMR0DECL(int) GMMR0QueryMemoryStatsReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq)3852 GMMR0DECL(int) GMMR0QueryMemoryStatsReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq) 3849 3853 { 3850 3854 /* … … 4138 4142 * @thread EMT ??? 4139 4143 */ 4140 GMMR0DECL(int) GMMR0MapUnmapChunk(PGVM pGVM, PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3)4144 GMMR0DECL(int) GMMR0MapUnmapChunk(PGVM pGVM, PVMCC pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3) 4141 4145 { 4142 4146 LogFlow(("GMMR0MapUnmapChunk: pGVM=%p pVM=%p idChunkMap=%#x idChunkUnmap=%#x ppvR3=%p\n", … … 4227 4231 * @param pReq Pointer to the request packet. 4228 4232 */ 4229 GMMR0DECL(int) GMMR0MapUnmapChunkReq(PGVM pGVM, PVM pVM, PGMMMAPUNMAPCHUNKREQ pReq)4233 GMMR0DECL(int) GMMR0MapUnmapChunkReq(PGVM pGVM, PVMCC pVM, PGMMMAPUNMAPCHUNKREQ pReq) 4230 4234 { 4231 4235 /* … … 4251 4255 * @param pvR3 Pointer to the chunk size memory block to lock down. 4252 4256 */ 4253 GMMR0DECL(int) GMMR0SeedChunk(PGVM pGVM, PVM pVM, VMCPUID idCpu, RTR3PTR pvR3)4257 GMMR0DECL(int) GMMR0SeedChunk(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, RTR3PTR pvR3) 4254 4258 { 4255 4259 /* … … 4542 4546 * @thread EMT(idCpu) 4543 4547 */ 4544 GMMR0DECL(int) GMMR0RegisterSharedModule(PGVM pGVM, PVM pVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName,4548 GMMR0DECL(int) GMMR0RegisterSharedModule(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName, 4545 4549 char *pszVersion, RTGCPTR GCPtrModBase, uint32_t cbModule, 4546 4550 uint32_t cRegions, struct VMMDEVSHAREDREGIONDESC const *paRegions) … … 4683 4687 * @param pReq Pointer to the request packet. 4684 4688 */ 4685 GMMR0DECL(int) GMMR0RegisterSharedModuleReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMREGISTERSHAREDMODULEREQ pReq)4689 GMMR0DECL(int) GMMR0RegisterSharedModuleReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMREGISTERSHAREDMODULEREQ pReq) 4686 4690 { 4687 4691 /* … … 4712 4716 * @param cbModule The module size. 4713 4717 */ 4714 GMMR0DECL(int) GMMR0UnregisterSharedModule(PGVM pGVM, PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion,4718 GMMR0DECL(int) GMMR0UnregisterSharedModule(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, 4715 4719 RTGCPTR GCPtrModBase, uint32_t cbModule) 4716 4720 { … … 4779 4783 * @param pReq Pointer to the request packet. 4780 4784 */ 4781 GMMR0DECL(int) GMMR0UnregisterSharedModuleReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGMMUNREGISTERSHAREDMODULEREQ pReq)4785 GMMR0DECL(int) GMMR0UnregisterSharedModuleReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGMMUNREGISTERSHAREDMODULEREQ pReq) 4782 4786 { 4783 4787 /* … … 5085 5089 * @param idCpu The VCPU id. 5086 5090 */ 5087 GMMR0DECL(int) GMMR0ResetSharedModules(PGVM pGVM, PVM pVM, VMCPUID idCpu)5091 GMMR0DECL(int) GMMR0ResetSharedModules(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 5088 5092 { 5089 5093 #ifdef VBOX_WITH_PAGE_SHARING … … 5138 5142 pGblMod->szName, pGblMod->szVersion, pGblMod->Core.Key, pGblMod->cbModule)); 5139 5143 5144 # ifdef VBOX_BUGREF_9217 5145 int rc = PGMR0SharedModuleCheck(pArgs->pGVM, pArgs->pGVM, pArgs->idCpu, pGblMod, pRecVM->aRegionsGCPtrs); 5146 #else 5140 5147 int rc = PGMR0SharedModuleCheck(pArgs->pGVM->pVM, pArgs->pGVM, pArgs->idCpu, pGblMod, pRecVM->aRegionsGCPtrs); 5148 # endif 5141 5149 if (RT_FAILURE(rc)) 5142 5150 return rc; … … 5155 5163 * @thread EMT(idCpu) 5156 5164 */ 5157 GMMR0DECL(int) GMMR0CheckSharedModules(PGVM pGVM, PVM pVM, VMCPUID idCpu)5165 GMMR0DECL(int) GMMR0CheckSharedModules(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 5158 5166 { 5159 5167 #ifdef VBOX_WITH_PAGE_SHARING … … 5256 5264 * @param pReq Pointer to the request packet. 5257 5265 */ 5258 GMMR0DECL(int) GMMR0FindDuplicatePageReq(PGVM pGVM, PVM pVM, PGMMFINDDUPLICATEPAGEREQ pReq)5266 GMMR0DECL(int) GMMR0FindDuplicatePageReq(PGVM pGVM, PVMCC pVM, PGMMFINDDUPLICATEPAGEREQ pReq) 5259 5267 { 5260 5268 /* … … 5328 5336 * @param pVM The VM structure corresponding to @a pGVM. 5329 5337 */ 5330 GMMR0DECL(int) GMMR0QueryStatistics(PGMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVM pVM)5338 GMMR0DECL(int) GMMR0QueryStatistics(PGMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVMCC pVM) 5331 5339 { 5332 5340 LogFlow(("GVMMR0QueryStatistics: pStats=%p pSession=%p pGVM=%p pVM=%p\n", pStats, pSession, pGVM, pVM)); … … 5394 5402 * @param pReq Pointer to the request packet. 5395 5403 */ 5396 GMMR0DECL(int) GMMR0QueryStatisticsReq(PGVM pGVM, PVM pVM, PGMMQUERYSTATISTICSSREQ pReq)5404 GMMR0DECL(int) GMMR0QueryStatisticsReq(PGVM pGVM, PVMCC pVM, PGMMQUERYSTATISTICSSREQ pReq) 5397 5405 { 5398 5406 /* … … 5417 5425 * @param pVM The VM structure corresponding to @a pGVM. 5418 5426 */ 5419 GMMR0DECL(int) GMMR0ResetStatistics(PCGMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVM pVM)5427 GMMR0DECL(int) GMMR0ResetStatistics(PCGMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVMCC pVM) 5420 5428 { 5421 5429 NOREF(pStats); NOREF(pSession); NOREF(pVM); NOREF(pGVM); … … 5433 5441 * @param pReq Pointer to the request packet. 5434 5442 */ 5435 GMMR0DECL(int) GMMR0ResetStatisticsReq(PGVM pGVM, PVM pVM, PGMMRESETSTATISTICSSREQ pReq)5443 GMMR0DECL(int) GMMR0ResetStatisticsReq(PGVM pGVM, PVMCC pVM, PGMMRESETSTATISTICSSREQ pReq) 5436 5444 { 5437 5445 /* -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r80253 r80274 54 54 #include <VBox/vmm/gmm.h> 55 55 #include "GVMMR0Internal.h" 56 #include <VBox/vmm/gvm.h> 57 #include <VBox/vmm/vm.h> 56 #include <VBox/vmm/vmcc.h> 58 57 #include <VBox/vmm/vmcpuset.h> 59 58 #include <VBox/vmm/vmm.h> … … 161 160 PGVM pGVM; 162 161 /** The ring-0 mapping of the shared VM instance data. */ 163 PVM pVM;162 PVMCC pVM; 164 163 /** The virtual machine object. */ 165 164 void *pvObj; … … 366 365 #endif 367 366 static DECLCALLBACK(void) gvmmR0HandleObjDestructor(void *pvObj, void *pvGVMM, void *pvHandle); 368 static int gvmmR0ByGVMandVM(PGVM pGVM, PVM pVM, PGVMM *ppGVMM, bool fTakeUsedLock);369 static int gvmmR0ByGVMandVMandEMT(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGVMM *ppGVMM);367 static int gvmmR0ByGVMandVM(PGVM pGVM, PVMCC pVM, PGVMM *ppGVMM, bool fTakeUsedLock); 368 static int gvmmR0ByGVMandVMandEMT(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGVMM *ppGVMM); 370 369 371 370 #ifdef GVMM_SCHED_WITH_PPT … … 794 793 * Execute it. 795 794 */ 796 PVM pVM;795 PVMCC pVM; 797 796 pReq->pVMR0 = NULL; 798 797 pReq->pVMR3 = NIL_RTR3PTR; … … 819 818 * @thread EMT. 820 819 */ 821 GVMMR0DECL(int) GVMMR0CreateVM(PSUPDRVSESSION pSession, uint32_t cCpus, PVM *ppVM)820 GVMMR0DECL(int) GVMMR0CreateVM(PSUPDRVSESSION pSession, uint32_t cCpus, PVMCC *ppVM) 822 821 { 823 822 LogFlow(("GVMMR0CreateVM: pSession=%p\n", pSession)); … … 959 958 pGVM->aCpus[i].pVMR3 = pVMR3; 960 959 pGVM->apCpusR3[i] = RTR0MemObjAddressR3(pGVM->aCpus[i].gvmm.s.VMCpuMapObj); 960 pGVM->aCpus[i].pVCpuR3 = pGVM->apCpusR3[i]; 961 961 pGVM->apCpusR0[i] = &pGVM->aCpus[i]; 962 962 AssertPtr((void *)pGVM->apCpusR3[i]); … … 1052 1052 if (RT_SUCCESS(rc)) 1053 1053 { 1054 PVM pVM = (PVM)RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj); AssertPtr(pVM);1054 PVMCC pVM = (PVMCC)RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj); AssertPtr(pVM); 1055 1055 memset(pVM, 0, cPages << PAGE_SHIFT); 1056 1056 pVM->enmVMState = VMSTATE_CREATING; … … 1219 1219 /* GVM: */ 1220 1220 pGVM->u32Magic = GVM_MAGIC; 1221 pGVM->hSelf Safe= hSelf;1222 pGVM->cCpus Safe= cCpus;1223 pGVM->pSession Safe= pSession;1221 pGVM->hSelf = hSelf; 1222 pGVM->cCpus = cCpus; 1223 pGVM->pSession = pSession; 1224 1224 1225 1225 /* VM: */ 1226 1226 pGVM->enmVMState = VMSTATE_CREATING; 1227 pGVM->pVMR0 = pGVM; 1228 pGVM->pSession = pSession; 1229 pGVM->hSelf = hSelf; 1230 pGVM->cCpus = cCpus; 1227 pGVM->pSessionUnsafe = pSession; 1228 pGVM->hSelfUnsafe = hSelf; 1229 pGVM->cCpusUnsafe = cCpus; 1231 1230 pGVM->uCpuExecutionCap = 100; /* default is no cap. */ 1232 1231 pGVM->uStructVersion = 1; … … 1250 1249 pGVM->aCpus[i].idCpu = i; 1251 1250 #ifdef VBOX_BUGREF_9217 1252 pGVM->aCpus[i].idCpu Safe= i;1251 pGVM->aCpus[i].idCpuUnsafe = i; 1253 1252 #endif 1254 1253 pGVM->aCpus[i].gvmm.s.HaltEventMulti = NIL_RTSEMEVENTMULTI; … … 1353 1352 * @thread EMT(0) if it's associated with the VM, otherwise any thread. 1354 1353 */ 1355 GVMMR0DECL(int) GVMMR0DestroyVM(PGVM pGVM, PVM pVM)1354 GVMMR0DECL(int) GVMMR0DestroyVM(PGVM pGVM, PVMCC pVM) 1356 1355 { 1357 1356 LogFlow(("GVMMR0DestroyVM: pGVM=%p pVM=%p\n", pGVM, pVM)); … … 1475 1474 1476 1475 AssertCompile(NIL_RTTHREADCTXHOOK == (RTTHREADCTXHOOK)0); /* Depends on zero initialized memory working for NIL at the moment. */ 1477 #ifdef VBOX_BUGREF_92171478 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpusSafe; idCpu++)1479 #else1480 1476 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) 1481 #endif1482 1477 { 1483 1478 /** @todo Can we busy wait here for all thread-context hooks to be … … 1683 1678 * @param idCpu VCPU id to register the current thread as. 1684 1679 */ 1685 GVMMR0DECL(int) GVMMR0RegisterVCpu(PGVM pGVM, PVM pVM, VMCPUID idCpu)1680 GVMMR0DECL(int) GVMMR0RegisterVCpu(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 1686 1681 { 1687 1682 AssertReturn(idCpu != 0, VERR_INVALID_FUNCTION); … … 1753 1748 * @param idCpu VCPU id to register the current thread as. 1754 1749 */ 1755 GVMMR0DECL(int) GVMMR0DeregisterVCpu(PGVM pGVM, PVM pVM, VMCPUID idCpu)1750 GVMMR0DECL(int) GVMMR0DeregisterVCpu(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 1756 1751 { 1757 1752 AssertReturn(idCpu != 0, VERR_INVALID_FUNCTION); … … 1856 1851 * @remark This will not assert on an invalid pVM but try return silently. 1857 1852 */ 1858 static int gvmmR0ByVM(PVM pVM, PGVM *ppGVM, PGVMM *ppGVMM, bool fTakeUsedLock)1853 static int gvmmR0ByVM(PVMCC pVM, PGVM *ppGVM, PGVMM *ppGVMM, bool fTakeUsedLock) 1859 1854 { 1860 1855 RTPROCESS ProcId = RTProcSelf(); … … 1945 1940 * @note Do not use this on pVM structures from userland! 1946 1941 */ 1947 GVMMR0DECL(PGVM) GVMMR0FastGetGVMByVM(PVM pVM)1942 GVMMR0DECL(PGVM) GVMMR0FastGetGVMByVM(PVMCC pVM) 1948 1943 { 1949 1944 AssertPtr(pVM); … … 1996 1991 * @remark This will not assert on an invalid pVM but try return silently. 1997 1992 */ 1998 static int gvmmR0ByGVMandVM(PGVM pGVM, PVM pVM, PGVMM *ppGVMM, bool fTakeUsedLock)1993 static int gvmmR0ByGVMandVM(PGVM pGVM, PVMCC pVM, PGVMM *ppGVMM, bool fTakeUsedLock) 1999 1994 { 2000 1995 /* … … 2039 2034 * Some more VM data consistency checks. 2040 2035 */ 2036 #ifdef VBOX_BUGREF_9217 2041 2037 if (RT_LIKELY( pVM->cCpus == pGVM->cCpus 2042 2038 && pVM->hSelf == hGVM 2043 2039 && pVM->enmVMState >= VMSTATE_CREATING 2044 2040 && pVM->enmVMState <= VMSTATE_TERMINATED 2045 && pVM->pVMR0 == pVM)) 2041 && pVM->pSelf == pVM 2042 )) 2043 #else 2044 if (RT_LIKELY( pVM->cCpus == pGVM->cCpus 2045 && pVM->hSelf == hGVM 2046 && pVM->enmVMState >= VMSTATE_CREATING 2047 && pVM->enmVMState <= VMSTATE_TERMINATED 2048 && pVM->pVMR0 == pVM 2049 )) 2050 #endif 2046 2051 { 2047 2052 *ppGVMM = pGVMM; … … 2080 2085 * @remarks This will assert in all failure paths. 2081 2086 */ 2082 static int gvmmR0ByGVMandVMandEMT(PGVM pGVM, PVM pVM, VMCPUID idCpu, PGVMM *ppGVMM)2087 static int gvmmR0ByGVMandVMandEMT(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, PGVMM *ppGVMM) 2083 2088 { 2084 2089 /* … … 2127 2132 AssertReturn(pVM->cCpus == pGVM->cCpus, VERR_INCONSISTENT_VM_HANDLE); 2128 2133 AssertReturn(pVM->hSelf == hGVM, VERR_INCONSISTENT_VM_HANDLE); 2134 #ifndef VBOX_BUGREF_9217 2129 2135 AssertReturn(pVM->pVMR0 == pVM, VERR_INCONSISTENT_VM_HANDLE); 2136 #endif 2130 2137 AssertReturn( pVM->enmVMState >= VMSTATE_CREATING 2131 2138 && pVM->enmVMState <= VMSTATE_TERMINATED, VERR_INCONSISTENT_VM_HANDLE); … … 2143 2150 * @param pVM The cross context VM structure. 2144 2151 */ 2145 GVMMR0DECL(int) GVMMR0ValidateGVMandVM(PGVM pGVM, PVM pVM)2152 GVMMR0DECL(int) GVMMR0ValidateGVMandVM(PGVM pGVM, PVMCC pVM) 2146 2153 { 2147 2154 PGVMM pGVMM; … … 2160 2167 * @thread EMT(idCpu) 2161 2168 */ 2162 GVMMR0DECL(int) GVMMR0ValidateGVMandVMandEMT(PGVM pGVM, PVM pVM, VMCPUID idCpu)2169 GVMMR0DECL(int) GVMMR0ValidateGVMandVMandEMT(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 2163 2170 { 2164 2171 PGVMM pGVMM; … … 2178 2185 * NIL_RTNATIVETHREAD means the current thread 2179 2186 */ 2180 GVMMR0DECL(PVM ) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT)2187 GVMMR0DECL(PVMCC) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT) 2181 2188 { 2182 2189 /* … … 2445 2452 * @thread EMT(pGVCpu). 2446 2453 */ 2447 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, uint64_t u64ExpireGipTime)2454 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVMCC pVM, PGVMCPU pGVCpu, uint64_t u64ExpireGipTime) 2448 2455 { 2449 2456 LogFlow(("GVMMR0SchedHalt: pGVM=%p pVM=%p pGVCpu=%p(%d) u64ExpireGipTime=%#RX64\n", … … 2556 2563 * @thread EMT(idCpu). 2557 2564 */ 2558 GVMMR0DECL(int) GVMMR0SchedHaltReq(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime)2565 GVMMR0DECL(int) GVMMR0SchedHaltReq(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime) 2559 2566 { 2560 2567 GVMM_CHECK_SMAP_SETUP(); … … 2628 2635 * @thread Any but EMT(idCpu). 2629 2636 */ 2630 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock)2637 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, bool fTakeUsedLock) 2631 2638 { 2632 2639 GVMM_CHECK_SMAP_SETUP(); … … 2688 2695 * @thread Any but EMT(idCpu). 2689 2696 */ 2690 GVMMR0DECL(int) GVMMR0SchedWakeUp(PGVM pGVM, PVM pVM, VMCPUID idCpu)2697 GVMMR0DECL(int) GVMMR0SchedWakeUp(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 2691 2698 { 2692 2699 return GVMMR0SchedWakeUpEx(pGVM, pVM, idCpu, true /* fTakeUsedLock */); … … 2707 2714 * @deprecated Don't use in new code if possible! Use the GVM variant. 2708 2715 */ 2709 GVMMR0DECL(int) GVMMR0SchedWakeUpNoGVMNoLock(PVM pVM, VMCPUID idCpu)2716 GVMMR0DECL(int) GVMMR0SchedWakeUpNoGVMNoLock(PVMCC pVM, VMCPUID idCpu) 2710 2717 { 2711 2718 GVMM_CHECK_SMAP_SETUP(); … … 2732 2739 * @param pVCpu The cross context virtual CPU structure. 2733 2740 */ 2734 DECLINLINE(int) gvmmR0SchedPokeOne(PGVM pGVM, PVMCPU pVCpu)2741 DECLINLINE(int) gvmmR0SchedPokeOne(PGVM pGVM, PVMCPUCC pVCpu) 2735 2742 { 2736 2743 pGVM->gvmm.s.StatsSched.cPokeCalls++; … … 2762 2769 * @param fTakeUsedLock Take the used lock or not 2763 2770 */ 2764 GVMMR0DECL(int) GVMMR0SchedPokeEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock)2771 GVMMR0DECL(int) GVMMR0SchedPokeEx(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, bool fTakeUsedLock) 2765 2772 { 2766 2773 /* … … 2803 2810 * @param idCpu The ID of the virtual CPU to poke. 2804 2811 */ 2805 GVMMR0DECL(int) GVMMR0SchedPoke(PGVM pGVM, PVM pVM, VMCPUID idCpu)2812 GVMMR0DECL(int) GVMMR0SchedPoke(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 2806 2813 { 2807 2814 return GVMMR0SchedPokeEx(pGVM, pVM, idCpu, true /* fTakeUsedLock */); … … 2822 2829 * @deprecated Don't use in new code if possible! Use the GVM variant. 2823 2830 */ 2824 GVMMR0DECL(int) GVMMR0SchedPokeNoGVMNoLock(PVM pVM, VMCPUID idCpu)2831 GVMMR0DECL(int) GVMMR0SchedPokeNoGVMNoLock(PVMCC pVM, VMCPUID idCpu) 2825 2832 { 2826 2833 PGVM pGVM; … … 2852 2859 * @param pPokeSet The set of CPUs to poke. 2853 2860 */ 2854 GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpus(PGVM pGVM, PVM pVM, PCVMCPUSET pSleepSet, PCVMCPUSET pPokeSet)2861 GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpus(PGVM pGVM, PVMCC pVM, PCVMCPUSET pSleepSet, PCVMCPUSET pPokeSet) 2855 2862 { 2856 2863 AssertPtrReturn(pSleepSet, VERR_INVALID_POINTER); … … 2911 2918 * @param pReq Pointer to the request packet. 2912 2919 */ 2913 GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpusReq(PGVM pGVM, PVM pVM, PGVMMSCHEDWAKEUPANDPOKECPUSREQ pReq)2920 GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpusReq(PGVM pGVM, PVMCC pVM, PGVMMSCHEDWAKEUPANDPOKECPUSREQ pReq) 2914 2921 { 2915 2922 /* … … 2939 2946 * @thread EMT(idCpu). 2940 2947 */ 2941 GVMMR0DECL(int) GVMMR0SchedPoll(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fYield)2948 GVMMR0DECL(int) GVMMR0SchedPoll(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, bool fYield) 2942 2949 { 2943 2950 /* … … 3072 3079 * @param uHz The desired frequency. 3073 3080 */ 3074 GVMMR0DECL(void) GVMMR0SchedUpdatePeriodicPreemptionTimer(PVM pVM, RTCPUID idHostCpu, uint32_t uHz)3081 GVMMR0DECL(void) GVMMR0SchedUpdatePeriodicPreemptionTimer(PVMCC pVM, RTCPUID idHostCpu, uint32_t uHz) 3075 3082 { 3076 3083 NOREF(pVM); … … 3155 3162 * @param pVM The VM structure corresponding to @a pGVM. 3156 3163 */ 3157 GVMMR0DECL(int) GVMMR0QueryStatistics(PGVMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVM pVM)3164 GVMMR0DECL(int) GVMMR0QueryStatistics(PGVMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVMCC pVM) 3158 3165 { 3159 3166 LogFlow(("GVMMR0QueryStatistics: pStats=%p pSession=%p pGVM=%p pVM=%p\n", pStats, pSession, pGVM, pVM)); … … 3270 3277 * @param pSession The current session. 3271 3278 */ 3272 GVMMR0DECL(int) GVMMR0QueryStatisticsReq(PGVM pGVM, PVM pVM, PGVMMQUERYSTATISTICSSREQ pReq, PSUPDRVSESSION pSession)3279 GVMMR0DECL(int) GVMMR0QueryStatisticsReq(PGVM pGVM, PVMCC pVM, PGVMMQUERYSTATISTICSSREQ pReq, PSUPDRVSESSION pSession) 3273 3280 { 3274 3281 /* … … 3293 3300 * @param pVM The VM structure corresponding to @a pGVM. 3294 3301 */ 3295 GVMMR0DECL(int) GVMMR0ResetStatistics(PCGVMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVM pVM)3302 GVMMR0DECL(int) GVMMR0ResetStatistics(PCGVMMSTATS pStats, PSUPDRVSESSION pSession, PGVM pGVM, PVMCC pVM) 3296 3303 { 3297 3304 LogFlow(("GVMMR0ResetStatistics: pStats=%p pSession=%p pGVM=%p pVM=%p\n", pStats, pSession, pGVM, pVM)); … … 3388 3395 * @param pSession The current session. 3389 3396 */ 3390 GVMMR0DECL(int) GVMMR0ResetStatisticsReq(PGVM pGVM, PVM pVM, PGVMMRESETSTATISTICSSREQ pReq, PSUPDRVSESSION pSession)3397 GVMMR0DECL(int) GVMMR0ResetStatisticsReq(PGVM pGVM, PVMCC pVM, PGVMMRESETSTATISTICSSREQ pReq, PSUPDRVSESSION pSession) 3391 3398 { 3392 3399 /* -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r80266 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_HM 23 24 #define VMCPU_INCL_CPUM_GST_CTX … … 25 26 #include <VBox/vmm/pgm.h> 26 27 #include "HMInternal.h" 27 #include <VBox/vmm/vm .h>28 #include <VBox/vmm/vmcc.h> 28 29 #include <VBox/vmm/hm_svm.h> 29 30 #include <VBox/vmm/hmvmxinline.h> … … 87 88 /** @name Ring-0 method table for AMD-V and VT-x specific operations. 88 89 * @{ */ 89 DECLR0CALLBACKMEMBER(int, pfnEnterSession, (PVMCPU pVCpu));90 DECLR0CALLBACKMEMBER(void, pfnThreadCtxCallback, (RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit));91 DECLR0CALLBACKMEMBER(int, pfnExportHostState, (PVMCPU pVCpu));92 DECLR0CALLBACKMEMBER(VBOXSTRICTRC, pfnRunGuestCode, (PVMCPU pVCpu));93 DECLR0CALLBACKMEMBER(int, pfnEnableCpu, (PHMPHYSCPU pHostCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage,90 DECLR0CALLBACKMEMBER(int, pfnEnterSession, (PVMCPUCC pVCpu)); 91 DECLR0CALLBACKMEMBER(void, pfnThreadCtxCallback, (RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit)); 92 DECLR0CALLBACKMEMBER(int, pfnExportHostState, (PVMCPUCC pVCpu)); 93 DECLR0CALLBACKMEMBER(VBOXSTRICTRC, pfnRunGuestCode, (PVMCPUCC pVCpu)); 94 DECLR0CALLBACKMEMBER(int, pfnEnableCpu, (PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, 94 95 bool fEnabledByHost, PCSUPHWVIRTMSRS pHwvirtMsrs)); 95 96 DECLR0CALLBACKMEMBER(int, pfnDisableCpu, (void *pvCpuPage, RTHCPHYS HCPhysCpuPage)); 96 DECLR0CALLBACKMEMBER(int, pfnInitVM, (PVM pVM));97 DECLR0CALLBACKMEMBER(int, pfnTermVM, (PVM pVM));98 DECLR0CALLBACKMEMBER(int, pfnSetupVM, (PVM pVM));97 DECLR0CALLBACKMEMBER(int, pfnInitVM, (PVMCC pVM)); 98 DECLR0CALLBACKMEMBER(int, pfnTermVM, (PVMCC pVM)); 99 DECLR0CALLBACKMEMBER(int, pfnSetupVM, (PVMCC pVM)); 99 100 /** @} */ 100 101 … … 227 228 * @{ */ 228 229 229 static DECLCALLBACK(int) hmR0DummyEnter(PVMCPU pVCpu)230 static DECLCALLBACK(int) hmR0DummyEnter(PVMCPUCC pVCpu) 230 231 { 231 232 RT_NOREF1(pVCpu); … … 233 234 } 234 235 235 static DECLCALLBACK(void) hmR0DummyThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit)236 static DECLCALLBACK(void) hmR0DummyThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit) 236 237 { 237 238 RT_NOREF3(enmEvent, pVCpu, fGlobalInit); 238 239 } 239 240 240 static DECLCALLBACK(int) hmR0DummyEnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage,241 static DECLCALLBACK(int) hmR0DummyEnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, 241 242 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs) 242 243 { … … 251 252 } 252 253 253 static DECLCALLBACK(int) hmR0DummyInitVM(PVM pVM)254 static DECLCALLBACK(int) hmR0DummyInitVM(PVMCC pVM) 254 255 { 255 256 RT_NOREF1(pVM); … … 257 258 } 258 259 259 static DECLCALLBACK(int) hmR0DummyTermVM(PVM pVM)260 static DECLCALLBACK(int) hmR0DummyTermVM(PVMCC pVM) 260 261 { 261 262 RT_NOREF1(pVM); … … 263 264 } 264 265 265 static DECLCALLBACK(int) hmR0DummySetupVM(PVM pVM)266 static DECLCALLBACK(int) hmR0DummySetupVM(PVMCC pVM) 266 267 { 267 268 RT_NOREF1(pVM); … … 269 270 } 270 271 271 static DECLCALLBACK(VBOXSTRICTRC) hmR0DummyRunGuestCode(PVMCPU pVCpu)272 static DECLCALLBACK(VBOXSTRICTRC) hmR0DummyRunGuestCode(PVMCPUCC pVCpu) 272 273 { 273 274 RT_NOREF(pVCpu); … … 275 276 } 276 277 277 static DECLCALLBACK(int) hmR0DummyExportHostState(PVMCPU pVCpu)278 static DECLCALLBACK(int) hmR0DummyExportHostState(PVMCPUCC pVCpu) 278 279 { 279 280 RT_NOREF1(pVCpu); … … 788 789 * @remarks Maybe called with interrupts disabled! 789 790 */ 790 static int hmR0EnableCpu(PVM pVM, RTCPUID idCpu)791 static int hmR0EnableCpu(PVMCC pVM, RTCPUID idCpu) 791 792 { 792 793 PHMPHYSCPU pHostCpu = &g_HmR0.aCpuInfo[idCpu]; … … 824 825 static DECLCALLBACK(void) hmR0EnableCpuCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2) 825 826 { 826 PVM pVM = (PVM)pvUser1; /* can be NULL! */827 PVMCC pVM = (PVMCC)pvUser1; /* can be NULL! */ 827 828 PHMR0FIRSTRC pFirstRc = (PHMR0FIRSTRC)pvUser2; 828 829 AssertReturnVoid(g_HmR0.fGlobalInit); … … 840 841 static DECLCALLBACK(int32_t) hmR0EnableAllCpuOnce(void *pvUser) 841 842 { 842 PVM pVM = (PVM)pvUser;843 PVMCC pVM = (PVMCC)pvUser; 843 844 844 845 /* … … 956 957 * @param pVM The cross context VM structure. 957 958 */ 958 VMMR0_INT_DECL(int) HMR0EnableAllCpus(PVM pVM)959 VMMR0_INT_DECL(int) HMR0EnableAllCpus(PVMCC pVM) 959 960 { 960 961 /* Make sure we don't touch HM after we've disabled HM in preparation of a suspend. */ … … 1042 1043 * @param enmEvent The Mp event. 1043 1044 * @param idCpu The identifier for the CPU the function is called on. 1044 * @param pvData Opaque data (PVM pointer).1045 * @param pvData Opaque data (PVMCC pointer). 1045 1046 */ 1046 1047 static DECLCALLBACK(void) hmR0MpEventCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData) … … 1158 1159 * vmR3InitRing3(). 1159 1160 */ 1160 VMMR0_INT_DECL(int) HMR0InitVM(PVM pVM)1161 VMMR0_INT_DECL(int) HMR0InitVM(PVMCC pVM) 1161 1162 { 1162 1163 AssertReturn(pVM, VERR_INVALID_PARAMETER); … … 1235 1236 * Initialize some per-VCPU fields. 1236 1237 */ 1237 for (VMCPUID i = 0; i < pVM->cCpus; i++)1238 { 1239 PVMCPU pVCpu = &pVM->aCpus[i];1238 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 1239 { 1240 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1240 1241 pVCpu->hm.s.idEnteredCpu = NIL_RTCPUID; 1241 1242 pVCpu->hm.s.idLastCpu = NIL_RTCPUID; … … 1267 1268 * @param pVM The cross context VM structure. 1268 1269 */ 1269 VMMR0_INT_DECL(int) HMR0TermVM(PVM pVM)1270 VMMR0_INT_DECL(int) HMR0TermVM(PVMCC pVM) 1270 1271 { 1271 1272 Log(("HMR0TermVM: %p\n", pVM)); … … 1290 1291 * @param pVM The cross context VM structure. 1291 1292 */ 1292 VMMR0_INT_DECL(int) HMR0SetupVM(PVM pVM)1293 VMMR0_INT_DECL(int) HMR0SetupVM(PVMCC pVM) 1293 1294 { 1294 1295 Log(("HMR0SetupVM: %p\n", pVM)); … … 1299 1300 1300 1301 /* On first entry we'll sync everything. */ 1301 for (VMCPUID i = 0; i < pVM->cCpus; i++) 1302 { 1303 PVMCPU pVCpu = &pVM->aCpus[i]; 1304 pVCpu->hm.s.fCtxChanged |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST; 1305 } 1302 VMCC_FOR_EACH_VMCPU_STMT(pVM, pVCpu->hm.s.fCtxChanged |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST); 1306 1303 1307 1304 /* … … 1351 1348 * @remarks No-long-jump zone!!! 1352 1349 */ 1353 VMMR0_INT_DECL(int) hmR0EnterCpu(PVMCPU pVCpu)1350 VMMR0_INT_DECL(int) hmR0EnterCpu(PVMCPUCC pVCpu) 1354 1351 { 1355 1352 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1384 1381 * @remarks This is called with preemption disabled. 1385 1382 */ 1386 VMMR0_INT_DECL(int) HMR0Enter(PVMCPU pVCpu)1383 VMMR0_INT_DECL(int) HMR0Enter(PVMCPUCC pVCpu) 1387 1384 { 1388 1385 /* Make sure we can't enter a session after we've disabled HM in preparation of a suspend. */ … … 1437 1434 * @remarks No-long-jump zone!!! 1438 1435 */ 1439 VMMR0_INT_DECL(int) HMR0LeaveCpu(PVMCPU pVCpu)1436 VMMR0_INT_DECL(int) HMR0LeaveCpu(PVMCPUCC pVCpu) 1440 1437 { 1441 1438 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1472 1469 VMMR0_INT_DECL(void) HMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, void *pvUser) 1473 1470 { 1474 PVMCPU pVCpu = (PVMCPU)pvUser;1471 PVMCPUCC pVCpu = (PVMCPUCC)pvUser; 1475 1472 Assert(pVCpu); 1476 1473 Assert(g_HmR0.pfnThreadCtxCallback); … … 1491 1488 * used!!! 1492 1489 */ 1493 VMMR0_INT_DECL(int) HMR0RunGuestCode(PVM pVM, PVMCPUpVCpu)1490 VMMR0_INT_DECL(int) HMR0RunGuestCode(PVMCC pVM, PVMCPUCC pVCpu) 1494 1491 { 1495 1492 RT_NOREF(pVM); … … 1527 1524 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1528 1525 */ 1529 VMMR0_INT_DECL(void) HMR0NotifyCpumUnloadedGuestFpuState(PVMCPU pVCpu)1526 VMMR0_INT_DECL(void) HMR0NotifyCpumUnloadedGuestFpuState(PVMCPUCC pVCpu) 1530 1527 { 1531 1528 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_CR0); … … 1538 1535 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 1539 1536 */ 1540 VMMR0_INT_DECL(void) HMR0NotifyCpumModifiedHostCr0(PVMCPU pVCpu)1537 VMMR0_INT_DECL(void) HMR0NotifyCpumModifiedHostCr0(PVMCPUCC pVCpu) 1541 1538 { 1542 1539 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_HOST_CONTEXT); … … 1561 1558 * @param GCVirt Page to invalidate. 1562 1559 */ 1563 VMMR0_INT_DECL(int) HMR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt)1564 { 1565 PVM pVM = pVCpu->CTX_SUFF(pVM);1560 VMMR0_INT_DECL(int) HMR0InvalidatePage(PVMCPUCC pVCpu, RTGCPTR GCVirt) 1561 { 1562 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1566 1563 if (pVM->hm.s.vmx.fSupported) 1567 1564 return VMXR0InvalidatePage(pVCpu, GCVirt); … … 1592 1589 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 1593 1590 */ 1594 VMMR0_INT_DECL(int) HMR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat)1591 VMMR0_INT_DECL(int) HMR0ImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat) 1595 1592 { 1596 1593 if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fSupported) … … 1730 1727 * @param fFlags The dumping flags (HM_DUMP_REG_FLAGS_XXX). 1731 1728 */ 1732 VMMR0_INT_DECL(void) hmR0DumpRegs(PVMCPU pVCpu, uint32_t fFlags)1729 VMMR0_INT_DECL(void) hmR0DumpRegs(PVMCPUCC pVCpu, uint32_t fFlags) 1733 1730 { 1734 1731 /* -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r80268 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_HM 23 24 #define VMCPU_INCL_CPUM_GST_CTX … … 34 35 #include <VBox/vmm/apic.h> 35 36 #include "HMInternal.h" 36 #include <VBox/vmm/vm .h>37 #include <VBox/vmm/vmcc.h> 37 38 #include <VBox/err.h> 38 39 #include "HMSVMR0.h" … … 354 355 * @param pSvmTransient Pointer to the SVM-transient structure. 355 356 */ 356 typedef int FNSVMEXITHANDLER(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient);357 typedef int FNSVMEXITHANDLER(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient); 357 358 358 359 … … 360 361 * Internal Functions * 361 362 *********************************************************************************************************************************/ 362 static void hmR0SvmPendingEventToTrpmTrap(PVMCPU pVCpu);363 static void hmR0SvmLeave(PVMCPU pVCpu, bool fImportState);363 static void hmR0SvmPendingEventToTrpmTrap(PVMCPUCC pVCpu); 364 static void hmR0SvmLeave(PVMCPUCC pVCpu, bool fImportState); 364 365 365 366 … … 416 417 /** @} */ 417 418 418 static int hmR0SvmHandleExit(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient);419 static int hmR0SvmHandleExit(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient); 419 420 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 420 static int hmR0SvmHandleExitNested(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient);421 static int hmR0SvmHandleExitNested(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient); 421 422 #endif 422 423 … … 457 458 * @param uVerbose The verbosity level, currently unused. 458 459 */ 459 static void hmR0SvmLogState(PVMCPU pVCpu, PCSVMVMCB pVmcb, const char *pszPrefix, uint32_t fFlags, uint8_t uVerbose)460 static void hmR0SvmLogState(PVMCPUCC pVCpu, PCSVMVMCB pVmcb, const char *pszPrefix, uint32_t fFlags, uint8_t uVerbose) 460 461 { 461 462 RT_NOREF2(pVCpu, uVerbose); … … 526 527 * unused). 527 528 */ 528 VMMR0DECL(int) SVMR0EnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, bool fEnabledByHost,529 VMMR0DECL(int) SVMR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, bool fEnabledByHost, 529 530 PCSUPHWVIRTMSRS pHwvirtMsrs) 530 531 { … … 661 662 * @param pVM The cross context VM structure. 662 663 */ 663 DECLINLINE(void) hmR0SvmFreeStructs(PVM pVM)664 { 665 for ( uint32_t i = 0; i < pVM->cCpus; i++)666 { 667 PVMCPU pVCpu = &pVM->aCpus[i];664 DECLINLINE(void) hmR0SvmFreeStructs(PVMCC pVM) 665 { 666 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 667 { 668 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 668 669 AssertPtr(pVCpu); 669 670 … … 700 701 * @param pVM The cross context VM structure. 701 702 */ 702 VMMR0DECL(int) SVMR0InitVM(PVM pVM)703 VMMR0DECL(int) SVMR0InitVM(PVMCC pVM) 703 704 { 704 705 int rc = VERR_INTERNAL_ERROR_5; … … 719 720 * Initialize the R0 memory objects up-front so we can properly cleanup on allocation failures. 720 721 */ 721 for (VMCPUID i = 0; i < pVM->cCpus; i++)722 { 723 PVMCPU pVCpu = &pVM->aCpus[i];722 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 723 { 724 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 724 725 pVCpu->hm.s.svm.hMemObjVmcbHost = NIL_RTR0MEMOBJ; 725 726 pVCpu->hm.s.svm.hMemObjVmcb = NIL_RTR0MEMOBJ; … … 727 728 } 728 729 729 for (VMCPUID i = 0; i < pVM->cCpus; i++)730 { 731 PVMCPU pVCpu = &pVM->aCpus[i];730 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 731 { 732 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 732 733 733 734 /* … … 785 786 * @param pVM The cross context VM structure. 786 787 */ 787 VMMR0DECL(int) SVMR0TermVM(PVM pVM)788 VMMR0DECL(int) SVMR0TermVM(PVMCC pVM) 788 789 { 789 790 hmR0SvmFreeStructs(pVM); … … 798 799 * @param pVCpu The cross context virtual CPU structure. 799 800 */ 800 DECLINLINE(bool) hmR0SvmSupportsVmcbCleanBits(PVMCPU pVCpu)801 { 802 PVM pVM = pVCpu->CTX_SUFF(pVM);801 DECLINLINE(bool) hmR0SvmSupportsVmcbCleanBits(PVMCPUCC pVCpu) 802 { 803 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 803 804 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 804 805 if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) … … 818 819 * @param pVCpu The cross context virtual CPU structure. 819 820 */ 820 DECLINLINE(bool) hmR0SvmSupportsDecodeAssists(PVMCPU pVCpu)821 { 822 PVM pVM = pVCpu->CTX_SUFF(pVM);821 DECLINLINE(bool) hmR0SvmSupportsDecodeAssists(PVMCPUCC pVCpu) 822 { 823 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 823 824 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 824 825 if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) … … 838 839 * @param pVCpu The cross context virtual CPU structure. 839 840 */ 840 DECLINLINE(bool) hmR0SvmSupportsNextRipSave(PVMCPU pVCpu)841 { 842 PVM pVM = pVCpu->CTX_SUFF(pVM);841 DECLINLINE(bool) hmR0SvmSupportsNextRipSave(PVMCPUCC pVCpu) 842 { 843 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 843 844 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 844 845 if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) … … 864 865 * caller needs to take care of this. 865 866 */ 866 static void hmR0SvmSetMsrPermission(PVMCPU pVCpu, uint8_t *pbMsrBitmap, uint32_t idMsr, SVMMSREXITREAD enmRead,867 static void hmR0SvmSetMsrPermission(PVMCPUCC pVCpu, uint8_t *pbMsrBitmap, uint32_t idMsr, SVMMSREXITREAD enmRead, 867 868 SVMMSREXITWRITE enmWrite) 868 869 { … … 926 927 * @param pVM The cross context VM structure. 927 928 */ 928 VMMR0DECL(int) SVMR0SetupVM(PVM pVM)929 VMMR0DECL(int) SVMR0SetupVM(PVMCC pVM) 929 930 { 930 931 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 947 948 #endif 948 949 949 PVMCPU pVCpu = &pVM->aCpus[0];950 PSVMVMCB pVmcb = pVCpu->hm.s.svm.pVmcb;951 AssertMsgReturn( pVmcb, ("Invalid pVmcb for vcpu[0]\n"), VERR_SVM_INVALID_PVMCB);952 PSVMVMCBCTRL pVmcbCtrl = &pVmcb->ctrl;950 PVMCPUCC pVCpu0 = VMCC_GET_CPU_0(pVM); 951 PSVMVMCB pVmcb0 = pVCpu0->hm.s.svm.pVmcb; 952 AssertMsgReturn(RT_VALID_PTR(pVmcb0), ("Invalid pVmcb (%p) for vcpu[0]\n", pVmcb0), VERR_SVM_INVALID_PVMCB); 953 PSVMVMCBCTRL pVmcbCtrl0 = &pVmcb0->ctrl; 953 954 954 955 /* Always trap #AC for reasons of security. */ 955 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_AC);956 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_AC); 956 957 957 958 /* Always trap #DB for reasons of security. */ 958 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_DB);959 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_DB); 959 960 960 961 /* Trap exceptions unconditionally (debug purposes). */ 961 962 #ifdef HMSVM_ALWAYS_TRAP_PF 962 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT(X86_XCPT_PF);963 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_PF); 963 964 #endif 964 965 #ifdef HMSVM_ALWAYS_TRAP_ALL_XCPTS 965 966 /* If you add any exceptions here, make sure to update hmR0SvmHandleExit(). */ 966 pVmcbCtrl->u32InterceptXcpt |= 0 967 | RT_BIT(X86_XCPT_BP) 968 | RT_BIT(X86_XCPT_DE) 969 | RT_BIT(X86_XCPT_NM) 970 | RT_BIT(X86_XCPT_UD) 971 | RT_BIT(X86_XCPT_NP) 972 | RT_BIT(X86_XCPT_SS) 973 | RT_BIT(X86_XCPT_GP) 974 | RT_BIT(X86_XCPT_PF) 975 | RT_BIT(X86_XCPT_MF) 976 ; 967 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT_32(X86_XCPT_BP) 968 | RT_BIT_32(X86_XCPT_DE) 969 | RT_BIT_32(X86_XCPT_NM) 970 | RT_BIT_32(X86_XCPT_UD) 971 | RT_BIT_32(X86_XCPT_NP) 972 | RT_BIT_32(X86_XCPT_SS) 973 | RT_BIT_32(X86_XCPT_GP) 974 | RT_BIT_32(X86_XCPT_PF) 975 | RT_BIT_32(X86_XCPT_MF) 976 ; 977 977 #endif 978 978 979 979 /* Apply the exceptions intercepts needed by the GIM provider. */ 980 if (pVCpu ->hm.s.fGIMTrapXcptUD)981 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT(X86_XCPT_UD);980 if (pVCpu0->hm.s.fGIMTrapXcptUD) 981 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT(X86_XCPT_UD); 982 982 983 983 /* The mesa 3d driver hack needs #GP. */ 984 if (pVCpu ->hm.s.fTrapXcptGpForLovelyMesaDrv)985 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT(X86_XCPT_GP);984 if (pVCpu0->hm.s.fTrapXcptGpForLovelyMesaDrv) 985 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT(X86_XCPT_GP); 986 986 987 987 /* Set up unconditional intercepts and conditions. */ 988 pVmcbCtrl ->u64InterceptCtrl = HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS989 | SVM_CTRL_INTERCEPT_VMMCALL;988 pVmcbCtrl0->u64InterceptCtrl = HMSVM_MANDATORY_GUEST_CTRL_INTERCEPTS 989 | SVM_CTRL_INTERCEPT_VMMCALL; 990 990 991 991 #ifdef HMSVM_ALWAYS_TRAP_TASK_SWITCH 992 pVmcbCtrl ->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_TASK_SWITCH;992 pVmcbCtrl0->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_TASK_SWITCH; 993 993 #endif 994 994 995 995 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 996 996 /* Virtualized VMSAVE/VMLOAD. */ 997 pVmcbCtrl ->LbrVirt.n.u1VirtVmsaveVmload = fUseVirtVmsaveVmload;997 pVmcbCtrl0->LbrVirt.n.u1VirtVmsaveVmload = fUseVirtVmsaveVmload; 998 998 if (!fUseVirtVmsaveVmload) 999 { 1000 pVmcbCtrl->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_VMSAVE 1001 | SVM_CTRL_INTERCEPT_VMLOAD; 1002 } 999 pVmcbCtrl0->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_VMSAVE 1000 | SVM_CTRL_INTERCEPT_VMLOAD; 1003 1001 1004 1002 /* Virtual GIF. */ 1005 pVmcbCtrl ->IntCtrl.n.u1VGifEnable = fUseVGif;1003 pVmcbCtrl0->IntCtrl.n.u1VGifEnable = fUseVGif; 1006 1004 if (!fUseVGif) 1007 { 1008 pVmcbCtrl->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_CLGI 1009 | SVM_CTRL_INTERCEPT_STGI; 1010 } 1005 pVmcbCtrl0->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_CLGI 1006 | SVM_CTRL_INTERCEPT_STGI; 1011 1007 #endif 1012 1008 1013 1009 /* CR4 writes must always be intercepted for tracking PGM mode changes. */ 1014 pVmcbCtrl ->u16InterceptWrCRx = RT_BIT(4);1010 pVmcbCtrl0->u16InterceptWrCRx = RT_BIT(4); 1015 1011 1016 1012 /* Intercept all DRx reads and writes by default. Changed later on. */ 1017 pVmcbCtrl ->u16InterceptRdDRx = 0xffff;1018 pVmcbCtrl ->u16InterceptWrDRx = 0xffff;1013 pVmcbCtrl0->u16InterceptRdDRx = 0xffff; 1014 pVmcbCtrl0->u16InterceptWrDRx = 0xffff; 1019 1015 1020 1016 /* Virtualize masking of INTR interrupts. (reads/writes from/to CR8 go to the V_TPR register) */ 1021 pVmcbCtrl ->IntCtrl.n.u1VIntrMasking = 1;1017 pVmcbCtrl0->IntCtrl.n.u1VIntrMasking = 1; 1022 1018 1023 1019 /* Ignore the priority in the virtual TPR. This is necessary for delivering PIC style (ExtInt) interrupts 1024 1020 and we currently deliver both PIC and APIC interrupts alike, see hmR0SvmEvaluatePendingEvent() */ 1025 pVmcbCtrl ->IntCtrl.n.u1IgnoreTPR = 1;1021 pVmcbCtrl0->IntCtrl.n.u1IgnoreTPR = 1; 1026 1022 1027 1023 /* Set the IO permission bitmap physical addresses. */ 1028 pVmcbCtrl ->u64IOPMPhysAddr = g_HCPhysIOBitmap;1024 pVmcbCtrl0->u64IOPMPhysAddr = g_HCPhysIOBitmap; 1029 1025 1030 1026 /* LBR virtualization. */ 1031 pVmcbCtrl ->LbrVirt.n.u1LbrVirt = fUseLbrVirt;1027 pVmcbCtrl0->LbrVirt.n.u1LbrVirt = fUseLbrVirt; 1032 1028 1033 1029 /* The host ASID MBZ, for the guest start with 1. */ 1034 pVmcbCtrl ->TLBCtrl.n.u32ASID = 1;1030 pVmcbCtrl0->TLBCtrl.n.u32ASID = 1; 1035 1031 1036 1032 /* Setup Nested Paging. This doesn't change throughout the execution time of the VM. */ 1037 pVmcbCtrl ->NestedPagingCtrl.n.u1NestedPaging = pVM->hm.s.fNestedPaging;1033 pVmcbCtrl0->NestedPagingCtrl.n.u1NestedPaging = pVM->hm.s.fNestedPaging; 1038 1034 1039 1035 /* Without Nested Paging, we need additionally intercepts. */ … … 1041 1037 { 1042 1038 /* CR3 reads/writes must be intercepted; our shadow values differ from the guest values. */ 1043 pVmcbCtrl ->u16InterceptRdCRx |= RT_BIT(3);1044 pVmcbCtrl ->u16InterceptWrCRx |= RT_BIT(3);1039 pVmcbCtrl0->u16InterceptRdCRx |= RT_BIT(3); 1040 pVmcbCtrl0->u16InterceptWrCRx |= RT_BIT(3); 1045 1041 1046 1042 /* Intercept INVLPG and task switches (may change CR3, EFLAGS, LDT). */ 1047 pVmcbCtrl ->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_INVLPG1048 | SVM_CTRL_INTERCEPT_TASK_SWITCH;1043 pVmcbCtrl0->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_INVLPG 1044 | SVM_CTRL_INTERCEPT_TASK_SWITCH; 1049 1045 1050 1046 /* Page faults must be intercepted to implement shadow paging. */ 1051 pVmcbCtrl ->u32InterceptXcpt |= RT_BIT(X86_XCPT_PF);1047 pVmcbCtrl0->u32InterceptXcpt |= RT_BIT(X86_XCPT_PF); 1052 1048 } 1053 1049 … … 1056 1052 { 1057 1053 Assert(pVM->hm.s.svm.cPauseFilter > 0); 1058 pVmcbCtrl ->u16PauseFilterCount = pVM->hm.s.svm.cPauseFilter;1054 pVmcbCtrl0->u16PauseFilterCount = pVM->hm.s.svm.cPauseFilter; 1059 1055 if (fPauseFilterThreshold) 1060 pVmcbCtrl ->u16PauseFilterThreshold = pVM->hm.s.svm.cPauseFilterThresholdTicks;1061 pVmcbCtrl ->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_PAUSE;1056 pVmcbCtrl0->u16PauseFilterThreshold = pVM->hm.s.svm.cPauseFilterThresholdTicks; 1057 pVmcbCtrl0->u64InterceptCtrl |= SVM_CTRL_INTERCEPT_PAUSE; 1062 1058 } 1063 1059 … … 1067 1063 * Don't intercept guest read/write accesses to these MSRs. 1068 1064 */ 1069 uint8_t *pbMsrBitmap = (uint8_t *)pVCpu->hm.s.svm.pvMsrBitmap;1070 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_LSTAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1071 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_CSTAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1072 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K6_STAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1073 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_SF_MASK, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1074 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_FS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1075 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_GS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1076 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_K8_KERNEL_GS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1077 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_IA32_SYSENTER_CS, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1078 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_IA32_SYSENTER_ESP, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1079 hmR0SvmSetMsrPermission(pVCpu , pbMsrBitmap, MSR_IA32_SYSENTER_EIP, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);1080 pVmcbCtrl ->u64MSRPMPhysAddr = pVCpu->hm.s.svm.HCPhysMsrBitmap;1065 uint8_t *pbMsrBitmap0 = (uint8_t *)pVCpu0->hm.s.svm.pvMsrBitmap; 1066 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_LSTAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1067 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_CSTAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1068 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K6_STAR, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1069 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_SF_MASK, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1070 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_FS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1071 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_GS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1072 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_K8_KERNEL_GS_BASE, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1073 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_IA32_SYSENTER_CS, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1074 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_IA32_SYSENTER_ESP, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1075 hmR0SvmSetMsrPermission(pVCpu0, pbMsrBitmap0, MSR_IA32_SYSENTER_EIP, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE); 1076 pVmcbCtrl0->u64MSRPMPhysAddr = pVCpu0->hm.s.svm.HCPhysMsrBitmap; 1081 1077 1082 1078 /* Initially all VMCB clean bits MBZ indicating that everything should be loaded from the VMCB in memory. */ 1083 Assert(pVmcbCtrl ->u32VmcbCleanBits == 0);1084 1085 for (VMCPUID i = 1; i < pVM->cCpus; i++)1086 { 1087 PVMCPU pVCpuCur = &pVM->aCpus[i];1088 PSVMVMCB pVmcbCur = pV M->aCpus[i].hm.s.svm.pVmcb;1089 AssertMsgReturn( pVmcbCur, ("Invalid pVmcb for vcpu[%u]\n", i), VERR_SVM_INVALID_PVMCB);1079 Assert(pVmcbCtrl0->u32VmcbCleanBits == 0); 1080 1081 for (VMCPUID idCpu = 1; idCpu < pVM->cCpus; idCpu++) 1082 { 1083 PVMCPUCC pVCpuCur = VMCC_GET_CPU(pVM, idCpu); 1084 PSVMVMCB pVmcbCur = pVCpuCur->hm.s.svm.pVmcb; 1085 AssertMsgReturn(RT_VALID_PTR(pVmcbCur), ("Invalid pVmcb (%p) for vcpu[%u]\n", pVmcbCur, idCpu), VERR_SVM_INVALID_PVMCB); 1090 1086 PSVMVMCBCTRL pVmcbCtrlCur = &pVmcbCur->ctrl; 1091 1087 1092 1088 /* Copy the VMCB control area. */ 1093 memcpy(pVmcbCtrlCur, pVmcbCtrl , sizeof(*pVmcbCtrlCur));1089 memcpy(pVmcbCtrlCur, pVmcbCtrl0, sizeof(*pVmcbCtrlCur)); 1094 1090 1095 1091 /* Copy the MSR bitmap and setup the VCPU-specific host physical address. */ 1096 1092 uint8_t *pbMsrBitmapCur = (uint8_t *)pVCpuCur->hm.s.svm.pvMsrBitmap; 1097 memcpy(pbMsrBitmapCur, pbMsrBitmap , SVM_MSRPM_PAGES << X86_PAGE_4K_SHIFT);1093 memcpy(pbMsrBitmapCur, pbMsrBitmap0, SVM_MSRPM_PAGES << X86_PAGE_4K_SHIFT); 1098 1094 pVmcbCtrlCur->u64MSRPMPhysAddr = pVCpuCur->hm.s.svm.HCPhysMsrBitmap; 1099 1095 … … 1102 1098 1103 1099 /* Verify our assumption that GIM providers trap #UD uniformly across VCPUs initially. */ 1104 Assert(pVCpuCur->hm.s.fGIMTrapXcptUD == pVCpu ->hm.s.fGIMTrapXcptUD);1100 Assert(pVCpuCur->hm.s.fGIMTrapXcptUD == pVCpu0->hm.s.fGIMTrapXcptUD); 1105 1101 } 1106 1102 … … 1121 1117 * @param pVCpu The cross context virtual CPU structure. 1122 1118 */ 1123 DECLINLINE(PSVMVMCB) hmR0SvmGetCurrentVmcb(PVMCPU pVCpu)1119 DECLINLINE(PSVMVMCB) hmR0SvmGetCurrentVmcb(PVMCPUCC pVCpu) 1124 1120 { 1125 1121 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM … … 1137 1133 * @param pVCpu The cross context virtual CPU structure. 1138 1134 */ 1139 DECLINLINE(PSVMNESTEDVMCBCACHE) hmR0SvmGetNestedVmcbCache(PVMCPU pVCpu)1135 DECLINLINE(PSVMNESTEDVMCBCACHE) hmR0SvmGetNestedVmcbCache(PVMCPUCC pVCpu) 1140 1136 { 1141 1137 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM … … 1156 1152 * @param GCVirt Guest virtual address of the page to invalidate. 1157 1153 */ 1158 VMMR0DECL(int) SVMR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt)1154 VMMR0DECL(int) SVMR0InvalidatePage(PVMCPUCC pVCpu, RTGCPTR GCVirt) 1159 1155 { 1160 1156 Assert(pVCpu->CTX_SUFF(pVM)->hm.s.svm.fSupported); … … 1184 1180 * @param pVmcb Pointer to the VM control block. 1185 1181 */ 1186 static void hmR0SvmFlushTaggedTlb(PHMPHYSCPU pHostCpu, PVMCPU pVCpu, PSVMVMCB pVmcb)1182 static void hmR0SvmFlushTaggedTlb(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1187 1183 { 1188 1184 /* … … 1225 1221 * This Host CPU requirement takes precedence. 1226 1222 */ 1227 PVM pVM = pVCpu->CTX_SUFF(pVM);1223 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1228 1224 if (pVM->hm.s.svm.fAlwaysFlushTLB) 1229 1225 { … … 1340 1336 * are not intercepting it. 1341 1337 */ 1342 DECLINLINE(void) hmR0SvmClearXcptIntercept(PVMCPU pVCpu, PSVMVMCB pVmcb, uint8_t uXcpt)1338 DECLINLINE(void) hmR0SvmClearXcptIntercept(PVMCPUCC pVCpu, PSVMVMCB pVmcb, uint8_t uXcpt) 1343 1339 { 1344 1340 Assert(uXcpt != X86_XCPT_DB); … … 1400 1396 * are not intercepting it. 1401 1397 */ 1402 static bool hmR0SvmClearCtrlIntercept(PVMCPU pVCpu, PSVMVMCB pVmcb, uint64_t fCtrlIntercept)1398 static bool hmR0SvmClearCtrlIntercept(PVMCPUCC pVCpu, PSVMVMCB pVmcb, uint64_t fCtrlIntercept) 1403 1399 { 1404 1400 if (pVmcb->ctrl.u64InterceptCtrl & fCtrlIntercept) … … 1435 1431 * @remarks No-long-jump zone!!! 1436 1432 */ 1437 static void hmR0SvmExportGuestCR0(PVMCPU pVCpu, PSVMVMCB pVmcb)1433 static void hmR0SvmExportGuestCR0(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1438 1434 { 1439 1435 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1518 1514 * @remarks No-long-jump zone!!! 1519 1515 */ 1520 static void hmR0SvmExportGuestCR3(PVMCPU pVCpu, PSVMVMCB pVmcb)1516 static void hmR0SvmExportGuestCR3(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1521 1517 { 1522 1518 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1523 1519 1524 PVM pVM = pVCpu->CTX_SUFF(pVM);1520 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1525 1521 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 1526 1522 if (pVM->hm.s.fNestedPaging) … … 1546 1542 * @remarks No-long-jump zone!!! 1547 1543 */ 1548 static int hmR0SvmExportGuestCR4(PVMCPU pVCpu, PSVMVMCB pVmcb)1544 static int hmR0SvmExportGuestCR4(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1549 1545 { 1550 1546 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1623 1619 * @remarks No-long-jump zone!!! 1624 1620 */ 1625 static int hmR0SvmExportGuestControlRegs(PVMCPU pVCpu, PSVMVMCB pVmcb)1621 static int hmR0SvmExportGuestControlRegs(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1626 1622 { 1627 1623 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1664 1660 * @remarks No-long-jump zone!!! 1665 1661 */ 1666 static void hmR0SvmExportGuestSegmentRegs(PVMCPU pVCpu, PSVMVMCB pVmcb)1662 static void hmR0SvmExportGuestSegmentRegs(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1667 1663 { 1668 1664 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1733 1729 * @remarks No-long-jump zone!!! 1734 1730 */ 1735 static void hmR0SvmExportGuestMsrs(PVMCPU pVCpu, PSVMVMCB pVmcb)1731 static void hmR0SvmExportGuestMsrs(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1736 1732 { 1737 1733 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1813 1809 * @remarks Requires EFLAGS to be up-to-date in the VMCB! 1814 1810 */ 1815 static void hmR0SvmExportSharedDebugState(PVMCPU pVCpu, PSVMVMCB pVmcb)1811 static void hmR0SvmExportSharedDebugState(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1816 1812 { 1817 1813 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 1938 1934 * @remarks No-long-jump zone!!! 1939 1935 */ 1940 static void hmR0SvmExportGuestHwvirtStateNested(PVMCPU pVCpu, PSVMVMCB pVmcbNstGst)1936 static void hmR0SvmExportGuestHwvirtStateNested(PVMCPUCC pVCpu, PSVMVMCB pVmcbNstGst) 1941 1937 { 1942 1938 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1952 1948 * and may continue execution in SVM R0 without a nested-guest #VMEXIT in between. 1953 1949 */ 1954 PVM pVM = pVCpu->CTX_SUFF(pVM);1950 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1955 1951 PSVMVMCBCTRL pVmcbNstGstCtrl = &pVmcbNstGst->ctrl; 1956 1952 uint16_t const uGuestPauseFilterCount = pVM->hm.s.svm.cPauseFilter; … … 1981 1977 * @param pVmcb Pointer to the VM control block. 1982 1978 */ 1983 static int hmR0SvmExportGuestApicTpr(PVMCPU pVCpu, PSVMVMCB pVmcb)1979 static int hmR0SvmExportGuestApicTpr(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 1984 1980 { 1985 1981 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_APIC_TPR) 1986 1982 { 1987 PVM pVM = pVCpu->CTX_SUFF(pVM);1983 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1988 1984 if ( PDMHasApic(pVM) 1989 1985 && APICIsEnabled(pVCpu)) … … 2048 2044 * @remarks No-long-jump zone!!! 2049 2045 */ 2050 static void hmR0SvmExportGuestXcptIntercepts(PVMCPU pVCpu, PSVMVMCB pVmcb)2046 static void hmR0SvmExportGuestXcptIntercepts(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 2051 2047 { 2052 2048 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2085 2081 * @param pVmcbNstGst Pointer to the nested-guest VM control block. 2086 2082 */ 2087 static void hmR0SvmMergeVmcbCtrlsNested(PVMCPU pVCpu)2088 { 2089 PVM pVM = pVCpu->CTX_SUFF(pVM);2083 static void hmR0SvmMergeVmcbCtrlsNested(PVMCPUCC pVCpu) 2084 { 2085 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 2090 2086 PCSVMVMCB pVmcb = pVCpu->hm.s.svm.pVmcb; 2091 2087 PSVMVMCB pVmcbNstGst = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pVmcb); … … 2166 2162 * @remarks No-long-jump zone!!! 2167 2163 */ 2168 static int hmR0SvmSelectVMRunHandler(PVMCPU pVCpu)2164 static int hmR0SvmSelectVMRunHandler(PVMCPUCC pVCpu) 2169 2165 { 2170 2166 if (CPUMIsGuestInLongMode(pVCpu)) … … 2196 2192 * @param pVCpu The cross context virtual CPU structure. 2197 2193 */ 2198 VMMR0DECL(int) SVMR0Enter(PVMCPU pVCpu)2194 VMMR0DECL(int) SVMR0Enter(PVMCPUCC pVCpu) 2199 2195 { 2200 2196 AssertPtr(pVCpu); … … 2219 2215 * @thread EMT(pVCpu) 2220 2216 */ 2221 VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit)2217 VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit) 2222 2218 { 2223 2219 NOREF(fGlobalInit); … … 2289 2285 * @remarks No-long-jump zone!!! 2290 2286 */ 2291 VMMR0DECL(int) SVMR0ExportHostState(PVMCPU pVCpu)2287 VMMR0DECL(int) SVMR0ExportHostState(PVMCPUCC pVCpu) 2292 2288 { 2293 2289 NOREF(pVCpu); … … 2311 2307 * @remarks No-long-jump zone!!! 2312 2308 */ 2313 static int hmR0SvmExportGuestState(PVMCPU pVCpu)2309 static int hmR0SvmExportGuestState(PVMCPUCC pVCpu) 2314 2310 { 2315 2311 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExportGuestState, x); … … 2399 2395 * @remarks No-long-jmp zone!!! 2400 2396 */ 2401 DECLINLINE(void) hmR0SvmMergeMsrpmNested(PHMPHYSCPU pHostCpu, PVMCPU pVCpu)2397 DECLINLINE(void) hmR0SvmMergeMsrpmNested(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu) 2402 2398 { 2403 2399 uint64_t const *pu64GstMsrpm = (uint64_t const *)pVCpu->hm.s.svm.pvMsrBitmap; … … 2421 2417 * @sa HMNotifySvmNstGstVmexit. 2422 2418 */ 2423 static bool hmR0SvmCacheVmcbNested(PVMCPU pVCpu)2419 static bool hmR0SvmCacheVmcbNested(PVMCPUCC pVCpu) 2424 2420 { 2425 2421 /* … … 2465 2461 * @param pVCpu The cross context virtual CPU structure. 2466 2462 */ 2467 static void hmR0SvmSetupVmcbNested(PVMCPU pVCpu)2463 static void hmR0SvmSetupVmcbNested(PVMCPUCC pVCpu) 2468 2464 { 2469 2465 PSVMVMCB pVmcbNstGst = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pVmcb); … … 2548 2544 * @remarks No-long-jump zone!!! 2549 2545 */ 2550 static int hmR0SvmExportGuestStateNested(PVMCPU pVCpu)2546 static int hmR0SvmExportGuestStateNested(PVMCPUCC pVCpu) 2551 2547 { 2552 2548 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatExportGuestState, x); … … 2626 2622 * @remarks No-long-jump zone!!! 2627 2623 */ 2628 static void hmR0SvmExportSharedState(PVMCPU pVCpu, PSVMVMCB pVmcb)2624 static void hmR0SvmExportSharedState(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 2629 2625 { 2630 2626 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2656 2652 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 2657 2653 */ 2658 static void hmR0SvmImportGuestState(PVMCPU pVCpu, uint64_t fWhat)2654 static void hmR0SvmImportGuestState(PVMCPUCC pVCpu, uint64_t fWhat) 2659 2655 { 2660 2656 STAM_PROFILE_ADV_START(&pVCpu->hm.s.StatImportGuestState, x); … … 2925 2921 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 2926 2922 */ 2927 VMMR0DECL(int) SVMR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat)2923 VMMR0DECL(int) SVMR0ImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat) 2928 2924 { 2929 2925 hmR0SvmImportGuestState(pVCpu, fWhat); … … 2942 2938 * @remarks No-long-jmp zone!!! 2943 2939 */ 2944 static void hmR0SvmLeave(PVMCPU pVCpu, bool fImportState)2940 static void hmR0SvmLeave(PVMCPUCC pVCpu, bool fImportState) 2945 2941 { 2946 2942 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2997 2993 * @param pVCpu The cross context virtual CPU structure. 2998 2994 */ 2999 static int hmR0SvmLeaveSession(PVMCPU pVCpu)2995 static int hmR0SvmLeaveSession(PVMCPUCC pVCpu) 3000 2996 { 3001 2997 HM_DISABLE_PREEMPT(pVCpu); … … 3036 3032 * @remarks No-long-jmp zone!!! 3037 3033 */ 3038 static int hmR0SvmLongJmpToRing3(PVMCPU pVCpu)3034 static int hmR0SvmLongJmpToRing3(PVMCPUCC pVCpu) 3039 3035 { 3040 3036 return hmR0SvmLeaveSession(pVCpu); … … 3051 3047 * @param pvUser The user argument, NULL (currently unused). 3052 3048 */ 3053 static DECLCALLBACK(int) hmR0SvmCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)3049 static DECLCALLBACK(int) hmR0SvmCallRing3Callback(PVMCPUCC pVCpu, VMMCALLRING3 enmOperation, void *pvUser) 3054 3050 { 3055 3051 RT_NOREF_PV(pvUser); … … 3114 3110 * VINF_VMM_UNKNOWN_RING3_CALL. 3115 3111 */ 3116 static int hmR0SvmExitToRing3(PVMCPU pVCpu, int rcExit)3112 static int hmR0SvmExitToRing3(PVMCPUCC pVCpu, int rcExit) 3117 3113 { 3118 3114 Assert(pVCpu); … … 3189 3185 * @remarks No-long-jump zone!!! 3190 3186 */ 3191 static void hmR0SvmUpdateTscOffsetting(PVMCPU pVCpu, PSVMVMCB pVmcb)3187 static void hmR0SvmUpdateTscOffsetting(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 3192 3188 { 3193 3189 /* … … 3240 3236 * the guest i.e. 'StatInjectPendingReflect' is incremented always. 3241 3237 */ 3242 DECLINLINE(void) hmR0SvmSetPendingEvent(PVMCPU pVCpu, PSVMEVENT pEvent, RTGCUINTPTR GCPtrFaultAddress)3238 DECLINLINE(void) hmR0SvmSetPendingEvent(PVMCPUCC pVCpu, PSVMEVENT pEvent, RTGCUINTPTR GCPtrFaultAddress) 3243 3239 { 3244 3240 Assert(!pVCpu->hm.s.Event.fPending); … … 3259 3255 * @param pVCpu The cross context virtual CPU structure. 3260 3256 */ 3261 DECLINLINE(void) hmR0SvmSetPendingXcptUD(PVMCPU pVCpu)3257 DECLINLINE(void) hmR0SvmSetPendingXcptUD(PVMCPUCC pVCpu) 3262 3258 { 3263 3259 SVMEVENT Event; … … 3275 3271 * @param pVCpu The cross context virtual CPU structure. 3276 3272 */ 3277 DECLINLINE(void) hmR0SvmSetPendingXcptDB(PVMCPU pVCpu)3273 DECLINLINE(void) hmR0SvmSetPendingXcptDB(PVMCPUCC pVCpu) 3278 3274 { 3279 3275 SVMEVENT Event; … … 3295 3291 * @remarks This updates the guest CR2 with @a uFaultAddress! 3296 3292 */ 3297 DECLINLINE(void) hmR0SvmSetPendingXcptPF(PVMCPU pVCpu, uint32_t u32ErrCode, RTGCUINTPTR uFaultAddress)3293 DECLINLINE(void) hmR0SvmSetPendingXcptPF(PVMCPUCC pVCpu, uint32_t u32ErrCode, RTGCUINTPTR uFaultAddress) 3298 3294 { 3299 3295 SVMEVENT Event; … … 3323 3319 * @param pVCpu The cross context virtual CPU structure. 3324 3320 */ 3325 DECLINLINE(void) hmR0SvmSetPendingXcptMF(PVMCPU pVCpu)3321 DECLINLINE(void) hmR0SvmSetPendingXcptMF(PVMCPUCC pVCpu) 3326 3322 { 3327 3323 SVMEVENT Event; … … 3339 3335 * @param pVCpu The cross context virtual CPU structure. 3340 3336 */ 3341 DECLINLINE(void) hmR0SvmSetPendingXcptDF(PVMCPU pVCpu)3337 DECLINLINE(void) hmR0SvmSetPendingXcptDF(PVMCPUCC pVCpu) 3342 3338 { 3343 3339 SVMEVENT Event; … … 3363 3359 * @remarks Requires CR0! 3364 3360 */ 3365 DECLINLINE(void) hmR0SvmInjectEventVmcb(PVMCPU pVCpu, PSVMVMCB pVmcb, PSVMEVENT pEvent)3361 DECLINLINE(void) hmR0SvmInjectEventVmcb(PVMCPUCC pVCpu, PSVMVMCB pVmcb, PSVMEVENT pEvent) 3366 3362 { 3367 3363 Assert(!pVmcb->ctrl.EventInject.n.u1Valid); … … 3382 3378 * @param pVCpu The cross context virtual CPU structure. 3383 3379 */ 3384 static void hmR0SvmTrpmTrapToPendingEvent(PVMCPU pVCpu)3380 static void hmR0SvmTrpmTrapToPendingEvent(PVMCPUCC pVCpu) 3385 3381 { 3386 3382 Assert(TRPMHasTrap(pVCpu)); … … 3455 3451 * @param pVCpu The cross context virtual CPU structure. 3456 3452 */ 3457 static void hmR0SvmPendingEventToTrpmTrap(PVMCPU pVCpu)3453 static void hmR0SvmPendingEventToTrpmTrap(PVMCPUCC pVCpu) 3458 3454 { 3459 3455 Assert(pVCpu->hm.s.Event.fPending); … … 3496 3492 * @remarks Has side-effects with VMCPU_FF_INHIBIT_INTERRUPTS force-flag. 3497 3493 */ 3498 static bool hmR0SvmIsIntrShadowActive(PVMCPU pVCpu)3494 static bool hmR0SvmIsIntrShadowActive(PVMCPUCC pVCpu) 3499 3495 { 3500 3496 /* … … 3527 3523 * @param pVmcb Pointer to the VM control block. 3528 3524 */ 3529 static void hmR0SvmSetIntWindowExiting(PVMCPU pVCpu, PSVMVMCB pVmcb)3525 static void hmR0SvmSetIntWindowExiting(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 3530 3526 { 3531 3527 /* … … 3578 3574 * @param pVmcb Pointer to the VM control block. 3579 3575 */ 3580 static void hmR0SvmClearIntWindowExiting(PVMCPU pVCpu, PSVMVMCB pVmcb)3576 static void hmR0SvmClearIntWindowExiting(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 3581 3577 { 3582 3578 PSVMVMCBCTRL pVmcbCtrl = &pVmcb->ctrl; … … 3599 3595 * @param pVCpu The cross context virtual CPU structure. 3600 3596 */ 3601 static VBOXSTRICTRC hmR0SvmEvaluatePendingEventNested(PVMCPU pVCpu)3597 static VBOXSTRICTRC hmR0SvmEvaluatePendingEventNested(PVMCPUCC pVCpu) 3602 3598 { 3603 3599 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 3725 3721 * @param pVCpu The cross context virtual CPU structure. 3726 3722 */ 3727 static void hmR0SvmEvaluatePendingEvent(PVMCPU pVCpu)3723 static void hmR0SvmEvaluatePendingEvent(PVMCPUCC pVCpu) 3728 3724 { 3729 3725 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 3827 3823 * prematurely. 3828 3824 */ 3829 static void hmR0SvmInjectPendingEvent(PVMCPU pVCpu, PSVMVMCB pVmcb)3825 static void hmR0SvmInjectPendingEvent(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 3830 3826 { 3831 3827 Assert(!TRPMHasTrap(pVCpu)); … … 3928 3924 * guest-state). 3929 3925 */ 3930 static void hmR0SvmReportWorldSwitchError(PVMCPU pVCpu, int rcVMRun)3926 static void hmR0SvmReportWorldSwitchError(PVMCPUCC pVCpu, int rcVMRun) 3931 3927 { 3932 3928 HMSVM_ASSERT_PREEMPT_SAFE(pVCpu); … … 4086 4082 * @param pVCpu The cross context virtual CPU structure. 4087 4083 */ 4088 static int hmR0SvmCheckForceFlags(PVMCPU pVCpu)4084 static int hmR0SvmCheckForceFlags(PVMCPUCC pVCpu) 4089 4085 { 4090 4086 Assert(VMMRZCallRing3IsEnabled(pVCpu)); … … 4099 4095 APICUpdatePendingInterrupts(pVCpu); 4100 4096 4101 PVM pVM = pVCpu->CTX_SUFF(pVM);4097 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4102 4098 if ( VM_FF_IS_ANY_SET(pVM, !pVCpu->hm.s.fSingleInstruction 4103 4099 ? VM_FF_HP_R0_PRE_HM_MASK : VM_FF_HP_R0_PRE_HM_STEP_MASK) … … 4172 4168 * @sa hmR0SvmPreRunGuest. 4173 4169 */ 4174 static int hmR0SvmPreRunGuestNested(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)4170 static int hmR0SvmPreRunGuestNested(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 4175 4171 { 4176 4172 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 4208 4204 * NB: If we could continue a task switch exit we wouldn't need to do this. 4209 4205 */ 4210 PVM pVM = pVCpu->CTX_SUFF(pVM);4206 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4211 4207 if (RT_UNLIKELY( !pVM->hm.s.svm.u32Features 4212 4208 && pVCpu->hm.s.Event.fPending … … 4294 4290 * @param pSvmTransient Pointer to the SVM transient structure. 4295 4291 */ 4296 static int hmR0SvmPreRunGuest(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)4292 static int hmR0SvmPreRunGuest(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 4297 4293 { 4298 4294 HMSVM_ASSERT_PREEMPT_SAFE(pVCpu); … … 4314 4310 * NB: If we could continue a task switch exit we wouldn't need to do this. 4315 4311 */ 4316 PVM pVM = pVCpu->CTX_SUFF(pVM);4312 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4317 4313 if (RT_UNLIKELY(pVCpu->hm.s.Event.fPending && (((pVCpu->hm.s.Event.u64IntInfo >> 8) & 7) == SVM_EVENT_NMI))) 4318 4314 if (RT_UNLIKELY(!pVM->hm.s.svm.u32Features)) … … 4400 4396 * @remarks No-long-jump zone!!! 4401 4397 */ 4402 static void hmR0SvmPreRunGuestCommitted(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)4398 static void hmR0SvmPreRunGuestCommitted(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 4403 4399 { 4404 4400 Assert(!VMMRZCallRing3IsEnabled(pVCpu)); … … 4409 4405 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC); /* Indicate the start of guest execution. */ 4410 4406 4411 PVM pVM = pVCpu->CTX_SUFF(pVM);4407 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4412 4408 PSVMVMCB pVmcb = pSvmTransient->pVmcb; 4413 4409 … … 4524 4520 * @remarks No-long-jump zone!!! 4525 4521 */ 4526 DECLINLINE(int) hmR0SvmRunGuest(PVMCPU pVCpu, RTHCPHYS HCPhysVmcb)4522 DECLINLINE(int) hmR0SvmRunGuest(PVMCPUCC pVCpu, RTHCPHYS HCPhysVmcb) 4527 4523 { 4528 4524 /* Mark that HM is the keeper of all guest-CPU registers now that we're going to execute guest code. */ … … 4537 4533 * Refer MSDN "Configuring Programs for 64-bit/x64 Software Conventions / Register Usage". 4538 4534 */ 4539 PVM pVM = pVCpu->CTX_SUFF(pVM);4535 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4540 4536 #ifdef VBOX_WITH_KERNEL_USING_XMM 4541 4537 return hmR0SVMRunWrapXMM(pVCpu->hm.s.svm.HCPhysVmcbHost, HCPhysVmcb, pCtx, pVM, pVCpu, pVCpu->hm.s.svm.pfnVMRun); … … 4558 4554 * unconditionally when it is safe to do so. 4559 4555 */ 4560 static void hmR0SvmPostRunGuest(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient, int rcVMRun)4556 static void hmR0SvmPostRunGuest(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient, int rcVMRun) 4561 4557 { 4562 4558 Assert(!VMMRZCallRing3IsEnabled(pVCpu)); … … 4683 4679 * @param pcLoops Pointer to the number of executed loops. 4684 4680 */ 4685 static int hmR0SvmRunGuestCodeNormal(PVMCPU pVCpu, uint32_t *pcLoops)4681 static int hmR0SvmRunGuestCodeNormal(PVMCPUCC pVCpu, uint32_t *pcLoops) 4686 4682 { 4687 4683 uint32_t const cMaxResumeLoops = pVCpu->CTX_SUFF(pVM)->hm.s.cMaxResumeLoops; … … 4758 4754 * @param pcLoops Pointer to the number of executed loops. 4759 4755 */ 4760 static int hmR0SvmRunGuestCodeStep(PVMCPU pVCpu, uint32_t *pcLoops)4756 static int hmR0SvmRunGuestCodeStep(PVMCPUCC pVCpu, uint32_t *pcLoops) 4761 4757 { 4762 4758 uint32_t const cMaxResumeLoops = pVCpu->CTX_SUFF(pVM)->hm.s.cMaxResumeLoops; … … 4865 4861 * execution loop pass the remainder value, else pass 0. 4866 4862 */ 4867 static int hmR0SvmRunGuestCodeNested(PVMCPU pVCpu, uint32_t *pcLoops)4863 static int hmR0SvmRunGuestCodeNested(PVMCPUCC pVCpu, uint32_t *pcLoops) 4868 4864 { 4869 4865 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 4957 4953 * @param pVCpu The cross context virtual CPU structure. 4958 4954 */ 4959 VMMR0DECL(VBOXSTRICTRC) SVMR0RunGuestCode(PVMCPU pVCpu)4955 VMMR0DECL(VBOXSTRICTRC) SVMR0RunGuestCode(PVMCPUCC pVCpu) 4960 4956 { 4961 4957 Assert(VMMRZCallRing3IsEnabled(pVCpu)); … … 5036 5032 * @param pSvmTransient Pointer to the SVM transient structure. 5037 5033 */ 5038 static int hmR0SvmHandleExitNested(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5034 static int hmR0SvmHandleExitNested(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5039 5035 { 5040 5036 HMSVM_ASSERT_IN_NESTED_GUEST(&pVCpu->cpum.GstCtx); … … 5162 5158 case SVM_EXIT_XCPT_PF: 5163 5159 { 5164 PVM pVM = pVCpu->CTX_SUFF(pVM);5160 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5165 5161 if (pVM->hm.s.fNestedPaging) 5166 5162 { … … 5495 5491 * @param pSvmTransient Pointer to the SVM transient structure. 5496 5492 */ 5497 static int hmR0SvmHandleExit(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5493 static int hmR0SvmHandleExit(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5498 5494 { 5499 5495 Assert(pSvmTransient->u64ExitCode != SVM_EXIT_INVALID); … … 5757 5753 * @remarks No-long-jump zone!!! 5758 5754 */ 5759 static int hmR0SvmCheckExitDueToEventDelivery(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5755 static int hmR0SvmCheckExitDueToEventDelivery(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5760 5756 { 5761 5757 int rc = VINF_SUCCESS; … … 5906 5902 * @param cb RIP increment value in bytes. 5907 5903 */ 5908 DECLINLINE(void) hmR0SvmAdvanceRip(PVMCPU pVCpu, uint32_t cb)5904 DECLINLINE(void) hmR0SvmAdvanceRip(PVMCPUCC pVCpu, uint32_t cb) 5909 5905 { 5910 5906 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 5930 5926 * signals (SVM_EXIT_INTR, SVM_EXIT_NMI, SVM_EXIT_FERR_FREEZE, SVM_EXIT_INIT). 5931 5927 */ 5932 HMSVM_EXIT_DECL hmR0SvmExitIntr(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5928 HMSVM_EXIT_DECL hmR0SvmExitIntr(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5933 5929 { 5934 5930 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 5955 5951 * \#VMEXIT handler for WBINVD (SVM_EXIT_WBINVD). Conditional \#VMEXIT. 5956 5952 */ 5957 HMSVM_EXIT_DECL hmR0SvmExitWbinvd(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5953 HMSVM_EXIT_DECL hmR0SvmExitWbinvd(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5958 5954 { 5959 5955 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 5987 5983 * \#VMEXIT handler for INVD (SVM_EXIT_INVD). Unconditional \#VMEXIT. 5988 5984 */ 5989 HMSVM_EXIT_DECL hmR0SvmExitInvd(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)5985 HMSVM_EXIT_DECL hmR0SvmExitInvd(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 5990 5986 { 5991 5987 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6019 6015 * \#VMEXIT handler for INVD (SVM_EXIT_CPUID). Conditional \#VMEXIT. 6020 6016 */ 6021 HMSVM_EXIT_DECL hmR0SvmExitCpuid(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6017 HMSVM_EXIT_DECL hmR0SvmExitCpuid(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6022 6018 { 6023 6019 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6073 6069 * \#VMEXIT handler for RDTSC (SVM_EXIT_RDTSC). Conditional \#VMEXIT. 6074 6070 */ 6075 HMSVM_EXIT_DECL hmR0SvmExitRdtsc(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6071 HMSVM_EXIT_DECL hmR0SvmExitRdtsc(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6076 6072 { 6077 6073 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6107 6103 * \#VMEXIT handler for RDTSCP (SVM_EXIT_RDTSCP). Conditional \#VMEXIT. 6108 6104 */ 6109 HMSVM_EXIT_DECL hmR0SvmExitRdtscp(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6105 HMSVM_EXIT_DECL hmR0SvmExitRdtscp(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6110 6106 { 6111 6107 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6141 6137 * \#VMEXIT handler for RDPMC (SVM_EXIT_RDPMC). Conditional \#VMEXIT. 6142 6138 */ 6143 HMSVM_EXIT_DECL hmR0SvmExitRdpmc(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6139 HMSVM_EXIT_DECL hmR0SvmExitRdpmc(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6144 6140 { 6145 6141 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6173 6169 * \#VMEXIT handler for INVLPG (SVM_EXIT_INVLPG). Conditional \#VMEXIT. 6174 6170 */ 6175 HMSVM_EXIT_DECL hmR0SvmExitInvlpg(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6171 HMSVM_EXIT_DECL hmR0SvmExitInvlpg(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6176 6172 { 6177 6173 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6209 6205 * \#VMEXIT handler for HLT (SVM_EXIT_HLT). Conditional \#VMEXIT. 6210 6206 */ 6211 HMSVM_EXIT_DECL hmR0SvmExitHlt(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6207 HMSVM_EXIT_DECL hmR0SvmExitHlt(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6212 6208 { 6213 6209 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6246 6242 * \#VMEXIT handler for MONITOR (SVM_EXIT_MONITOR). Conditional \#VMEXIT. 6247 6243 */ 6248 HMSVM_EXIT_DECL hmR0SvmExitMonitor(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6244 HMSVM_EXIT_DECL hmR0SvmExitMonitor(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6249 6245 { 6250 6246 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6283 6279 * \#VMEXIT handler for MWAIT (SVM_EXIT_MWAIT). Conditional \#VMEXIT. 6284 6280 */ 6285 HMSVM_EXIT_DECL hmR0SvmExitMwait(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6281 HMSVM_EXIT_DECL hmR0SvmExitMwait(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6286 6282 { 6287 6283 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6319 6315 * \#VMEXIT. 6320 6316 */ 6321 HMSVM_EXIT_DECL hmR0SvmExitShutdown(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6317 HMSVM_EXIT_DECL hmR0SvmExitShutdown(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6322 6318 { 6323 6319 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6330 6326 * \#VMEXIT handler for unexpected exits. Conditional \#VMEXIT. 6331 6327 */ 6332 HMSVM_EXIT_DECL hmR0SvmExitUnexpected(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6328 HMSVM_EXIT_DECL hmR0SvmExitUnexpected(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6333 6329 { 6334 6330 PCSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu); … … 6345 6341 * \#VMEXIT handler for CRx reads (SVM_EXIT_READ_CR*). Conditional \#VMEXIT. 6346 6342 */ 6347 HMSVM_EXIT_DECL hmR0SvmExitReadCRx(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6343 HMSVM_EXIT_DECL hmR0SvmExitReadCRx(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6348 6344 { 6349 6345 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6403 6399 * \#VMEXIT handler for CRx writes (SVM_EXIT_WRITE_CR*). Conditional \#VMEXIT. 6404 6400 */ 6405 HMSVM_EXIT_DECL hmR0SvmExitWriteCRx(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6401 HMSVM_EXIT_DECL hmR0SvmExitWriteCRx(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6406 6402 { 6407 6403 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6501 6497 * @param pVmcb Pointer to the VM control block. 6502 6498 */ 6503 static VBOXSTRICTRC hmR0SvmExitReadMsr(PVMCPU pVCpu, PSVMVMCB pVmcb)6499 static VBOXSTRICTRC hmR0SvmExitReadMsr(PVMCPUCC pVCpu, PSVMVMCB pVmcb) 6504 6500 { 6505 6501 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdmsr); … … 6545 6541 * @param pSvmTransient Pointer to the SVM-transient structure. 6546 6542 */ 6547 static VBOXSTRICTRC hmR0SvmExitWriteMsr(PVMCPU pVCpu, PSVMVMCB pVmcb, PSVMTRANSIENT pSvmTransient)6543 static VBOXSTRICTRC hmR0SvmExitWriteMsr(PVMCPUCC pVCpu, PSVMVMCB pVmcb, PSVMTRANSIENT pSvmTransient) 6548 6544 { 6549 6545 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 6653 6649 * \#VMEXIT. 6654 6650 */ 6655 HMSVM_EXIT_DECL hmR0SvmExitMsr(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6651 HMSVM_EXIT_DECL hmR0SvmExitMsr(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6656 6652 { 6657 6653 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6669 6665 * \#VMEXIT handler for DRx read (SVM_EXIT_READ_DRx). Conditional \#VMEXIT. 6670 6666 */ 6671 HMSVM_EXIT_DECL hmR0SvmExitReadDRx(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6667 HMSVM_EXIT_DECL hmR0SvmExitReadDRx(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6672 6668 { 6673 6669 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6740 6736 * \#VMEXIT handler for DRx write (SVM_EXIT_WRITE_DRx). Conditional \#VMEXIT. 6741 6737 */ 6742 HMSVM_EXIT_DECL hmR0SvmExitWriteDRx(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6738 HMSVM_EXIT_DECL hmR0SvmExitWriteDRx(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6743 6739 { 6744 6740 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6754 6750 * \#VMEXIT handler for XCRx write (SVM_EXIT_XSETBV). Conditional \#VMEXIT. 6755 6751 */ 6756 HMSVM_EXIT_DECL hmR0SvmExitXsetbv(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6752 HMSVM_EXIT_DECL hmR0SvmExitXsetbv(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6757 6753 { 6758 6754 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6781 6777 * \#VMEXIT handler for I/O instructions (SVM_EXIT_IOIO). Conditional \#VMEXIT. 6782 6778 */ 6783 HMSVM_EXIT_DECL hmR0SvmExitIOInstr(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)6779 HMSVM_EXIT_DECL hmR0SvmExitIOInstr(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 6784 6780 { 6785 6781 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 6790 6786 static uint32_t const s_aIOOpAnd[8] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0 }; /* AND masks for saving 6791 6787 the result (in AL/AX/EAX). */ 6792 PVM pVM = pVCpu->CTX_SUFF(pVM);6788 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6793 6789 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 6794 6790 PSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu); … … 7020 7016 * \#VMEXIT handler for Nested Page-faults (SVM_EXIT_NPF). Conditional \#VMEXIT. 7021 7017 */ 7022 HMSVM_EXIT_DECL hmR0SvmExitNestedPF(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7018 HMSVM_EXIT_DECL hmR0SvmExitNestedPF(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7023 7019 { 7024 7020 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7026 7022 HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY(pVCpu, pSvmTransient); 7027 7023 7028 PVM pVM = pVCpu->CTX_SUFF(pVM);7024 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7029 7025 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 7030 7026 Assert(pVM->hm.s.fNestedPaging); … … 7171 7167 * \#VMEXIT. 7172 7168 */ 7173 HMSVM_EXIT_DECL hmR0SvmExitVIntr(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7169 HMSVM_EXIT_DECL hmR0SvmExitVIntr(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7174 7170 { 7175 7171 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7190 7186 * \#VMEXIT. 7191 7187 */ 7192 HMSVM_EXIT_DECL hmR0SvmExitTaskSwitch(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7188 HMSVM_EXIT_DECL hmR0SvmExitTaskSwitch(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7193 7189 { 7194 7190 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7221 7217 * \#VMEXIT handler for VMMCALL (SVM_EXIT_VMMCALL). Conditional \#VMEXIT. 7222 7218 */ 7223 HMSVM_EXIT_DECL hmR0SvmExitVmmCall(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7219 HMSVM_EXIT_DECL hmR0SvmExitVmmCall(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7224 7220 { 7225 7221 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); 7226 7222 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, HMSVM_CPUMCTX_EXTRN_ALL); 7227 7223 7228 PVM pVM = pVCpu->CTX_SUFF(pVM);7224 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7229 7225 if (pVM->hm.s.fTprPatchingAllowed) 7230 7226 { … … 7278 7274 * \#VMEXIT handler for VMMCALL (SVM_EXIT_VMMCALL). Conditional \#VMEXIT. 7279 7275 */ 7280 HMSVM_EXIT_DECL hmR0SvmExitPause(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7276 HMSVM_EXIT_DECL hmR0SvmExitPause(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7281 7277 { 7282 7278 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7311 7307 * \#VMEXIT. 7312 7308 */ 7313 HMSVM_EXIT_DECL hmR0SvmExitFerrFreeze(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7309 HMSVM_EXIT_DECL hmR0SvmExitFerrFreeze(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7314 7310 { 7315 7311 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7325 7321 * \#VMEXIT handler for IRET (SVM_EXIT_IRET). Conditional \#VMEXIT. 7326 7322 */ 7327 HMSVM_EXIT_DECL hmR0SvmExitIret(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7323 HMSVM_EXIT_DECL hmR0SvmExitIret(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7328 7324 { 7329 7325 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7346 7342 * Conditional \#VMEXIT. 7347 7343 */ 7348 HMSVM_EXIT_DECL hmR0SvmExitXcptPF(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7344 HMSVM_EXIT_DECL hmR0SvmExitXcptPF(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7349 7345 { 7350 7346 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7353 7349 7354 7350 /* See AMD spec. 15.12.15 "#PF (Page Fault)". */ 7355 PVM pVM = pVCpu->CTX_SUFF(pVM);7351 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7356 7352 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 7357 7353 PSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu); … … 7487 7483 * Conditional \#VMEXIT. 7488 7484 */ 7489 HMSVM_EXIT_DECL hmR0SvmExitXcptUD(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7485 HMSVM_EXIT_DECL hmR0SvmExitXcptUD(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7490 7486 { 7491 7487 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7534 7530 * Conditional \#VMEXIT. 7535 7531 */ 7536 HMSVM_EXIT_DECL hmR0SvmExitXcptMF(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7532 HMSVM_EXIT_DECL hmR0SvmExitXcptMF(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7537 7533 { 7538 7534 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7550 7546 if (!(pCtx->cr0 & X86_CR0_NE)) 7551 7547 { 7552 PVM pVM = pVCpu->CTX_SUFF(pVM);7548 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7553 7549 PDISSTATE pDis = &pVCpu->hm.s.DisState; 7554 7550 unsigned cbInstr; … … 7575 7571 * \#VMEXIT. 7576 7572 */ 7577 HMSVM_EXIT_DECL hmR0SvmExitXcptDB(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7573 HMSVM_EXIT_DECL hmR0SvmExitXcptDB(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7578 7574 { 7579 7575 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7595 7591 * handler expects. See AMD spec. 15.12.2 "#DB (Debug)". 7596 7592 */ 7597 PVM pVM = pVCpu->CTX_SUFF(pVM);7593 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7598 7594 PSVMVMCB pVmcb = pVCpu->hm.s.svm.pVmcb; 7599 7595 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 7633 7629 * Conditional \#VMEXIT. 7634 7630 */ 7635 HMSVM_EXIT_DECL hmR0SvmExitXcptAC(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7631 HMSVM_EXIT_DECL hmR0SvmExitXcptAC(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7636 7632 { 7637 7633 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7654 7650 * Conditional \#VMEXIT. 7655 7651 */ 7656 HMSVM_EXIT_DECL hmR0SvmExitXcptBP(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7652 HMSVM_EXIT_DECL hmR0SvmExitXcptBP(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7657 7653 { 7658 7654 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7683 7679 * @sa hmR0VmxHandleMesaDrvGp 7684 7680 */ 7685 static int hmR0SvmHandleMesaDrvGp(PVMCPU pVCpu, PCPUMCTX pCtx, PCSVMVMCB pVmcb)7681 static int hmR0SvmHandleMesaDrvGp(PVMCPUCC pVCpu, PCPUMCTX pCtx, PCSVMVMCB pVmcb) 7686 7682 { 7687 7683 HMSVM_CPUMCTX_IMPORT_STATE(pVCpu, CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_GPRS_MASK); … … 7706 7702 * @sa hmR0VmxIsMesaDrvGp 7707 7703 */ 7708 DECLINLINE(bool) hmR0SvmIsMesaDrvGp(PVMCPU pVCpu, PCPUMCTX pCtx, PCSVMVMCB pVmcb)7704 DECLINLINE(bool) hmR0SvmIsMesaDrvGp(PVMCPUCC pVCpu, PCPUMCTX pCtx, PCSVMVMCB pVmcb) 7709 7705 { 7710 7706 /* Check magic and port. */ … … 7754 7750 * Conditional \#VMEXIT. 7755 7751 */ 7756 HMSVM_EXIT_DECL hmR0SvmExitXcptGP(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7752 HMSVM_EXIT_DECL hmR0SvmExitXcptGP(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7757 7753 { 7758 7754 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7785 7781 * \#VMEXIT handler for generic exceptions. Conditional \#VMEXIT. 7786 7782 */ 7787 HMSVM_EXIT_DECL hmR0SvmExitXcptGeneric(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7783 HMSVM_EXIT_DECL hmR0SvmExitXcptGeneric(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7788 7784 { 7789 7785 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7853 7849 * \#VMEXIT handler for CLGI (SVM_EXIT_CLGI). Conditional \#VMEXIT. 7854 7850 */ 7855 HMSVM_EXIT_DECL hmR0SvmExitClgi(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7851 HMSVM_EXIT_DECL hmR0SvmExitClgi(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7856 7852 { 7857 7853 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7891 7887 * \#VMEXIT handler for STGI (SVM_EXIT_STGI). Conditional \#VMEXIT. 7892 7888 */ 7893 HMSVM_EXIT_DECL hmR0SvmExitStgi(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7889 HMSVM_EXIT_DECL hmR0SvmExitStgi(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7894 7890 { 7895 7891 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7933 7929 * \#VMEXIT handler for VMLOAD (SVM_EXIT_VMLOAD). Conditional \#VMEXIT. 7934 7930 */ 7935 HMSVM_EXIT_DECL hmR0SvmExitVmload(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7931 HMSVM_EXIT_DECL hmR0SvmExitVmload(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7936 7932 { 7937 7933 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 7978 7974 * \#VMEXIT handler for VMSAVE (SVM_EXIT_VMSAVE). Conditional \#VMEXIT. 7979 7975 */ 7980 HMSVM_EXIT_DECL hmR0SvmExitVmsave(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)7976 HMSVM_EXIT_DECL hmR0SvmExitVmsave(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 7981 7977 { 7982 7978 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 8012 8008 * \#VMEXIT handler for INVLPGA (SVM_EXIT_INVLPGA). Conditional \#VMEXIT. 8013 8009 */ 8014 HMSVM_EXIT_DECL hmR0SvmExitInvlpga(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)8010 HMSVM_EXIT_DECL hmR0SvmExitInvlpga(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 8015 8011 { 8016 8012 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 8044 8040 * \#VMEXIT handler for STGI (SVM_EXIT_VMRUN). Conditional \#VMEXIT. 8045 8041 */ 8046 HMSVM_EXIT_DECL hmR0SvmExitVmrun(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)8042 HMSVM_EXIT_DECL hmR0SvmExitVmrun(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 8047 8043 { 8048 8044 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 8089 8085 * Unconditional \#VMEXIT. 8090 8086 */ 8091 HMSVM_EXIT_DECL hmR0SvmNestedExitXcptDB(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)8087 HMSVM_EXIT_DECL hmR0SvmNestedExitXcptDB(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 8092 8088 { 8093 8089 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); … … 8109 8105 * Conditional \#VMEXIT. 8110 8106 */ 8111 HMSVM_EXIT_DECL hmR0SvmNestedExitXcptBP(PVMCPU pVCpu, PSVMTRANSIENT pSvmTransient)8107 HMSVM_EXIT_DECL hmR0SvmNestedExitXcptBP(PVMCPUCC pVCpu, PSVMTRANSIENT pSvmTransient) 8112 8108 { 8113 8109 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient); -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.h
r80052 r80274 39 39 VMMR0DECL(int) SVMR0GlobalInit(void); 40 40 VMMR0DECL(void) SVMR0GlobalTerm(void); 41 VMMR0DECL(int) SVMR0Enter(PVMCPU pVCpu);42 VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);43 VMMR0DECL(int) SVMR0EnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvPageCpu, RTHCPHYS HCPhysCpuPage,41 VMMR0DECL(int) SVMR0Enter(PVMCPUCC pVCpu); 42 VMMR0DECL(void) SVMR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit); 43 VMMR0DECL(int) SVMR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvPageCpu, RTHCPHYS HCPhysCpuPage, 44 44 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs); 45 45 VMMR0DECL(int) SVMR0DisableCpu(void *pvPageCpu, RTHCPHYS pPageCpuPhys); 46 VMMR0DECL(int) SVMR0InitVM(PVM pVM);47 VMMR0DECL(int) SVMR0TermVM(PVM pVM);48 VMMR0DECL(int) SVMR0SetupVM(PVM pVM);49 VMMR0DECL(VBOXSTRICTRC) SVMR0RunGuestCode(PVMCPU pVCpu);50 VMMR0DECL(int) SVMR0ExportHostState(PVMCPU pVCpu);51 VMMR0DECL(int) SVMR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat);52 VMMR0DECL(int) SVMR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt);46 VMMR0DECL(int) SVMR0InitVM(PVMCC pVM); 47 VMMR0DECL(int) SVMR0TermVM(PVMCC pVM); 48 VMMR0DECL(int) SVMR0SetupVM(PVMCC pVM); 49 VMMR0DECL(VBOXSTRICTRC) SVMR0RunGuestCode(PVMCPUCC pVCpu); 50 VMMR0DECL(int) SVMR0ExportHostState(PVMCPUCC pVCpu); 51 VMMR0DECL(int) SVMR0ImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat); 52 VMMR0DECL(int) SVMR0InvalidatePage(PVMCPUCC pVCpu, RTGCPTR GCVirt); 53 53 54 54 /** … … 62 62 * @param pVCpu The cross context virtual CPU structure. (Not used.) 63 63 */ 64 DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPUpVCpu);64 DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu); 65 65 66 66 … … 75 75 * @param pVCpu The cross context virtual CPU structure. (Not used.) 76 76 */ 77 DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPUpVCpu);77 DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu); 78 78 79 79 /** -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r80273 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_HM 23 24 #define VMCPU_INCL_CPUM_GST_CTX … … 40 41 #endif 41 42 #include "HMInternal.h" 42 #include <VBox/vmm/vm .h>43 #include <VBox/vmm/vmcc.h> 43 44 #include <VBox/vmm/hmvmxinline.h> 44 45 #include "HMVMXR0.h" … … 292 293 */ 293 294 #ifndef HMVMX_USE_FUNCTION_TABLE 294 typedef VBOXSTRICTRC FNVMXEXITHANDLER(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient);295 typedef VBOXSTRICTRC FNVMXEXITHANDLER(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient); 295 296 #else 296 typedef DECLCALLBACK(VBOXSTRICTRC) FNVMXEXITHANDLER(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient);297 typedef DECLCALLBACK(VBOXSTRICTRC) FNVMXEXITHANDLER(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient); 297 298 /** Pointer to VM-exit handler. */ 298 299 typedef FNVMXEXITHANDLER *PFNVMXEXITHANDLER; … … 313 314 */ 314 315 #ifndef HMVMX_USE_FUNCTION_TABLE 315 typedef int FNVMXEXITHANDLERNSRC(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient);316 typedef int FNVMXEXITHANDLERNSRC(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient); 316 317 #else 317 318 typedef FNVMXEXITHANDLER FNVMXEXITHANDLERNSRC; … … 323 324 *********************************************************************************************************************************/ 324 325 #ifndef HMVMX_USE_FUNCTION_TABLE 325 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExit(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient);326 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExit(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient); 326 327 # define HMVMX_EXIT_DECL DECLINLINE(VBOXSTRICTRC) 327 328 # define HMVMX_EXIT_NSRC_DECL DECLINLINE(int) … … 331 332 #endif 332 333 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 333 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExitNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient);334 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExitNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient); 334 335 #endif 335 336 336 static int hmR0VmxImportGuestState(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint64_t fWhat);337 static int hmR0VmxImportGuestState(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint64_t fWhat); 337 338 338 339 /** @name VM-exit handler prototypes. … … 844 845 * @param pVCpu The cross context virtual CPU structure. 845 846 */ 846 DECL_FORCE_INLINE(uint64_t) hmR0VmxGetFixedCr0Mask(PCVMCPU pVCpu)847 DECL_FORCE_INLINE(uint64_t) hmR0VmxGetFixedCr0Mask(PCVMCPUCC pVCpu) 847 848 { 848 849 /* … … 853 854 * enmGuestMode to be in-sync with the current mode. See @bugref{6398} 854 855 * and @bugref{6944}. */ 855 PVM pVM = pVCpu->CTX_SUFF(pVM);856 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 856 857 return ( X86_CR0_PE 857 858 | X86_CR0_NE … … 873 874 * @param pVCpu The cross context virtual CPU structure. 874 875 */ 875 DECL_FORCE_INLINE(uint64_t) hmR0VmxGetFixedCr4Mask(PCVMCPU pVCpu)876 DECL_FORCE_INLINE(uint64_t) hmR0VmxGetFixedCr4Mask(PCVMCPUCC pVCpu) 876 877 { 877 878 /* … … 881 882 * these bits and handle it depending on whether we expose them to the guest. 882 883 */ 883 PVM pVM = pVCpu->CTX_SUFF(pVM);884 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 884 885 bool const fXSaveRstor = pVM->cpum.ro.HostFeatures.fXSaveRstor; 885 886 bool const fPcid = pVM->cpum.ro.HostFeatures.fPcid; … … 936 937 * controls if the guest hypervisor has set any one of them. 937 938 */ 938 static void hmR0VmxRemoveProcCtlsVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uProcCtls)939 static void hmR0VmxRemoveProcCtlsVmcs(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uProcCtls) 939 940 { 940 941 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; … … 1022 1023 * @param uXcptMask The exception(s) to remove. 1023 1024 */ 1024 static int hmR0VmxRemoveXcptInterceptMask(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uXcptMask)1025 static int hmR0VmxRemoveXcptInterceptMask(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uXcptMask) 1025 1026 { 1026 1027 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; … … 1084 1085 * @param uXcpt The exception to remove. 1085 1086 */ 1086 static int hmR0VmxRemoveXcptIntercept(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint8_t uXcpt)1087 static int hmR0VmxRemoveXcptIntercept(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint8_t uXcpt) 1087 1088 { 1088 1089 return hmR0VmxRemoveXcptInterceptMask(pVCpu, pVmxTransient, RT_BIT(uXcpt)); … … 1234 1235 * true) or guest VMCS (pass false). 1235 1236 */ 1236 static int hmR0VmxSwitchToGstOrNstGstVmcs(PVMCPU pVCpu, bool fSwitchToNstGstVmcs)1237 static int hmR0VmxSwitchToGstOrNstGstVmcs(PVMCPUCC pVCpu, bool fSwitchToNstGstVmcs) 1237 1238 { 1238 1239 /* Ensure we have synced everything from the guest-CPU context to the VMCS before switching. */ … … 1307 1308 * @param rc The error code. 1308 1309 */ 1309 static void hmR0VmxUpdateErrorRecord(PVMCPU pVCpu, int rc)1310 static void hmR0VmxUpdateErrorRecord(PVMCPUCC pVCpu, int rc) 1310 1311 { 1311 1312 if ( rc == VERR_VMX_INVALID_VMCS_FIELD … … 1550 1551 * @param pvCpuPage Pointer to the VMXON region. 1551 1552 */ 1552 static int hmR0VmxEnterRootMode(PVM pVM, RTHCPHYS HCPhysCpuPage, void *pvCpuPage)1553 static int hmR0VmxEnterRootMode(PVMCC pVM, RTHCPHYS HCPhysCpuPage, void *pvCpuPage) 1553 1554 { 1554 1555 Assert(HCPhysCpuPage && HCPhysCpuPage != NIL_RTHCPHYS); … … 1698 1699 * @param pVmcsInfo The VMCS info. object. 1699 1700 */ 1700 static void hmR0VmxFreeVmcsInfo(PVM pVM, PVMXVMCSINFO pVmcsInfo)1701 static void hmR0VmxFreeVmcsInfo(PVMCC pVM, PVMXVMCSINFO pVmcsInfo) 1701 1702 { 1702 1703 hmR0VmxPageFree(&pVmcsInfo->hMemObjVmcs, &pVmcsInfo->pvVmcs, &pVmcsInfo->HCPhysVmcs); … … 1726 1727 * @param fIsNstGstVmcs Whether this is a nested-guest VMCS. 1727 1728 */ 1728 static int hmR0VmxAllocVmcsInfo(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs)1729 { 1730 PVM pVM = pVCpu->CTX_SUFF(pVM);1729 static int hmR0VmxAllocVmcsInfo(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs) 1730 { 1731 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1731 1732 1732 1733 /* Allocate the guest VM control structure (VMCS). */ … … 1828 1829 * @param pVM The cross context VM structure. 1829 1830 */ 1830 static void hmR0VmxStructsFree(PVM pVM)1831 static void hmR0VmxStructsFree(PVMCC pVM) 1831 1832 { 1832 1833 #ifdef VBOX_WITH_CRASHDUMP_MAGIC … … 1847 1848 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 1848 1849 { 1849 PVMCPU pVCpu = &pVM->aCpus[idCpu];1850 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1850 1851 PVMXVMCSINFO pVmcsInfo = &pVCpu->hm.s.vmx.VmcsInfo; 1851 1852 hmR0VmxFreeVmcsInfo(pVM, pVmcsInfo); … … 1867 1868 * @param pVM The cross context VM structure. 1868 1869 */ 1869 static int hmR0VmxStructsAlloc(PVM pVM)1870 static int hmR0VmxStructsAlloc(PVMCC pVM) 1870 1871 { 1871 1872 /* … … 1880 1881 else 1881 1882 { 1882 pVM->aCpus[0].hm.s.u32HMError = VMX_UFC_INVALID_VMCS_SIZE;1883 1883 VMCC_GET_CPU_0(pVM)->hm.s.u32HMError = VMX_UFC_INVALID_VMCS_SIZE; 1884 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 1884 1885 } 1885 1886 … … 1899 1900 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 1900 1901 { 1901 PVMCPU pVCpu = &pVM->aCpus[idCpu];1902 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1902 1903 hmR0VmxInitVmcsInfo(&pVCpu->hm.s.vmx.VmcsInfo); 1903 1904 hmR0VmxInitVmcsInfo(&pVCpu->hm.s.vmx.VmcsInfoNstGst); … … 1968 1969 { 1969 1970 /* Allocate the guest VMCS structures. */ 1970 PVMCPU pVCpu = &pVM->aCpus[idCpu];1971 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1971 1972 rc = hmR0VmxAllocVmcsInfo(pVCpu, &pVCpu->hm.s.vmx.VmcsInfo, false /* fIsNstGstVmcs */); 1972 1973 if (RT_SUCCESS(rc)) … … 2033 2034 * @remarks Can be called with interrupts disabled. 2034 2035 */ 2035 static void hmR0VmxSetMsrPermission(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs, uint32_t idMsr, uint32_t fMsrpm)2036 static void hmR0VmxSetMsrPermission(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs, uint32_t idMsr, uint32_t fMsrpm) 2036 2037 { 2037 2038 uint8_t *pbMsrBitmap = (uint8_t *)pVmcsInfo->pvMsrBitmap; … … 2121 2122 * @param cMsrs The number of MSRs. 2122 2123 */ 2123 static int hmR0VmxSetAutoLoadStoreMsrCount(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint32_t cMsrs)2124 static int hmR0VmxSetAutoLoadStoreMsrCount(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint32_t cMsrs) 2124 2125 { 2125 2126 /* Shouldn't ever happen but there -is- a number. We're well within the recommended 512. */ … … 2161 2162 * necessary. 2162 2163 */ 2163 static int hmR0VmxAddAutoLoadStoreMsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr, uint64_t uGuestMsrValue,2164 static int hmR0VmxAddAutoLoadStoreMsr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr, uint64_t uGuestMsrValue, 2164 2165 bool fSetReadWrite, bool fUpdateHostMsr) 2165 2166 { … … 2251 2252 * @param idMsr The MSR. 2252 2253 */ 2253 static int hmR0VmxRemoveAutoLoadStoreMsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr)2254 static int hmR0VmxRemoveAutoLoadStoreMsr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t idMsr) 2254 2255 { 2255 2256 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; … … 2345 2346 * @remarks No-long-jump zone!!! 2346 2347 */ 2347 static void hmR0VmxUpdateAutoLoadHostMsrs(PCVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)2348 static void hmR0VmxUpdateAutoLoadHostMsrs(PCVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 2348 2349 { 2349 2350 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2376 2377 * @remarks No-long-jump zone!!! 2377 2378 */ 2378 static void hmR0VmxLazySaveHostMsrs(PVMCPU pVCpu)2379 static void hmR0VmxLazySaveHostMsrs(PVMCPUCC pVCpu) 2379 2380 { 2380 2381 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2406 2407 * @param idMsr The MSR to check. 2407 2408 */ 2408 static bool hmR0VmxIsLazyGuestMsr(PCVMCPU pVCpu, uint32_t idMsr)2409 static bool hmR0VmxIsLazyGuestMsr(PCVMCPUCC pVCpu, uint32_t idMsr) 2409 2410 { 2410 2411 if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests) … … 2435 2436 * @remarks No-long-jump zone!!! 2436 2437 */ 2437 static void hmR0VmxLazyLoadGuestMsrs(PVMCPU pVCpu)2438 static void hmR0VmxLazyLoadGuestMsrs(PVMCPUCC pVCpu) 2438 2439 { 2439 2440 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2489 2490 * context by hmR0VmxImportGuestState()!!! 2490 2491 */ 2491 static void hmR0VmxLazyRestoreHostMsrs(PVMCPU pVCpu)2492 static void hmR0VmxLazyRestoreHostMsrs(PVMCPUCC pVCpu) 2492 2493 { 2493 2494 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2522 2523 * @param fIsNstGstVmcs Whether this is a nested-guest VMCS. 2523 2524 */ 2524 static int hmR0VmxCheckVmcsCtls(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs)2525 static int hmR0VmxCheckVmcsCtls(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs) 2525 2526 { 2526 2527 const char * const pcszVmcs = fIsNstGstVmcs ? "Nested-guest VMCS" : "VMCS"; … … 2592 2593 * @param pVmcsInfo The VMCS info. object. 2593 2594 */ 2594 static void hmR0VmxCheckHostEferMsr(PCVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)2595 static void hmR0VmxCheckHostEferMsr(PCVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 2595 2596 { 2596 2597 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2620 2621 * @param fIsNstGstVmcs Whether this is a nested-guest VMCS. 2621 2622 */ 2622 static void hmR0VmxCheckAutoLoadStoreMsrs(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs)2623 static void hmR0VmxCheckAutoLoadStoreMsrs(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs) 2623 2624 { 2624 2625 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 2735 2736 * @remarks Can be called with interrupts disabled. 2736 2737 */ 2737 static void hmR0VmxFlushEpt(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo, VMXTLBFLUSHEPT enmTlbFlush)2738 static void hmR0VmxFlushEpt(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo, VMXTLBFLUSHEPT enmTlbFlush) 2738 2739 { 2739 2740 uint64_t au64Descriptor[2]; … … 2769 2770 * @remarks Can be called with interrupts disabled. 2770 2771 */ 2771 static void hmR0VmxFlushVpid(PVMCPU pVCpu, VMXTLBFLUSHVPID enmTlbFlush, RTGCPTR GCPtr)2772 static void hmR0VmxFlushVpid(PVMCPUCC pVCpu, VMXTLBFLUSHVPID enmTlbFlush, RTGCPTR GCPtr) 2772 2773 { 2773 2774 Assert(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.fVpid); … … 2807 2808 * @param GCVirt Guest virtual address of the page to invalidate. 2808 2809 */ 2809 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt)2810 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPUCC pVCpu, RTGCPTR GCVirt) 2810 2811 { 2811 2812 AssertPtr(pVCpu); … … 2821 2822 * as this function maybe called in a loop with individual addresses. 2822 2823 */ 2823 PVM pVM = pVCpu->CTX_SUFF(pVM);2824 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 2824 2825 if (pVM->hm.s.vmx.fVpid) 2825 2826 { … … 2850 2851 * @remarks Called with interrupts disabled. 2851 2852 */ 2852 static void hmR0VmxFlushTaggedTlbNone(PHMPHYSCPU pHostCpu, PVMCPU pVCpu)2853 static void hmR0VmxFlushTaggedTlbNone(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu) 2853 2854 { 2854 2855 AssertPtr(pVCpu); … … 2878 2879 * @remarks Called with interrupts disabled. 2879 2880 */ 2880 static void hmR0VmxFlushTaggedTlbBoth(PHMPHYSCPU pHostCpu, PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)2881 static void hmR0VmxFlushTaggedTlbBoth(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 2881 2882 { 2882 2883 #ifdef VBOX_WITH_STATISTICS … … 2896 2897 Assert(pHostCpu->idCpu != NIL_RTCPUID); 2897 2898 2898 PVM pVM = pVCpu->CTX_SUFF(pVM);2899 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 2899 2900 AssertMsg(pVM->hm.s.fNestedPaging && pVM->hm.s.vmx.fVpid, 2900 2901 ("hmR0VmxFlushTaggedTlbBoth cannot be invoked unless NestedPaging & VPID are enabled." … … 2991 2992 * @remarks Called with interrupts disabled. 2992 2993 */ 2993 static void hmR0VmxFlushTaggedTlbEpt(PHMPHYSCPU pHostCpu, PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)2994 static void hmR0VmxFlushTaggedTlbEpt(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 2994 2995 { 2995 2996 AssertPtr(pVCpu); … … 3044 3045 * @remarks Called with interrupts disabled. 3045 3046 */ 3046 static void hmR0VmxFlushTaggedTlbVpid(PHMPHYSCPU pHostCpu, PVMCPU pVCpu)3047 static void hmR0VmxFlushTaggedTlbVpid(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu) 3047 3048 { 3048 3049 AssertPtr(pVCpu); … … 3086 3087 } 3087 3088 3088 PVM pVM = pVCpu->CTX_SUFF(pVM);3089 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3089 3090 pVCpu->hm.s.idLastCpu = pHostCpu->idCpu; 3090 3091 if (pVCpu->hm.s.fForceTLBFlush) … … 3140 3141 * @remarks Called with interrupts disabled. 3141 3142 */ 3142 static void hmR0VmxFlushTaggedTlb(PHMPHYSCPU pHostCpu, PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3143 static void hmR0VmxFlushTaggedTlb(PHMPHYSCPU pHostCpu, PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3143 3144 { 3144 3145 #ifdef HMVMX_ALWAYS_FLUSH_TLB 3145 3146 VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH); 3146 3147 #endif 3147 PVM pVM = pVCpu->CTX_SUFF(pVM);3148 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3148 3149 switch (pVM->hm.s.vmx.enmTlbFlushType) 3149 3150 { … … 3167 3168 * @param pVM The cross context VM structure. 3168 3169 */ 3169 static int hmR0VmxSetupTaggedTlb(PVM pVM)3170 static int hmR0VmxSetupTaggedTlb(PVMCC pVM) 3170 3171 { 3171 3172 /* … … 3186 3187 /* Shouldn't happen. EPT is supported but no suitable flush-types supported. */ 3187 3188 pVM->hm.s.vmx.enmTlbFlushEpt = VMXTLBFLUSHEPT_NOT_SUPPORTED; 3188 pVM->aCpus[0].hm.s.u32HMError = VMX_UFC_EPT_FLUSH_TYPE_UNSUPPORTED;3189 VMCC_GET_CPU_0(pVM)->hm.s.u32HMError = VMX_UFC_EPT_FLUSH_TYPE_UNSUPPORTED; 3189 3190 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 3190 3191 } … … 3194 3195 { 3195 3196 pVM->hm.s.vmx.enmTlbFlushEpt = VMXTLBFLUSHEPT_NOT_SUPPORTED; 3196 pVM->aCpus[0].hm.s.u32HMError = VMX_UFC_EPT_MEM_TYPE_NOT_WB;3197 VMCC_GET_CPU_0(pVM)->hm.s.u32HMError = VMX_UFC_EPT_MEM_TYPE_NOT_WB; 3197 3198 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 3198 3199 } … … 3202 3203 { 3203 3204 pVM->hm.s.vmx.enmTlbFlushEpt = VMXTLBFLUSHEPT_NOT_SUPPORTED; 3204 pVM->aCpus[0].hm.s.u32HMError = VMX_UFC_EPT_PAGE_WALK_LENGTH_UNSUPPORTED;3205 VMCC_GET_CPU_0(pVM)->hm.s.u32HMError = VMX_UFC_EPT_PAGE_WALK_LENGTH_UNSUPPORTED; 3205 3206 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 3206 3207 } … … 3210 3211 /* Shouldn't happen. EPT is supported but INVEPT instruction is not supported. */ 3211 3212 pVM->hm.s.vmx.enmTlbFlushEpt = VMXTLBFLUSHEPT_NOT_SUPPORTED; 3212 pVM->aCpus[0].hm.s.u32HMError = VMX_UFC_EPT_INVEPT_UNAVAILABLE;3213 VMCC_GET_CPU_0(pVM)->hm.s.u32HMError = VMX_UFC_EPT_INVEPT_UNAVAILABLE; 3213 3214 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; 3214 3215 } … … 3271 3272 * @param pVM The cross context VM structure. 3272 3273 */ 3273 static int hmR0VmxSetupShadowVmcsFieldsArrays(PVM pVM)3274 static int hmR0VmxSetupShadowVmcsFieldsArrays(PVMCC pVM) 3274 3275 { 3275 3276 /* … … 3337 3338 * @param pVM The cross context VM structure. 3338 3339 */ 3339 static void hmR0VmxSetupVmreadVmwriteBitmaps(PVM pVM)3340 static void hmR0VmxSetupVmreadVmwriteBitmaps(PVMCC pVM) 3340 3341 { 3341 3342 /* … … 3420 3421 * @param pVCpu The cross context virtual CPU structure. 3421 3422 */ 3422 DECLINLINE(void) hmR0VmxSetupVmcsApicAccessAddr(PVMCPU pVCpu)3423 DECLINLINE(void) hmR0VmxSetupVmcsApicAccessAddr(PVMCPUCC pVCpu) 3423 3424 { 3424 3425 RTHCPHYS const HCPhysApicAccess = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.HCPhysApicAccess; … … 3436 3437 * @param pVCpu The cross context virtual CPU structure. 3437 3438 */ 3438 DECLINLINE(void) hmR0VmxSetupVmcsVmreadBitmapAddr(PVMCPU pVCpu)3439 DECLINLINE(void) hmR0VmxSetupVmcsVmreadBitmapAddr(PVMCPUCC pVCpu) 3439 3440 { 3440 3441 RTHCPHYS const HCPhysVmreadBitmap = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.HCPhysVmreadBitmap; … … 3451 3452 * @param pVCpu The cross context virtual CPU structure. 3452 3453 */ 3453 DECLINLINE(void) hmR0VmxSetupVmcsVmwriteBitmapAddr(PVMCPU pVCpu)3454 DECLINLINE(void) hmR0VmxSetupVmcsVmwriteBitmapAddr(PVMCPUCC pVCpu) 3454 3455 { 3455 3456 RTHCPHYS const HCPhysVmwriteBitmap = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.HCPhysVmwriteBitmap; … … 3496 3497 * @param pVmcsInfo The VMCS info. object. 3497 3498 */ 3498 static void hmR0VmxSetupVmcsMsrPermissions(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3499 static void hmR0VmxSetupVmcsMsrPermissions(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3499 3500 { 3500 3501 Assert(pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS); … … 3504 3505 * VM-exits; they are loaded/stored automatically using fields in the VMCS. 3505 3506 */ 3506 PVM pVM = pVCpu->CTX_SUFF(pVM);3507 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3507 3508 hmR0VmxSetMsrPermission(pVCpu, pVmcsInfo, false, MSR_IA32_SYSENTER_CS, VMXMSRPM_ALLOW_RD_WR); 3508 3509 hmR0VmxSetMsrPermission(pVCpu, pVmcsInfo, false, MSR_IA32_SYSENTER_ESP, VMXMSRPM_ALLOW_RD_WR); … … 3557 3558 * @param pVmcsInfo The VMCS info. object. 3558 3559 */ 3559 static int hmR0VmxSetupVmcsPinCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3560 { 3561 PVM pVM = pVCpu->CTX_SUFF(pVM);3560 static int hmR0VmxSetupVmcsPinCtls(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3561 { 3562 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3562 3563 uint32_t fVal = pVM->hm.s.vmx.Msrs.PinCtls.n.allowed0; /* Bits set here must always be set. */ 3563 3564 uint32_t const fZap = pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1; /* Bits cleared here must always be cleared. */ … … 3610 3611 * @param pVmcsInfo The VMCS info. object. 3611 3612 */ 3612 static int hmR0VmxSetupVmcsProcCtls2(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3613 { 3614 PVM pVM = pVCpu->CTX_SUFF(pVM);3613 static int hmR0VmxSetupVmcsProcCtls2(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3614 { 3615 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3615 3616 uint32_t fVal = pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed0; /* Bits set here must be set in the VMCS. */ 3616 3617 uint32_t const fZap = pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1; /* Bits cleared here must be cleared in the VMCS. */ … … 3702 3703 * @param pVmcsInfo The VMCS info. object. 3703 3704 */ 3704 static int hmR0VmxSetupVmcsProcCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3705 { 3706 PVM pVM = pVCpu->CTX_SUFF(pVM);3705 static int hmR0VmxSetupVmcsProcCtls(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3706 { 3707 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3707 3708 3708 3709 uint32_t fVal = pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed0; /* Bits set here must be set in the VMCS. */ … … 3809 3810 * @param pVmcsInfo The VMCS info. object. 3810 3811 */ 3811 static int hmR0VmxSetupVmcsMiscCtls(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3812 static int hmR0VmxSetupVmcsMiscCtls(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3812 3813 { 3813 3814 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX … … 3852 3853 * @param pVmcsInfo The VMCS info. object. 3853 3854 */ 3854 static void hmR0VmxSetupVmcsXcptBitmap(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3855 static void hmR0VmxSetupVmcsXcptBitmap(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3855 3856 { 3856 3857 /* … … 3884 3885 * @param pVmcsInfo The VMCS info. object. 3885 3886 */ 3886 static int hmR0VmxSetupVmcsCtlsNested(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)3887 static int hmR0VmxSetupVmcsCtlsNested(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 3887 3888 { 3888 3889 Assert(pVmcsInfo->u64VmcsLinkPtr == NIL_RTHCPHYS); … … 3913 3914 * @param fIsNstGstVmcs Whether this is a nested-guest VMCS. 3914 3915 */ 3915 static int hmR0VmxSetupVmcs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs)3916 static int hmR0VmxSetupVmcs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, bool fIsNstGstVmcs) 3916 3917 { 3917 3918 Assert(pVmcsInfo->pvVmcs); … … 3919 3920 3920 3921 /* Set the CPU specified revision identifier at the beginning of the VMCS structure. */ 3921 PVM pVM = pVCpu->CTX_SUFF(pVM);3922 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 3922 3923 *(uint32_t *)pVmcsInfo->pvVmcs = RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_ID); 3923 3924 const char * const pszVmcs = fIsNstGstVmcs ? "nested-guest VMCS" : "guest VMCS"; … … 4057 4058 * @param pHwvirtMsrs Pointer to the hardware-virtualization MSRs. 4058 4059 */ 4059 VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, bool fEnabledByHost,4060 VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, bool fEnabledByHost, 4060 4061 PCSUPHWVIRTMSRS pHwvirtMsrs) 4061 4062 { … … 4117 4118 * @param pVM The cross context VM structure. 4118 4119 */ 4119 VMMR0DECL(int) VMXR0InitVM(PVM pVM)4120 VMMR0DECL(int) VMXR0InitVM(PVMCC pVM) 4120 4121 { 4121 4122 AssertPtr(pVM); … … 4139 4140 * @param pVM The cross context VM structure. 4140 4141 */ 4141 VMMR0DECL(int) VMXR0TermVM(PVM pVM)4142 VMMR0DECL(int) VMXR0TermVM(PVMCC pVM) 4142 4143 { 4143 4144 AssertPtr(pVM); … … 4163 4164 * @param pVM The cross context VM structure. 4164 4165 */ 4165 VMMR0DECL(int) VMXR0SetupVM(PVM pVM)4166 VMMR0DECL(int) VMXR0SetupVM(PVMCC pVM) 4166 4167 { 4167 4168 AssertPtr(pVM); … … 4222 4223 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 4223 4224 { 4224 PVMCPU pVCpu = &pVM->aCpus[idCpu];4225 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 4225 4226 Log4Func(("pVCpu=%p idCpu=%RU32\n", pVCpu, pVCpu->idCpu)); 4226 4227 … … 4272 4273 * @param pVCpu The cross context virtual CPU structure. 4273 4274 */ 4274 static int hmR0VmxExportHostSegmentRegs(PVMCPU pVCpu)4275 static int hmR0VmxExportHostSegmentRegs(PVMCPUCC pVCpu) 4275 4276 { 4276 4277 /** … … 4414 4415 * [2] See Intel spec. 7.2.3 "TSS Descriptor in 64-bit mode". 4415 4416 */ 4416 PVM pVM = pVCpu->CTX_SUFF(pVM);4417 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4417 4418 Assert(pDesc->System.u4Type == 11); 4418 4419 if ( pDesc->System.u16LimitLow != 0x67 … … 4476 4477 * @remarks No-long-jump zone!!! 4477 4478 */ 4478 static void hmR0VmxExportHostMsrs(PVMCPU pVCpu)4479 static void hmR0VmxExportHostMsrs(PVMCPUCC pVCpu) 4479 4480 { 4480 4481 AssertPtr(pVCpu); … … 4499 4500 * done as part of auto-load/store MSR area in the VMCS, see hmR0VmxExportGuestMsrs(). 4500 4501 */ 4501 PVM pVM = pVCpu->CTX_SUFF(pVM);4502 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4502 4503 if (pVM->hm.s.vmx.fSupportsVmcsEfer) 4503 4504 { … … 4523 4524 * @remarks No-long-jump zone!!! 4524 4525 */ 4525 static bool hmR0VmxShouldSwapEferMsr(PCVMCPU pVCpu)4526 static bool hmR0VmxShouldSwapEferMsr(PCVMCPUCC pVCpu) 4526 4527 { 4527 4528 #ifdef HMVMX_ALWAYS_SWAP_EFER … … 4530 4531 #else 4531 4532 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 4532 PVM pVM = pVCpu->CTX_SUFF(pVM);4533 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4533 4534 uint64_t const u64HostEfer = pVM->hm.s.vmx.u64HostMsrEfer; 4534 4535 uint64_t const u64GuestEfer = pCtx->msrEFER; … … 4580 4581 * @remarks No-long-jump zone!!! 4581 4582 */ 4582 static int hmR0VmxExportGuestEntryExitCtls(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)4583 static int hmR0VmxExportGuestEntryExitCtls(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 4583 4584 { 4584 4585 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_VMX_ENTRY_EXIT_CTLS) 4585 4586 { 4586 PVM pVM = pVCpu->CTX_SUFF(pVM);4587 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4587 4588 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 4588 4589 … … 4764 4765 * @remarks No-long-jump zone!!! 4765 4766 */ 4766 static int hmR0VmxExportGuestApicTpr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)4767 static int hmR0VmxExportGuestApicTpr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 4767 4768 { 4768 4769 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_APIC_TPR) … … 4825 4826 * @remarks No-long-jump zone!!! 4826 4827 */ 4827 static uint32_t hmR0VmxGetGuestIntrState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)4828 static uint32_t hmR0VmxGetGuestIntrState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 4828 4829 { 4829 4830 /* … … 4882 4883 * @remarks No-long-jump zone!!! 4883 4884 */ 4884 static int hmR0VmxExportGuestXcptIntercepts(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)4885 static int hmR0VmxExportGuestXcptIntercepts(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 4885 4886 { 4886 4887 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_VMX_XCPT_INTERCEPTS) … … 4908 4909 * @remarks No-long-jump zone!!! 4909 4910 */ 4910 static int hmR0VmxExportGuestRip(PVMCPU pVCpu)4911 static int hmR0VmxExportGuestRip(PVMCPUCC pVCpu) 4911 4912 { 4912 4913 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_RIP) … … 4932 4933 * @remarks No-long-jump zone!!! 4933 4934 */ 4934 static int hmR0VmxExportGuestRsp(PVMCPU pVCpu)4935 static int hmR0VmxExportGuestRsp(PVMCPUCC pVCpu) 4935 4936 { 4936 4937 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_RSP) … … 4957 4958 * @remarks No-long-jump zone!!! 4958 4959 */ 4959 static int hmR0VmxExportGuestRflags(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)4960 static int hmR0VmxExportGuestRflags(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 4960 4961 { 4961 4962 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_RFLAGS) … … 5023 5024 * @remarks No-long-jump zone!!! 5024 5025 */ 5025 static int hmR0VmxCopyNstGstToShadowVmcs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)5026 { 5027 PVM pVM = pVCpu->CTX_SUFF(pVM);5026 static int hmR0VmxCopyNstGstToShadowVmcs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 5027 { 5028 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5028 5029 PCVMXVVMCS pVmcsNstGst = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); 5029 5030 … … 5092 5093 * @remarks Called with interrupts disabled. 5093 5094 */ 5094 static int hmR0VmxCopyShadowToNstGstVmcs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)5095 static int hmR0VmxCopyShadowToNstGstVmcs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 5095 5096 { 5096 5097 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 5097 PVM pVM = pVCpu->CTX_SUFF(pVM);5098 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5098 5099 PVMXVVMCS pVmcsNstGst = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); 5099 5100 … … 5189 5190 * @remarks No-long-jump zone!!! 5190 5191 */ 5191 static int hmR0VmxExportGuestHwvirtState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)5192 static int hmR0VmxExportGuestHwvirtState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 5192 5193 { 5193 5194 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_HWVIRT) … … 5253 5254 * @remarks No-long-jump zone!!! 5254 5255 */ 5255 static int hmR0VmxExportGuestCR0(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)5256 static int hmR0VmxExportGuestCR0(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 5256 5257 { 5257 5258 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_GUEST_CR0) 5258 5259 { 5259 PVM pVM = pVCpu->CTX_SUFF(pVM);5260 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5260 5261 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 5261 5262 … … 5437 5438 * @remarks No-long-jump zone!!! 5438 5439 */ 5439 static VBOXSTRICTRC hmR0VmxExportGuestCR3AndCR4(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)5440 static VBOXSTRICTRC hmR0VmxExportGuestCR3AndCR4(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 5440 5441 { 5441 5442 int rc = VINF_SUCCESS; 5442 PVM pVM = pVCpu->CTX_SUFF(pVM);5443 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5443 5444 5444 5445 /* … … 5674 5675 * @remarks No-long-jump zone!!! 5675 5676 */ 5676 static int hmR0VmxExportSharedDebugState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)5677 static int hmR0VmxExportSharedDebugState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 5677 5678 { 5678 5679 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 5709 5710 { 5710 5711 /* If the CPU supports the monitor trap flag, use it for single stepping in DBGF and avoid intercepting #DB. */ 5711 PVM pVM = pVCpu->CTX_SUFF(pVM);5712 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5712 5713 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_MONITOR_TRAP_FLAG) 5713 5714 { … … 5839 5840 * segments. 5840 5841 */ 5841 static void hmR0VmxValidateSegmentRegs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)5842 static void hmR0VmxValidateSegmentRegs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 5842 5843 { 5843 5844 /* … … 5848 5849 * unusable bit and doesn't change the guest-context value. 5849 5850 */ 5850 PVM pVM = pVCpu->CTX_SUFF(pVM);5851 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 5851 5852 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 5852 5853 hmR0VmxImportGuestState(pVCpu, pVmcsInfo, CPUMCTX_EXTRN_CR0); … … 6018 6019 * @remarks No-long-jump zone!!! 6019 6020 */ 6020 static int hmR0VmxExportGuestSegReg(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo, uint8_t iSegReg, PCCPUMSELREG pSelReg)6021 static int hmR0VmxExportGuestSegReg(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo, uint8_t iSegReg, PCCPUMSELREG pSelReg) 6021 6022 { 6022 6023 Assert(iSegReg < X86_SREG_COUNT); … … 6075 6076 * @remarks No-long-jump zone!!! 6076 6077 */ 6077 static int hmR0VmxExportGuestSegRegsXdtr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)6078 static int hmR0VmxExportGuestSegRegsXdtr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 6078 6079 { 6079 6080 int rc = VERR_INTERNAL_ERROR_5; 6080 PVM pVM = pVCpu->CTX_SUFF(pVM);6081 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6081 6082 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 6082 6083 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; … … 6337 6338 * @remarks No-long-jump zone!!! 6338 6339 */ 6339 static int hmR0VmxExportGuestMsrs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)6340 static int hmR0VmxExportGuestMsrs(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 6340 6341 { 6341 6342 AssertPtr(pVCpu); 6342 6343 AssertPtr(pVmxTransient); 6343 6344 6344 PVM pVM = pVCpu->CTX_SUFF(pVM);6345 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6345 6346 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 6346 6347 … … 6457 6458 * @remarks No-long-jump zone!!! 6458 6459 */ 6459 static int hmR0VmxSelectVMRunHandler(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)6460 static int hmR0VmxSelectVMRunHandler(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 6460 6461 { 6461 6462 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 6491 6492 * @remarks No-long-jump zone!!! 6492 6493 */ 6493 DECLINLINE(int) hmR0VmxRunGuest(PVMCPU pVCpu, PCVMXTRANSIENT pVmxTransient)6494 DECLINLINE(int) hmR0VmxRunGuest(PVMCPUCC pVCpu, PCVMXTRANSIENT pVmxTransient) 6494 6495 { 6495 6496 /* Mark that HM is the keeper of all guest-CPU registers now that we're going to execute guest code. */ … … 6508 6509 PCVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 6509 6510 bool const fResumeVM = RT_BOOL(pVmcsInfo->fVmcsState & VMX_V_VMCS_LAUNCH_STATE_LAUNCHED); 6510 PVM pVM = pVCpu->CTX_SUFF(pVM);6511 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6511 6512 #ifdef VBOX_WITH_KERNEL_USING_XMM 6512 6513 int rc = hmR0VMXStartVMWrapXMM(fResumeVM, pCtx, NULL /*pvUnused*/, pVM, pVCpu, pVmcsInfo->pfnStartVM); … … 6527 6528 * exitReason updated). 6528 6529 */ 6529 static void hmR0VmxReportWorldSwitchError(PVMCPU pVCpu, int rcVMRun, PVMXTRANSIENT pVmxTransient)6530 static void hmR0VmxReportWorldSwitchError(PVMCPUCC pVCpu, int rcVMRun, PVMXTRANSIENT pVmxTransient) 6530 6531 { 6531 6532 Assert(pVCpu); … … 6634 6635 else 6635 6636 { 6636 PVM pVM = pVCpu->CTX_SUFF(pVM);6637 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6637 6638 switch (uVmcsField) 6638 6639 { … … 6730 6731 * @remarks No-long-jump zone!!! 6731 6732 */ 6732 static void hmR0VmxUpdateTscOffsettingAndPreemptTimer(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)6733 static void hmR0VmxUpdateTscOffsettingAndPreemptTimer(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 6733 6734 { 6734 6735 bool fOffsettedTsc; 6735 6736 bool fParavirtTsc; 6736 6737 uint64_t uTscOffset; 6737 PVM pVM = pVCpu->CTX_SUFF(pVM);6738 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 6738 6739 PVMXVMCSINFO pVmcsInfo = hmGetVmxActiveVmcsInfo(pVCpu); 6739 6740 … … 6855 6856 * page-fault. 6856 6857 */ 6857 DECLINLINE(void) hmR0VmxSetPendingEvent(PVMCPU pVCpu, uint32_t u32IntInfo, uint32_t cbInstr, uint32_t u32ErrCode,6858 DECLINLINE(void) hmR0VmxSetPendingEvent(PVMCPUCC pVCpu, uint32_t u32IntInfo, uint32_t cbInstr, uint32_t u32ErrCode, 6858 6859 RTGCUINTPTR GCPtrFaultAddress) 6859 6860 { … … 6873 6874 * @param u8Interrupt The external interrupt vector. 6874 6875 */ 6875 DECLINLINE(void) hmR0VmxSetPendingExtInt(PVMCPU pVCpu, uint8_t u8Interrupt)6876 DECLINLINE(void) hmR0VmxSetPendingExtInt(PVMCPUCC pVCpu, uint8_t u8Interrupt) 6876 6877 { 6877 6878 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_EXIT_INT_INFO_VECTOR, u8Interrupt) … … 6888 6889 * @param pVCpu The cross context virtual CPU structure. 6889 6890 */ 6890 DECLINLINE(void) hmR0VmxSetPendingXcptNmi(PVMCPU pVCpu)6891 DECLINLINE(void) hmR0VmxSetPendingXcptNmi(PVMCPUCC pVCpu) 6891 6892 { 6892 6893 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_NMI) … … 6903 6904 * @param pVCpu The cross context virtual CPU structure. 6904 6905 */ 6905 DECLINLINE(void) hmR0VmxSetPendingXcptDF(PVMCPU pVCpu)6906 DECLINLINE(void) hmR0VmxSetPendingXcptDF(PVMCPUCC pVCpu) 6906 6907 { 6907 6908 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_DF) … … 6918 6919 * @param pVCpu The cross context virtual CPU structure. 6919 6920 */ 6920 DECLINLINE(void) hmR0VmxSetPendingXcptUD(PVMCPU pVCpu)6921 DECLINLINE(void) hmR0VmxSetPendingXcptUD(PVMCPUCC pVCpu) 6921 6922 { 6922 6923 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_UD) … … 6933 6934 * @param pVCpu The cross context virtual CPU structure. 6934 6935 */ 6935 DECLINLINE(void) hmR0VmxSetPendingXcptDB(PVMCPU pVCpu)6936 DECLINLINE(void) hmR0VmxSetPendingXcptDB(PVMCPUCC pVCpu) 6936 6937 { 6937 6938 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_DB) … … 6950 6951 * @param u32ErrCode The error code for the general-protection exception. 6951 6952 */ 6952 DECLINLINE(void) hmR0VmxSetPendingXcptGP(PVMCPU pVCpu, uint32_t u32ErrCode)6953 DECLINLINE(void) hmR0VmxSetPendingXcptGP(PVMCPUCC pVCpu, uint32_t u32ErrCode) 6953 6954 { 6954 6955 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_GP) … … 6966 6967 * @param u32ErrCode The error code for the stack exception. 6967 6968 */ 6968 DECLINLINE(void) hmR0VmxSetPendingXcptSS(PVMCPU pVCpu, uint32_t u32ErrCode)6969 DECLINLINE(void) hmR0VmxSetPendingXcptSS(PVMCPUCC pVCpu, uint32_t u32ErrCode) 6969 6970 { 6970 6971 uint32_t const u32IntInfo = RT_BF_MAKE(VMX_BF_ENTRY_INT_INFO_VECTOR, X86_XCPT_SS) … … 6984 6985 * @param idxSel The VMCS field for the corresponding segment register. 6985 6986 */ 6986 static void hmR0VmxFixUnusableSegRegAttr(PVMCPU pVCpu, PCPUMSELREG pSelReg, uint32_t idxSel)6987 static void hmR0VmxFixUnusableSegRegAttr(PVMCPUCC pVCpu, PCPUMSELREG pSelReg, uint32_t idxSel) 6987 6988 { 6988 6989 Assert(pSelReg->Attr.u & X86DESCATTR_UNUSABLE); … … 7038 7039 * @remarks Called with interrupts and/or preemption disabled. 7039 7040 */ 7040 static void hmR0VmxImportGuestSegReg(PVMCPU pVCpu, uint8_t iSegReg)7041 static void hmR0VmxImportGuestSegReg(PVMCPUCC pVCpu, uint8_t iSegReg) 7041 7042 { 7042 7043 Assert(iSegReg < X86_SREG_COUNT); … … 7074 7075 * @remarks Called with interrupts and/or preemption disabled. 7075 7076 */ 7076 static void hmR0VmxImportGuestLdtr(PVMCPU pVCpu)7077 static void hmR0VmxImportGuestLdtr(PVMCPUCC pVCpu) 7077 7078 { 7078 7079 uint16_t u16Sel; … … 7102 7103 * @remarks Called with interrupts and/or preemption disabled. 7103 7104 */ 7104 static void hmR0VmxImportGuestTr(PVMCPU pVCpu)7105 static void hmR0VmxImportGuestTr(PVMCPUCC pVCpu) 7105 7106 { 7106 7107 uint16_t u16Sel; … … 7132 7133 * instead!!! 7133 7134 */ 7134 static void hmR0VmxImportGuestRip(PVMCPU pVCpu)7135 static void hmR0VmxImportGuestRip(PVMCPUCC pVCpu) 7135 7136 { 7136 7137 uint64_t u64Val; … … 7158 7159 * instead!!! 7159 7160 */ 7160 static void hmR0VmxImportGuestRFlags(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)7161 static void hmR0VmxImportGuestRFlags(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 7161 7162 { 7162 7163 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 7190 7191 * instead!!! 7191 7192 */ 7192 static void hmR0VmxImportGuestIntrState(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)7193 static void hmR0VmxImportGuestIntrState(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 7193 7194 { 7194 7195 uint32_t u32Val; … … 7229 7230 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 7230 7231 */ 7231 static int hmR0VmxImportGuestState(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint64_t fWhat)7232 static int hmR0VmxImportGuestState(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint64_t fWhat) 7232 7233 { 7233 7234 int rc = VINF_SUCCESS; 7234 PVM pVM = pVCpu->CTX_SUFF(pVM);7235 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7235 7236 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 7236 7237 uint32_t u32Val; … … 7572 7573 * @param fWhat What to import, CPUMCTX_EXTRN_XXX. 7573 7574 */ 7574 VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat)7575 VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat) 7575 7576 { 7576 7577 AssertPtr(pVCpu); … … 7603 7604 * is no longer in VMX non-root mode. 7604 7605 */ 7605 static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPU pVCpu, bool fStepping)7606 static VBOXSTRICTRC hmR0VmxCheckForceFlags(PVMCPUCC pVCpu, bool fStepping) 7606 7607 { 7607 7608 Assert(VMMRZCallRing3IsEnabled(pVCpu)); … … 7616 7617 * Anything pending? Should be more likely than not if we're doing a good job. 7617 7618 */ 7618 PVM pVM = pVCpu->CTX_SUFF(pVM);7619 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 7619 7620 if ( !fStepping 7620 7621 ? !VM_FF_IS_ANY_SET(pVM, VM_FF_HP_R0_PRE_HM_MASK) … … 7696 7697 * @param pVCpu The cross context virtual CPU structure. 7697 7698 */ 7698 static void hmR0VmxTrpmTrapToPendingEvent(PVMCPU pVCpu)7699 static void hmR0VmxTrpmTrapToPendingEvent(PVMCPUCC pVCpu) 7699 7700 { 7700 7701 Assert(TRPMHasTrap(pVCpu)); … … 7728 7729 * @param pVCpu The cross context virtual CPU structure. 7729 7730 */ 7730 static void hmR0VmxPendingEventToTrpmTrap(PVMCPU pVCpu)7731 static void hmR0VmxPendingEventToTrpmTrap(PVMCPUCC pVCpu) 7731 7732 { 7732 7733 Assert(pVCpu->hm.s.Event.fPending); … … 7764 7765 * @param pVmcsInfo The VMCS info. object. 7765 7766 */ 7766 static void hmR0VmxSetIntWindowExitVmcs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)7767 static void hmR0VmxSetIntWindowExitVmcs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 7767 7768 { 7768 7769 if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_INT_WINDOW_EXIT) … … 7801 7802 * @param pVmcsInfo The VMCS info. object. 7802 7803 */ 7803 static void hmR0VmxSetNmiWindowExitVmcs(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo)7804 static void hmR0VmxSetNmiWindowExitVmcs(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 7804 7805 { 7805 7806 if (pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_NMI_WINDOW_EXIT) … … 7843 7844 * @remarks No-long-jmp zone!!! 7844 7845 */ 7845 static int hmR0VmxLeave(PVMCPU pVCpu, bool fImportState)7846 static int hmR0VmxLeave(PVMCPUCC pVCpu, bool fImportState) 7846 7847 { 7847 7848 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 7962 7963 * @remarks No-long-jmp zone!!! 7963 7964 */ 7964 static int hmR0VmxLeaveSession(PVMCPU pVCpu)7965 static int hmR0VmxLeaveSession(PVMCPUCC pVCpu) 7965 7966 { 7966 7967 HM_DISABLE_PREEMPT(pVCpu); … … 8006 8007 * @remarks No-long-jmp zone!!! 8007 8008 */ 8008 DECLINLINE(int) hmR0VmxLongJmpToRing3(PVMCPU pVCpu)8009 DECLINLINE(int) hmR0VmxLongJmpToRing3(PVMCPUCC pVCpu) 8009 8010 { 8010 8011 return hmR0VmxLeaveSession(pVCpu); … … 8025 8026 * VINF_VMM_UNKNOWN_RING3_CALL. 8026 8027 */ 8027 static int hmR0VmxExitToRing3(PVMCPU pVCpu, VBOXSTRICTRC rcExit)8028 static int hmR0VmxExitToRing3(PVMCPUCC pVCpu, VBOXSTRICTRC rcExit) 8028 8029 { 8029 8030 HMVMX_ASSERT_PREEMPT_SAFE(pVCpu); … … 8148 8149 * @param pvUser User argument, currently unused, NULL. 8149 8150 */ 8150 static DECLCALLBACK(int) hmR0VmxCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)8151 static DECLCALLBACK(int) hmR0VmxCallRing3Callback(PVMCPUCC pVCpu, VMMCALLRING3 enmOperation, void *pvUser) 8151 8152 { 8152 8153 RT_NOREF(pvUser); … … 8220 8221 * @param uValue The value to push to the guest stack. 8221 8222 */ 8222 static VBOXSTRICTRC hmR0VmxRealModeGuestStackPush(PVMCPU pVCpu, uint16_t uValue)8223 static VBOXSTRICTRC hmR0VmxRealModeGuestStackPush(PVMCPUCC pVCpu, uint16_t uValue) 8223 8224 { 8224 8225 /* … … 8255 8256 * VM-entry). 8256 8257 */ 8257 static VBOXSTRICTRC hmR0VmxInjectEventVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCHMEVENT pEvent, bool fStepping,8258 static VBOXSTRICTRC hmR0VmxInjectEventVmcs(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PCHMEVENT pEvent, bool fStepping, 8258 8259 uint32_t *pfIntrState) 8259 8260 { … … 8326 8327 else 8327 8328 { 8328 PVM pVM = pVCpu->CTX_SUFF(pVM);8329 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 8329 8330 Assert(PDMVmmDevHeapIsEnabled(pVM)); 8330 8331 Assert(pVM->hm.s.vmx.pRealModeTSS); … … 8490 8491 * @param pfIntrState Where to store the VT-x guest-interruptibility state. 8491 8492 */ 8492 static VBOXSTRICTRC hmR0VmxEvaluatePendingEvent(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t *pfIntrState)8493 static VBOXSTRICTRC hmR0VmxEvaluatePendingEvent(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t *pfIntrState) 8493 8494 { 8494 8495 Assert(pfIntrState); … … 8639 8640 * directly. 8640 8641 */ 8641 static VBOXSTRICTRC hmR0VmxInjectPendingEvent(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t fIntrState, bool fStepping)8642 static VBOXSTRICTRC hmR0VmxInjectPendingEvent(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t fIntrState, bool fStepping) 8642 8643 { 8643 8644 HMVMX_ASSERT_PREEMPT_SAFE(pVCpu); … … 8725 8726 * @param pVCpu The cross context virtual CPU structure. 8726 8727 */ 8727 VMMR0DECL(int) VMXR0Enter(PVMCPU pVCpu)8728 VMMR0DECL(int) VMXR0Enter(PVMCPUCC pVCpu) 8728 8729 { 8729 8730 AssertPtr(pVCpu); … … 8781 8782 * @thread EMT(pVCpu) 8782 8783 */ 8783 VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit)8784 VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit) 8784 8785 { 8785 8786 AssertPtr(pVCpu); … … 8869 8870 * @remarks No-long-jump zone!!! 8870 8871 */ 8871 static int hmR0VmxExportHostState(PVMCPU pVCpu)8872 static int hmR0VmxExportHostState(PVMCPUCC pVCpu) 8872 8873 { 8873 8874 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 8897 8898 * @remarks No-long-jump zone!!! 8898 8899 */ 8899 VMMR0DECL(int) VMXR0ExportHostState(PVMCPU pVCpu)8900 VMMR0DECL(int) VMXR0ExportHostState(PVMCPUCC pVCpu) 8900 8901 { 8901 8902 AssertPtr(pVCpu); … … 8932 8933 * @remarks No-long-jump zone!!! 8933 8934 */ 8934 static VBOXSTRICTRC hmR0VmxExportGuestState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)8935 static VBOXSTRICTRC hmR0VmxExportGuestState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 8935 8936 { 8936 8937 AssertPtr(pVCpu); … … 9027 9028 * @remarks No-long-jump zone!!! 9028 9029 */ 9029 static void hmR0VmxExportSharedState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)9030 static void hmR0VmxExportSharedState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 9030 9031 { 9031 9032 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 9070 9071 * @remarks No-long-jump zone!!! 9071 9072 */ 9072 static VBOXSTRICTRC hmR0VmxExportGuestStateOptimal(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)9073 static VBOXSTRICTRC hmR0VmxExportGuestStateOptimal(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 9073 9074 { 9074 9075 HMVMX_ASSERT_PREEMPT_SAFE(pVCpu); … … 9138 9139 * are valid, i.e. hmR0VmxCheckVmcsCtls() succeeded. 9139 9140 */ 9140 static uint32_t hmR0VmxCheckGuestState(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)9141 static uint32_t hmR0VmxCheckGuestState(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 9141 9142 { 9142 9143 #define HMVMX_ERROR_BREAK(err) { uError = (err); break; } … … 9146 9147 9147 9148 int rc; 9148 PVM pVM = pVCpu->CTX_SUFF(pVM);9149 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 9149 9150 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 9150 9151 uint32_t uError = VMX_IGS_ERROR; … … 9710 9711 * @param pVCpu The cross context virtual CPU structure. 9711 9712 */ 9712 static int hmR0VmxMapHCApicAccessPage(PVMCPU pVCpu)9713 { 9714 PVM pVM = pVCpu->CTX_SUFF(pVM);9713 static int hmR0VmxMapHCApicAccessPage(PVMCPUCC pVCpu) 9714 { 9715 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 9715 9716 uint64_t const u64MsrApicBase = APICGetBaseMsrNoCheck(pVCpu); 9716 9717 … … 9760 9761 * operation. 9761 9762 */ 9762 static int hmR0VmxExitHostNmi(PVMCPU pVCpu, PCVMXVMCSINFO pVmcsInfo)9763 static int hmR0VmxExitHostNmi(PVMCPUCC pVCpu, PCVMXVMCSINFO pVmcsInfo) 9763 9764 { 9764 9765 RTCPUID const idCpu = pVmcsInfo->idHostCpu; … … 9814 9815 * @param pVmcsInfoGst The guest VMCS info. object. 9815 9816 */ 9816 static void hmR0VmxMergeMsrBitmapNested(PCVMCPU pVCpu, PVMXVMCSINFO pVmcsInfoNstGst, PCVMXVMCSINFO pVmcsInfoGst)9817 static void hmR0VmxMergeMsrBitmapNested(PCVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfoNstGst, PCVMXVMCSINFO pVmcsInfoGst) 9817 9818 { 9818 9819 uint32_t const cbMsrBitmap = X86_PAGE_4K_SIZE; … … 9865 9866 * @param pVCpu The cross context virtual CPU structure. 9866 9867 */ 9867 static int hmR0VmxMergeVmcsNested(PVMCPU pVCpu)9868 { 9869 PVM pVM = pVCpu->CTX_SUFF(pVM);9868 static int hmR0VmxMergeVmcsNested(PVMCPUCC pVCpu) 9869 { 9870 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 9870 9871 PCVMXVMCSINFO pVmcsInfoGst = &pVCpu->hm.s.vmx.VmcsInfo; 9871 9872 PCVMXVVMCS pVmcsNstGst = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); … … 10187 10188 * if event dispatching took place. 10188 10189 */ 10189 static VBOXSTRICTRC hmR0VmxPreRunGuest(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, bool fStepping)10190 static VBOXSTRICTRC hmR0VmxPreRunGuest(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, bool fStepping) 10190 10191 { 10191 10192 Assert(VMMRZCallRing3IsEnabled(pVCpu)); … … 10231 10232 * VERR_IOM_MMIO_RANGE_NOT_FOUND guru while booting Visa 64 SMP VM. No 10232 10233 * idea why atm. */ 10233 PVM pVM = pVCpu->CTX_SUFF(pVM);10234 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 10234 10235 if ( !pVCpu->hm.s.vmx.u64GstMsrApicBase 10235 10236 && (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS) … … 10431 10432 * @remarks No-long-jump zone!!! 10432 10433 */ 10433 static void hmR0VmxPreRunGuestCommitted(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)10434 static void hmR0VmxPreRunGuestCommitted(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 10434 10435 { 10435 10436 Assert(!VMMRZCallRing3IsEnabled(pVCpu)); … … 10444 10445 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC); 10445 10446 10446 PVM pVM = pVCpu->CTX_SUFF(pVM);10447 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 10447 10448 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 10448 10449 PHMPHYSCPU pHostCpu = hmR0GetCurrentCpu(); … … 10588 10589 * unconditionally when it is safe to do so. 10589 10590 */ 10590 static void hmR0VmxPostRunGuest(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, int rcVMRun)10591 static void hmR0VmxPostRunGuest(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, int rcVMRun) 10591 10592 { 10592 10593 uint64_t const uHostTsc = ASMReadTSC(); /** @todo We can do a lot better here, see @bugref{9180#c38}. */ … … 10763 10764 * @param pcLoops Pointer to the number of executed loops. 10764 10765 */ 10765 static VBOXSTRICTRC hmR0VmxRunGuestCodeNormal(PVMCPU pVCpu, uint32_t *pcLoops)10766 static VBOXSTRICTRC hmR0VmxRunGuestCodeNormal(PVMCPUCC pVCpu, uint32_t *pcLoops) 10766 10767 { 10767 10768 uint32_t const cMaxResumeLoops = pVCpu->CTX_SUFF(pVM)->hm.s.cMaxResumeLoops; … … 10876 10877 * @sa hmR0VmxRunGuestCodeNormal. 10877 10878 */ 10878 static VBOXSTRICTRC hmR0VmxRunGuestCodeNested(PVMCPU pVCpu, uint32_t *pcLoops)10879 static VBOXSTRICTRC hmR0VmxRunGuestCodeNested(PVMCPUCC pVCpu, uint32_t *pcLoops) 10879 10880 { 10880 10881 uint32_t const cMaxResumeLoops = pVCpu->CTX_SUFF(pVM)->hm.s.cMaxResumeLoops; … … 11057 11058 * @param pDbgState The debug state to initialize. 11058 11059 */ 11059 static void hmR0VmxRunDebugStateInit(PVMCPU pVCpu, PCVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState)11060 static void hmR0VmxRunDebugStateInit(PVMCPUCC pVCpu, PCVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState) 11060 11061 { 11061 11062 pDbgState->uRipStart = pVCpu->cpum.GstCtx.rip; … … 11089 11090 * @param pDbgState The debug state. 11090 11091 */ 11091 static void hmR0VmxPreRunGuestDebugStateApply(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState)11092 static void hmR0VmxPreRunGuestDebugStateApply(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState) 11092 11093 { 11093 11094 /* … … 11154 11155 * stepping. 11155 11156 */ 11156 static VBOXSTRICTRC hmR0VmxRunDebugStateRevert(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState,11157 static VBOXSTRICTRC hmR0VmxRunDebugStateRevert(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState, 11157 11158 VBOXSTRICTRC rcStrict) 11158 11159 { … … 11204 11205 * @param pDbgState The debug state. 11205 11206 */ 11206 static void hmR0VmxPreRunGuestDebugStateUpdate(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState)11207 static void hmR0VmxPreRunGuestDebugStateUpdate(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState) 11207 11208 { 11208 11209 /* … … 11226 11227 * Software interrupts (INT XXh) - no idea how to trigger these... 11227 11228 */ 11228 PVM pVM = pVCpu->CTX_SUFF(pVM);11229 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 11229 11230 if ( DBGF_IS_EVENT_ENABLED(pVM, DBGFEVENT_INTERRUPT_SOFTWARE) 11230 11231 || VBOXVMM_INT_SOFTWARE_ENABLED()) … … 11500 11501 * and to the point. No longer than 33 chars long, please. 11501 11502 */ 11502 static VBOXSTRICTRC hmR0VmxHandleExitDtraceEvents(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uExitReason)11503 static VBOXSTRICTRC hmR0VmxHandleExitDtraceEvents(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, uint32_t uExitReason) 11503 11504 { 11504 11505 /* … … 11850 11851 * one, in order to avoid event nesting. 11851 11852 */ 11852 PVM pVM = pVCpu->CTX_SUFF(pVM);11853 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 11853 11854 if ( enmEvent1 != DBGFEVENT_END 11854 11855 && DBGF_IS_EVENT_ENABLED(pVM, enmEvent1)) … … 11884 11885 * @param pDbgState The debug state. 11885 11886 */ 11886 DECLINLINE(VBOXSTRICTRC) hmR0VmxRunDebugHandleExit(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState)11887 DECLINLINE(VBOXSTRICTRC) hmR0VmxRunDebugHandleExit(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PVMXRUNDBGSTATE pDbgState) 11887 11888 { 11888 11889 /* … … 12038 12039 * @note Mostly the same as hmR0VmxRunGuestCodeNormal(). 12039 12040 */ 12040 static VBOXSTRICTRC hmR0VmxRunGuestCodeDebug(PVMCPU pVCpu, uint32_t *pcLoops)12041 static VBOXSTRICTRC hmR0VmxRunGuestCodeDebug(PVMCPUCC pVCpu, uint32_t *pcLoops) 12041 12042 { 12042 12043 uint32_t const cMaxResumeLoops = pVCpu->CTX_SUFF(pVM)->hm.s.cMaxResumeLoops; … … 12330 12331 * @param pVCpu The cross context virtual CPU structure. 12331 12332 */ 12332 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu)12333 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPUCC pVCpu) 12333 12334 { 12334 12335 AssertPtr(pVCpu); … … 12404 12405 * @param pVmxTransient The VMX-transient structure. 12405 12406 */ 12406 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExit(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)12407 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExit(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 12407 12408 { 12408 12409 #ifdef DEBUG_ramshankar … … 12519 12520 * @param pVmxTransient The VMX-transient structure. 12520 12521 */ 12521 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExitNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)12522 DECLINLINE(VBOXSTRICTRC) hmR0VmxHandleExitNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 12522 12523 { 12523 12524 /** @todo NSTVMX: Remove after debugging regression. */ … … 12760 12761 * @remarks No-long-jump zone!!! 12761 12762 */ 12762 DECLINLINE(void) hmR0VmxAdvanceGuestRipBy(PVMCPU pVCpu, uint32_t cbInstr)12763 DECLINLINE(void) hmR0VmxAdvanceGuestRipBy(PVMCPUCC pVCpu, uint32_t cbInstr) 12763 12764 { 12764 12765 /* Advance the RIP. */ … … 12782 12783 * @remarks No-long-jump zone!!! 12783 12784 */ 12784 static int hmR0VmxAdvanceGuestRip(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)12785 static int hmR0VmxAdvanceGuestRip(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 12785 12786 { 12786 12787 hmR0VmxReadExitInstrLenVmcs(pVmxTransient); … … 12813 12814 * @remarks No-long-jump zone!!! 12814 12815 */ 12815 static VBOXSTRICTRC hmR0VmxCheckExitDueToEventDelivery(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)12816 static VBOXSTRICTRC hmR0VmxCheckExitDueToEventDelivery(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 12816 12817 { 12817 12818 Assert(!pVCpu->hm.s.Event.fPending); … … 13034 13035 * @remarks No-long-jump zone!!! 13035 13036 */ 13036 static VBOXSTRICTRC hmR0VmxCheckExitDueToVmxInstr(PVMCPU pVCpu, uint32_t uExitReason)13037 static VBOXSTRICTRC hmR0VmxCheckExitDueToVmxInstr(PVMCPUCC pVCpu, uint32_t uExitReason) 13037 13038 { 13038 13039 HMVMX_CPUMCTX_ASSERT(pVCpu, CPUMCTX_EXTRN_CR0 | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_SS … … 13102 13103 * segment is valid. 13103 13104 */ 13104 static VBOXSTRICTRC hmR0VmxDecodeMemOperand(PVMCPU pVCpu, uint32_t uExitInstrInfo, RTGCPTR GCPtrDisp, VMXMEMACCESS enmMemAccess,13105 static VBOXSTRICTRC hmR0VmxDecodeMemOperand(PVMCPUCC pVCpu, uint32_t uExitInstrInfo, RTGCPTR GCPtrDisp, VMXMEMACCESS enmMemAccess, 13105 13106 PRTGCPTR pGCPtrMem) 13106 13107 { … … 13278 13279 * VM-exit helper for LMSW. 13279 13280 */ 13280 static VBOXSTRICTRC hmR0VmxExitLmsw(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint16_t uMsw, RTGCPTR GCPtrEffDst)13281 static VBOXSTRICTRC hmR0VmxExitLmsw(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint16_t uMsw, RTGCPTR GCPtrEffDst) 13281 13282 { 13282 13283 int rc = hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK); … … 13303 13304 * VM-exit helper for CLTS. 13304 13305 */ 13305 static VBOXSTRICTRC hmR0VmxExitClts(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr)13306 static VBOXSTRICTRC hmR0VmxExitClts(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr) 13306 13307 { 13307 13308 int rc = hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK); … … 13328 13329 * VM-exit helper for MOV from CRx (CRx read). 13329 13330 */ 13330 static VBOXSTRICTRC hmR0VmxExitMovFromCrX(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg)13331 static VBOXSTRICTRC hmR0VmxExitMovFromCrX(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg) 13331 13332 { 13332 13333 Assert(iCrReg < 16); … … 13362 13363 * VM-exit helper for MOV to CRx (CRx write). 13363 13364 */ 13364 static VBOXSTRICTRC hmR0VmxExitMovToCrX(PVMCPU pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg)13365 static VBOXSTRICTRC hmR0VmxExitMovToCrX(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo, uint8_t cbInstr, uint8_t iGReg, uint8_t iCrReg) 13365 13366 { 13366 13367 int rc = hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK); … … 13423 13424 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13424 13425 */ 13425 static VBOXSTRICTRC hmR0VmxExitXcptPF(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13426 static VBOXSTRICTRC hmR0VmxExitXcptPF(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13426 13427 { 13427 13428 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); 13428 PVM pVM = pVCpu->CTX_SUFF(pVM);13429 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 13429 13430 hmR0VmxReadExitQualVmcs(pVmxTransient); 13430 13431 … … 13521 13522 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13522 13523 */ 13523 static VBOXSTRICTRC hmR0VmxExitXcptMF(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13524 static VBOXSTRICTRC hmR0VmxExitXcptMF(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13524 13525 { 13525 13526 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13553 13554 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13554 13555 */ 13555 static VBOXSTRICTRC hmR0VmxExitXcptBP(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13556 static VBOXSTRICTRC hmR0VmxExitXcptBP(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13556 13557 { 13557 13558 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13582 13583 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13583 13584 */ 13584 static VBOXSTRICTRC hmR0VmxExitXcptAC(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13585 static VBOXSTRICTRC hmR0VmxExitXcptAC(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13585 13586 { 13586 13587 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13599 13600 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13600 13601 */ 13601 static VBOXSTRICTRC hmR0VmxExitXcptDB(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13602 static VBOXSTRICTRC hmR0VmxExitXcptDB(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13602 13603 { 13603 13604 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13685 13686 * @sa hmR0SvmHandleMesaDrvGp. 13686 13687 */ 13687 static int hmR0VmxHandleMesaDrvGp(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx)13688 static int hmR0VmxHandleMesaDrvGp(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx) 13688 13689 { 13689 13690 LogFunc(("cs:rip=%#04x:%#RX64 rcx=%#RX64 rbx=%#RX64\n", pCtx->cs.Sel, pCtx->rip, pCtx->rcx, pCtx->rbx)); … … 13705 13706 * @sa hmR0SvmIsMesaDrvGp. 13706 13707 */ 13707 DECLINLINE(bool) hmR0VmxIsMesaDrvGp(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx)13708 DECLINLINE(bool) hmR0VmxIsMesaDrvGp(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient, PCPUMCTX pCtx) 13708 13709 { 13709 13710 /* 0xed: IN eAX,dx */ … … 13752 13753 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13753 13754 */ 13754 static VBOXSTRICTRC hmR0VmxExitXcptGP(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13755 static VBOXSTRICTRC hmR0VmxExitXcptGP(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13755 13756 { 13756 13757 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13834 13835 * @remarks Requires all fields in HMVMX_READ_XCPT_INFO to be read from the VMCS. 13835 13836 */ 13836 static VBOXSTRICTRC hmR0VmxExitXcptOthers(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13837 static VBOXSTRICTRC hmR0VmxExitXcptOthers(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13837 13838 { 13838 13839 HMVMX_VALIDATE_EXIT_XCPT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13901 13902 * executing a nested-guest (e.g., Mesa driver hacks). 13902 13903 */ 13903 static VBOXSTRICTRC hmR0VmxExitXcpt(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13904 static VBOXSTRICTRC hmR0VmxExitXcpt(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13904 13905 { 13905 13906 HMVMX_ASSERT_READ(pVmxTransient, HMVMX_READ_XCPT_INFO); … … 13959 13960 * VM-exit handler for external interrupts (VMX_EXIT_EXT_INT). 13960 13961 */ 13961 HMVMX_EXIT_DECL hmR0VmxExitExtInt(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13962 HMVMX_EXIT_DECL hmR0VmxExitExtInt(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13962 13963 { 13963 13964 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13974 13975 * VM-exit. 13975 13976 */ 13976 HMVMX_EXIT_DECL hmR0VmxExitXcptOrNmi(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13977 HMVMX_EXIT_DECL hmR0VmxExitXcptOrNmi(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 13977 13978 { 13978 13979 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14049 14050 * VM-exit handler for interrupt-window exiting (VMX_EXIT_INT_WINDOW). 14050 14051 */ 14051 HMVMX_EXIT_NSRC_DECL hmR0VmxExitIntWindow(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14052 HMVMX_EXIT_NSRC_DECL hmR0VmxExitIntWindow(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14052 14053 { 14053 14054 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14066 14067 * VM-exit handler for NMI-window exiting (VMX_EXIT_NMI_WINDOW). 14067 14068 */ 14068 HMVMX_EXIT_NSRC_DECL hmR0VmxExitNmiWindow(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14069 HMVMX_EXIT_NSRC_DECL hmR0VmxExitNmiWindow(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14069 14070 { 14070 14071 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14108 14109 * VM-exit handler for WBINVD (VMX_EXIT_WBINVD). Conditional VM-exit. 14109 14110 */ 14110 HMVMX_EXIT_NSRC_DECL hmR0VmxExitWbinvd(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14111 HMVMX_EXIT_NSRC_DECL hmR0VmxExitWbinvd(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14111 14112 { 14112 14113 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14118 14119 * VM-exit handler for INVD (VMX_EXIT_INVD). Unconditional VM-exit. 14119 14120 */ 14120 HMVMX_EXIT_NSRC_DECL hmR0VmxExitInvd(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14121 HMVMX_EXIT_NSRC_DECL hmR0VmxExitInvd(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14121 14122 { 14122 14123 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14128 14129 * VM-exit handler for CPUID (VMX_EXIT_CPUID). Unconditional VM-exit. 14129 14130 */ 14130 HMVMX_EXIT_DECL hmR0VmxExitCpuid(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14131 HMVMX_EXIT_DECL hmR0VmxExitCpuid(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14131 14132 { 14132 14133 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14184 14185 * VM-exit handler for GETSEC (VMX_EXIT_GETSEC). Unconditional VM-exit. 14185 14186 */ 14186 HMVMX_EXIT_DECL hmR0VmxExitGetsec(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14187 HMVMX_EXIT_DECL hmR0VmxExitGetsec(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14187 14188 { 14188 14189 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14203 14204 * VM-exit handler for RDTSC (VMX_EXIT_RDTSC). Conditional VM-exit. 14204 14205 */ 14205 HMVMX_EXIT_DECL hmR0VmxExitRdtsc(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14206 HMVMX_EXIT_DECL hmR0VmxExitRdtsc(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14206 14207 { 14207 14208 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14233 14234 * VM-exit handler for RDTSCP (VMX_EXIT_RDTSCP). Conditional VM-exit. 14234 14235 */ 14235 HMVMX_EXIT_DECL hmR0VmxExitRdtscp(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14236 HMVMX_EXIT_DECL hmR0VmxExitRdtscp(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14236 14237 { 14237 14238 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14263 14264 * VM-exit handler for RDPMC (VMX_EXIT_RDPMC). Conditional VM-exit. 14264 14265 */ 14265 HMVMX_EXIT_DECL hmR0VmxExitRdpmc(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14266 HMVMX_EXIT_DECL hmR0VmxExitRdpmc(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14266 14267 { 14267 14268 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14291 14292 * VM-exit handler for VMCALL (VMX_EXIT_VMCALL). Unconditional VM-exit. 14292 14293 */ 14293 HMVMX_EXIT_DECL hmR0VmxExitVmcall(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14294 HMVMX_EXIT_DECL hmR0VmxExitVmcall(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14294 14295 { 14295 14296 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14335 14336 * VM-exit handler for INVLPG (VMX_EXIT_INVLPG). Conditional VM-exit. 14336 14337 */ 14337 HMVMX_EXIT_DECL hmR0VmxExitInvlpg(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14338 HMVMX_EXIT_DECL hmR0VmxExitInvlpg(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14338 14339 { 14339 14340 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14365 14366 * VM-exit handler for MONITOR (VMX_EXIT_MONITOR). Conditional VM-exit. 14366 14367 */ 14367 HMVMX_EXIT_DECL hmR0VmxExitMonitor(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14368 HMVMX_EXIT_DECL hmR0VmxExitMonitor(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14368 14369 { 14369 14370 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14390 14391 * VM-exit handler for MWAIT (VMX_EXIT_MWAIT). Conditional VM-exit. 14391 14392 */ 14392 HMVMX_EXIT_DECL hmR0VmxExitMwait(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14393 HMVMX_EXIT_DECL hmR0VmxExitMwait(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14393 14394 { 14394 14395 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14415 14416 * VM-exit. 14416 14417 */ 14417 HMVMX_EXIT_DECL hmR0VmxExitTripleFault(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14418 HMVMX_EXIT_DECL hmR0VmxExitTripleFault(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14418 14419 { 14419 14420 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14425 14426 * VM-exit handler for HLT (VMX_EXIT_HLT). Conditional VM-exit. 14426 14427 */ 14427 HMVMX_EXIT_DECL hmR0VmxExitHlt(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14428 HMVMX_EXIT_DECL hmR0VmxExitHlt(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14428 14429 { 14429 14430 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14448 14449 * the guest. 14449 14450 */ 14450 HMVMX_EXIT_NSRC_DECL hmR0VmxExitSetPendingXcptUD(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14451 HMVMX_EXIT_NSRC_DECL hmR0VmxExitSetPendingXcptUD(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14451 14452 { 14452 14453 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14459 14460 * VM-exit handler for expiry of the VMX-preemption timer. 14460 14461 */ 14461 HMVMX_EXIT_DECL hmR0VmxExitPreemptTimer(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14462 HMVMX_EXIT_DECL hmR0VmxExitPreemptTimer(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14462 14463 { 14463 14464 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14467 14468 14468 14469 /* If there are any timer events pending, fall back to ring-3, otherwise resume guest execution. */ 14469 PVM pVM = pVCpu->CTX_SUFF(pVM);14470 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 14470 14471 bool fTimersPending = TMTimerPollBool(pVM, pVCpu); 14471 14472 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPreemptTimer); … … 14477 14478 * VM-exit handler for XSETBV (VMX_EXIT_XSETBV). Unconditional VM-exit. 14478 14479 */ 14479 HMVMX_EXIT_DECL hmR0VmxExitXsetbv(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14480 HMVMX_EXIT_DECL hmR0VmxExitXsetbv(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14480 14481 { 14481 14482 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14500 14501 * VM-exit handler for INVPCID (VMX_EXIT_INVPCID). Conditional VM-exit. 14501 14502 */ 14502 HMVMX_EXIT_DECL hmR0VmxExitInvpcid(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14503 HMVMX_EXIT_DECL hmR0VmxExitInvpcid(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14503 14504 { 14504 14505 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14512 14513 * VM-exit. 14513 14514 */ 14514 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrInvalidGuestState(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14515 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrInvalidGuestState(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14515 14516 { 14516 14517 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; … … 14563 14564 * VM-exit handler for all undefined/unexpected reasons. Should never happen. 14564 14565 */ 14565 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrUnexpected(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14566 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrUnexpected(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14566 14567 { 14567 14568 /* … … 14650 14651 * VM-exit handler for RDMSR (VMX_EXIT_RDMSR). 14651 14652 */ 14652 HMVMX_EXIT_DECL hmR0VmxExitRdmsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14653 HMVMX_EXIT_DECL hmR0VmxExitRdmsr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14653 14654 { 14654 14655 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14716 14717 * VM-exit handler for WRMSR (VMX_EXIT_WRMSR). 14717 14718 */ 14718 HMVMX_EXIT_DECL hmR0VmxExitWrmsr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14719 HMVMX_EXIT_DECL hmR0VmxExitWrmsr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14719 14720 { 14720 14721 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14859 14860 * VM-exit handler for PAUSE (VMX_EXIT_PAUSE). Conditional VM-exit. 14860 14861 */ 14861 HMVMX_EXIT_DECL hmR0VmxExitPause(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14862 HMVMX_EXIT_DECL hmR0VmxExitPause(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14862 14863 { 14863 14864 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14878 14879 * threshold (VMX_EXIT_TPR_BELOW_THRESHOLD). Conditional VM-exit. 14879 14880 */ 14880 HMVMX_EXIT_NSRC_DECL hmR0VmxExitTprBelowThreshold(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14881 HMVMX_EXIT_NSRC_DECL hmR0VmxExitTprBelowThreshold(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14881 14882 { 14882 14883 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14902 14903 * incompatible guest state for VMX execution (real-on-v86 case). 14903 14904 */ 14904 HMVMX_EXIT_DECL hmR0VmxExitMovCRx(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)14905 HMVMX_EXIT_DECL hmR0VmxExitMovCRx(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 14905 14906 { 14906 14907 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 14912 14913 14913 14914 VBOXSTRICTRC rcStrict; 14914 PVM pVM = pVCpu->CTX_SUFF(pVM);14915 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 14915 14916 uint64_t const uExitQual = pVmxTransient->uExitQual; 14916 14917 uint32_t const uAccessType = VMX_EXIT_QUAL_CRX_ACCESS(uExitQual); … … 15052 15053 * VM-exit. 15053 15054 */ 15054 HMVMX_EXIT_DECL hmR0VmxExitIoInstr(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15055 HMVMX_EXIT_DECL hmR0VmxExitIoInstr(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15055 15056 { 15056 15057 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15099 15100 uint32_t const cbInstr = pVmxTransient->cbInstr; 15100 15101 bool fUpdateRipAlready = false; /* ugly hack, should be temporary. */ 15101 PVM pVM = pVCpu->CTX_SUFF(pVM);15102 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 15102 15103 if (fIOString) 15103 15104 { … … 15288 15289 * VM-exit. 15289 15290 */ 15290 HMVMX_EXIT_DECL hmR0VmxExitTaskSwitch(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15291 HMVMX_EXIT_DECL hmR0VmxExitTaskSwitch(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15291 15292 { 15292 15293 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15335 15336 * VM-exit handler for monitor-trap-flag (VMX_EXIT_MTF). Conditional VM-exit. 15336 15337 */ 15337 HMVMX_EXIT_DECL hmR0VmxExitMtf(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15338 HMVMX_EXIT_DECL hmR0VmxExitMtf(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15338 15339 { 15339 15340 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15350 15351 * VM-exit handler for APIC access (VMX_EXIT_APIC_ACCESS). Conditional VM-exit. 15351 15352 */ 15352 HMVMX_EXIT_DECL hmR0VmxExitApicAccess(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15353 HMVMX_EXIT_DECL hmR0VmxExitApicAccess(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15353 15354 { 15354 15355 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15403 15404 VMX_EXIT_QUAL_APIC_ACCESS_OFFSET(pVmxTransient->uExitQual))); 15404 15405 15405 PVM pVM = pVCpu->CTX_SUFF(pVM);15406 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 15406 15407 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 15407 15408 rcStrict = IOMMMIOPhysHandler(pVM, pVCpu, … … 15438 15439 * VM-exit. 15439 15440 */ 15440 HMVMX_EXIT_DECL hmR0VmxExitMovDRx(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15441 HMVMX_EXIT_DECL hmR0VmxExitMovDRx(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15441 15442 { 15442 15443 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15498 15499 Log4Func(("cs:rip=%#04x:%#RX64\n", pCtx->cs.Sel, pCtx->rip)); 15499 15500 15500 PVM pVM = pVCpu->CTX_SUFF(pVM);15501 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 15501 15502 if (VMX_EXIT_QUAL_DRX_DIRECTION(pVmxTransient->uExitQual) == VMX_EXIT_QUAL_DRX_DIRECTION_WRITE) 15502 15503 { … … 15531 15532 * Conditional VM-exit. 15532 15533 */ 15533 HMVMX_EXIT_DECL hmR0VmxExitEptMisconfig(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15534 HMVMX_EXIT_DECL hmR0VmxExitEptMisconfig(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15534 15535 { 15535 15536 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15593 15594 * weird case. See @bugref{6043}. 15594 15595 */ 15595 PVM pVM = pVCpu->CTX_SUFF(pVM);15596 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 15596 15597 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 15597 15598 rcStrict = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pCtx), GCPhys, UINT32_MAX); … … 15630 15631 * VM-exit. 15631 15632 */ 15632 HMVMX_EXIT_DECL hmR0VmxExitEptViolation(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15633 HMVMX_EXIT_DECL hmR0VmxExitEptViolation(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15633 15634 { 15634 15635 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15678 15679 uErrorCode |= X86_TRAP_PF_P; 15679 15680 15680 PVM pVM = pVCpu->CTX_SUFF(pVM);15681 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 15681 15682 PCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 15682 15683 Log4Func(("at %#RX64 (%#RX64 errcode=%#x) cs:rip=%#04x:%#RX64\n", GCPhys, uExitQual, uErrorCode, pCtx->cs.Sel, pCtx->rip)); … … 15709 15710 * VM-exit handler for VMCLEAR (VMX_EXIT_VMCLEAR). Unconditional VM-exit. 15710 15711 */ 15711 HMVMX_EXIT_DECL hmR0VmxExitVmclear(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15712 HMVMX_EXIT_DECL hmR0VmxExitVmclear(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15712 15713 { 15713 15714 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15746 15747 * VM-exit handler for VMLAUNCH (VMX_EXIT_VMLAUNCH). Unconditional VM-exit. 15747 15748 */ 15748 HMVMX_EXIT_DECL hmR0VmxExitVmlaunch(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15749 HMVMX_EXIT_DECL hmR0VmxExitVmlaunch(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15749 15750 { 15750 15751 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15775 15776 * VM-exit handler for VMPTRLD (VMX_EXIT_VMPTRLD). Unconditional VM-exit. 15776 15777 */ 15777 HMVMX_EXIT_DECL hmR0VmxExitVmptrld(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15778 HMVMX_EXIT_DECL hmR0VmxExitVmptrld(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15778 15779 { 15779 15780 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15812 15813 * VM-exit handler for VMPTRST (VMX_EXIT_VMPTRST). Unconditional VM-exit. 15813 15814 */ 15814 HMVMX_EXIT_DECL hmR0VmxExitVmptrst(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15815 HMVMX_EXIT_DECL hmR0VmxExitVmptrst(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15815 15816 { 15816 15817 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15849 15850 * VM-exit handler for VMREAD (VMX_EXIT_VMREAD). Conditional VM-exit. 15850 15851 */ 15851 HMVMX_EXIT_DECL hmR0VmxExitVmread(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15852 HMVMX_EXIT_DECL hmR0VmxExitVmread(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15852 15853 { 15853 15854 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15892 15893 * VM-exit handler for VMRESUME (VMX_EXIT_VMRESUME). Unconditional VM-exit. 15893 15894 */ 15894 HMVMX_EXIT_DECL hmR0VmxExitVmresume(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15895 HMVMX_EXIT_DECL hmR0VmxExitVmresume(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15895 15896 { 15896 15897 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15921 15922 * VM-exit handler for VMWRITE (VMX_EXIT_VMWRITE). Conditional VM-exit. 15922 15923 */ 15923 HMVMX_EXIT_DECL hmR0VmxExitVmwrite(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15924 HMVMX_EXIT_DECL hmR0VmxExitVmwrite(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15924 15925 { 15925 15926 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15964 15965 * VM-exit handler for VMXOFF (VMX_EXIT_VMXOFF). Unconditional VM-exit. 15965 15966 */ 15966 HMVMX_EXIT_DECL hmR0VmxExitVmxoff(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15967 HMVMX_EXIT_DECL hmR0VmxExitVmxoff(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15967 15968 { 15968 15969 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 15991 15992 * VM-exit handler for VMXON (VMX_EXIT_VMXON). Unconditional VM-exit. 15992 15993 */ 15993 HMVMX_EXIT_DECL hmR0VmxExitVmxon(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)15994 HMVMX_EXIT_DECL hmR0VmxExitVmxon(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 15994 15995 { 15995 15996 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16028 16029 * VM-exit handler for INVVPID (VMX_EXIT_INVVPID). Unconditional VM-exit. 16029 16030 */ 16030 HMVMX_EXIT_DECL hmR0VmxExitInvvpid(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16031 HMVMX_EXIT_DECL hmR0VmxExitInvvpid(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16031 16032 { 16032 16033 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16075 16076 * Conditional VM-exit. 16076 16077 */ 16077 HMVMX_EXIT_DECL hmR0VmxExitXcptOrNmiNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16078 HMVMX_EXIT_DECL hmR0VmxExitXcptOrNmiNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16078 16079 { 16079 16080 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16186 16187 * Unconditional VM-exit. 16187 16188 */ 16188 HMVMX_EXIT_DECL hmR0VmxExitTripleFaultNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16189 HMVMX_EXIT_DECL hmR0VmxExitTripleFaultNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16189 16190 { 16190 16191 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16196 16197 * Nested-guest VM-exit handler for interrupt-window exiting (VMX_EXIT_INT_WINDOW). 16197 16198 */ 16198 HMVMX_EXIT_NSRC_DECL hmR0VmxExitIntWindowNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16199 HMVMX_EXIT_NSRC_DECL hmR0VmxExitIntWindowNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16199 16200 { 16200 16201 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16209 16210 * Nested-guest VM-exit handler for NMI-window exiting (VMX_EXIT_NMI_WINDOW). 16210 16211 */ 16211 HMVMX_EXIT_NSRC_DECL hmR0VmxExitNmiWindowNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16212 HMVMX_EXIT_NSRC_DECL hmR0VmxExitNmiWindowNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16212 16213 { 16213 16214 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16223 16224 * Unconditional VM-exit. 16224 16225 */ 16225 HMVMX_EXIT_DECL hmR0VmxExitTaskSwitchNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16226 HMVMX_EXIT_DECL hmR0VmxExitTaskSwitchNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16226 16227 { 16227 16228 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16249 16250 * Nested-guest VM-exit handler for HLT (VMX_EXIT_HLT). Conditional VM-exit. 16250 16251 */ 16251 HMVMX_EXIT_DECL hmR0VmxExitHltNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16252 HMVMX_EXIT_DECL hmR0VmxExitHltNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16252 16253 { 16253 16254 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16265 16266 * Nested-guest VM-exit handler for INVLPG (VMX_EXIT_INVLPG). Conditional VM-exit. 16266 16267 */ 16267 HMVMX_EXIT_DECL hmR0VmxExitInvlpgNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16268 HMVMX_EXIT_DECL hmR0VmxExitInvlpgNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16268 16269 { 16269 16270 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16288 16289 * Nested-guest VM-exit handler for RDPMC (VMX_EXIT_RDPMC). Conditional VM-exit. 16289 16290 */ 16290 HMVMX_EXIT_DECL hmR0VmxExitRdpmcNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16291 HMVMX_EXIT_DECL hmR0VmxExitRdpmcNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16291 16292 { 16292 16293 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16305 16306 * (VMX_EXIT_VMWRITE). Conditional VM-exit. 16306 16307 */ 16307 HMVMX_EXIT_DECL hmR0VmxExitVmreadVmwriteNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16308 HMVMX_EXIT_DECL hmR0VmxExitVmreadVmwriteNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16308 16309 { 16309 16310 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16345 16346 * Nested-guest VM-exit handler for RDTSC (VMX_EXIT_RDTSC). Conditional VM-exit. 16346 16347 */ 16347 HMVMX_EXIT_DECL hmR0VmxExitRdtscNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16348 HMVMX_EXIT_DECL hmR0VmxExitRdtscNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16348 16349 { 16349 16350 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16363 16364 * Conditional VM-exit. 16364 16365 */ 16365 HMVMX_EXIT_DECL hmR0VmxExitMovCRxNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16366 HMVMX_EXIT_DECL hmR0VmxExitMovCRxNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16366 16367 { 16367 16368 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16522 16523 * Conditional VM-exit. 16523 16524 */ 16524 HMVMX_EXIT_DECL hmR0VmxExitMovDRxNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16525 HMVMX_EXIT_DECL hmR0VmxExitMovDRxNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16525 16526 { 16526 16527 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16546 16547 * Conditional VM-exit. 16547 16548 */ 16548 HMVMX_EXIT_DECL hmR0VmxExitIoInstrNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16549 HMVMX_EXIT_DECL hmR0VmxExitIoInstrNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16549 16550 { 16550 16551 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16569 16570 * - Optionally provides VM-exit instruction info (depends on CPU feature). 16570 16571 */ 16571 PVM pVM = pVCpu->CTX_SUFF(pVM);16572 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 16572 16573 hmR0VmxReadExitInstrLenVmcs(pVmxTransient); 16573 16574 … … 16604 16605 * Nested-guest VM-exit handler for RDMSR (VMX_EXIT_RDMSR). 16605 16606 */ 16606 HMVMX_EXIT_DECL hmR0VmxExitRdmsrNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16607 HMVMX_EXIT_DECL hmR0VmxExitRdmsrNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16607 16608 { 16608 16609 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16626 16627 * Nested-guest VM-exit handler for WRMSR (VMX_EXIT_WRMSR). 16627 16628 */ 16628 HMVMX_EXIT_DECL hmR0VmxExitWrmsrNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16629 HMVMX_EXIT_DECL hmR0VmxExitWrmsrNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16629 16630 { 16630 16631 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16648 16649 * Nested-guest VM-exit handler for MWAIT (VMX_EXIT_MWAIT). Conditional VM-exit. 16649 16650 */ 16650 HMVMX_EXIT_DECL hmR0VmxExitMwaitNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16651 HMVMX_EXIT_DECL hmR0VmxExitMwaitNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16651 16652 { 16652 16653 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16665 16666 * VM-exit. 16666 16667 */ 16667 HMVMX_EXIT_DECL hmR0VmxExitMtfNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16668 HMVMX_EXIT_DECL hmR0VmxExitMtfNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16668 16669 { 16669 16670 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16677 16678 * Nested-guest VM-exit handler for MONITOR (VMX_EXIT_MONITOR). Conditional VM-exit. 16678 16679 */ 16679 HMVMX_EXIT_DECL hmR0VmxExitMonitorNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16680 HMVMX_EXIT_DECL hmR0VmxExitMonitorNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16680 16681 { 16681 16682 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16693 16694 * Nested-guest VM-exit handler for PAUSE (VMX_EXIT_PAUSE). Conditional VM-exit. 16694 16695 */ 16695 HMVMX_EXIT_DECL hmR0VmxExitPauseNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16696 HMVMX_EXIT_DECL hmR0VmxExitPauseNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16696 16697 { 16697 16698 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16716 16717 * specified threshold (VMX_EXIT_TPR_BELOW_THRESHOLD). Conditional VM-exit. 16717 16718 */ 16718 HMVMX_EXIT_NSRC_DECL hmR0VmxExitTprBelowThresholdNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16719 HMVMX_EXIT_NSRC_DECL hmR0VmxExitTprBelowThresholdNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16719 16720 { 16720 16721 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16730 16731 * VM-exit. 16731 16732 */ 16732 HMVMX_EXIT_DECL hmR0VmxExitApicAccessNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16733 HMVMX_EXIT_DECL hmR0VmxExitApicAccessNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16733 16734 { 16734 16735 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16762 16763 * Conditional VM-exit. 16763 16764 */ 16764 HMVMX_EXIT_DECL hmR0VmxExitApicWriteNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16765 HMVMX_EXIT_DECL hmR0VmxExitApicWriteNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16765 16766 { 16766 16767 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16776 16777 * Conditional VM-exit. 16777 16778 */ 16778 HMVMX_EXIT_DECL hmR0VmxExitVirtEoiNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16779 HMVMX_EXIT_DECL hmR0VmxExitVirtEoiNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16779 16780 { 16780 16781 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16789 16790 * Nested-guest VM-exit handler for RDTSCP (VMX_EXIT_RDTSCP). Conditional VM-exit. 16790 16791 */ 16791 HMVMX_EXIT_DECL hmR0VmxExitRdtscpNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16792 HMVMX_EXIT_DECL hmR0VmxExitRdtscpNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16792 16793 { 16793 16794 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16806 16807 * Nested-guest VM-exit handler for WBINVD (VMX_EXIT_WBINVD). Conditional VM-exit. 16807 16808 */ 16808 HMVMX_EXIT_NSRC_DECL hmR0VmxExitWbinvdNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16809 HMVMX_EXIT_NSRC_DECL hmR0VmxExitWbinvdNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16809 16810 { 16810 16811 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16822 16823 * Nested-guest VM-exit handler for INVPCID (VMX_EXIT_INVPCID). Conditional VM-exit. 16823 16824 */ 16824 HMVMX_EXIT_DECL hmR0VmxExitInvpcidNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16825 HMVMX_EXIT_DECL hmR0VmxExitInvpcidNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16825 16826 { 16826 16827 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16849 16850 * (VMX_EXIT_ERR_INVALID_GUEST_STATE). Error VM-exit. 16850 16851 */ 16851 HMVMX_EXIT_DECL hmR0VmxExitErrInvalidGuestStateNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16852 HMVMX_EXIT_DECL hmR0VmxExitErrInvalidGuestStateNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16852 16853 { 16853 16854 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16871 16872 * Unconditional VM-exit. 16872 16873 */ 16873 HMVMX_EXIT_DECL hmR0VmxExitInstrNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16874 HMVMX_EXIT_DECL hmR0VmxExitInstrNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16874 16875 { 16875 16876 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 16900 16901 * Unconditional VM-exit. 16901 16902 */ 16902 HMVMX_EXIT_DECL hmR0VmxExitInstrWithInfoNested(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)16903 HMVMX_EXIT_DECL hmR0VmxExitInstrWithInfoNested(PVMCPUCC pVCpu, PVMXTRANSIENT pVmxTransient) 16903 16904 { 16904 16905 HMVMX_VALIDATE_NESTED_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.h
r80150 r80274 31 31 32 32 #ifdef IN_RING0 33 VMMR0DECL(int) VMXR0Enter(PVMCPU pVCpu);34 VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPU pVCpu, bool fGlobalInit);35 VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVM pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys,33 VMMR0DECL(int) VMXR0Enter(PVMCPUCC pVCpu); 34 VMMR0DECL(void) VMXR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, PVMCPUCC pVCpu, bool fGlobalInit); 35 VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys, 36 36 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs); 37 37 VMMR0DECL(int) VMXR0DisableCpu(void *pvPageCpu, RTHCPHYS pPageCpuPhys); 38 38 VMMR0DECL(int) VMXR0GlobalInit(void); 39 39 VMMR0DECL(void) VMXR0GlobalTerm(void); 40 VMMR0DECL(int) VMXR0InitVM(PVM pVM);41 VMMR0DECL(int) VMXR0TermVM(PVM pVM);42 VMMR0DECL(int) VMXR0SetupVM(PVM pVM);43 VMMR0DECL(int) VMXR0ExportHostState(PVMCPU pVCpu);44 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPU pVCpu, RTGCPTR GCVirt);45 VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat);46 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPU pVCpu);47 DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVM pVM, PVMCPUpVCpu);48 DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVM pVM, PVMCPUpVCpu);40 VMMR0DECL(int) VMXR0InitVM(PVMCC pVM); 41 VMMR0DECL(int) VMXR0TermVM(PVMCC pVM); 42 VMMR0DECL(int) VMXR0SetupVM(PVMCC pVM); 43 VMMR0DECL(int) VMXR0ExportHostState(PVMCPUCC pVCpu); 44 VMMR0DECL(int) VMXR0InvalidatePage(PVMCPUCC pVCpu, RTGCPTR GCVirt); 45 VMMR0DECL(int) VMXR0ImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat); 46 VMMR0DECL(VBOXSTRICTRC) VMXR0RunGuestCode(PVMCPUCC pVCpu); 47 DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu); 48 DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu); 49 49 #endif /* IN_RING0 */ 50 50 -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r80268 r80274 35 35 #include "NEMInternal.h" 36 36 #include <VBox/vmm/gvm.h> 37 #include <VBox/vmm/vm .h>37 #include <VBox/vmm/vmcc.h> 38 38 #include <VBox/vmm/gvmm.h> 39 39 #include <VBox/param.h> … … 80 80 * Internal Functions * 81 81 *********************************************************************************************************************************/ 82 NEM_TMPL_STATIC int nemR0WinMapPages(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,82 NEM_TMPL_STATIC int nemR0WinMapPages(PGVM pGVM, PVMCC pVM, PGVMCPU pGVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, 83 83 uint32_t cPages, uint32_t fFlags); 84 84 NEM_TMPL_STATIC int nemR0WinUnmapPages(PGVM pGVM, PGVMCPU pGVCpu, RTGCPHYS GCPhys, uint32_t cPages); … … 89 89 NEM_TMPL_STATIC int nemR0WinResumeCpuTickOnAll(PGVM pGVM, PGVMCPU pGVCpu, uint64_t uPausedTscValue); 90 90 #endif 91 DECLINLINE(NTSTATUS) nemR0NtPerformIoControl(PGVM pGVM, uint32_t uFunction, void *pvInput, uint32_t cbInput,91 DECLINLINE(NTSTATUS) nemR0NtPerformIoControl(PGVM pGVM, PVMCPUCC pVCpu, uint32_t uFunction, void *pvInput, uint32_t cbInput, 92 92 void *pvOutput, uint32_t cbOutput); 93 93 … … 159 159 * @thread EMT(0) 160 160 */ 161 VMMR0_INT_DECL(int) NEMR0InitVM(PGVM pGVM, PVM pVM)161 VMMR0_INT_DECL(int) NEMR0InitVM(PGVM pGVM, PVMCC pVM) 162 162 { 163 163 AssertCompile(sizeof(pGVM->nemr0.s) <= sizeof(pGVM->nemr0.padding)); … … 238 238 * @returns NT status code. 239 239 * @param pGVM The ring-0 VM structure. 240 * @param pVCpu The cross context CPU structure of the calling EMT. 240 241 * @param uFunction The function to perform. 241 242 * @param pvInput The input buffer. This must point within the VM … … 248 249 * @param cbOutput The size of the output. @a pvOutput must be NULL 249 250 * when zero. 251 * @thread EMT(pVCpu) 250 252 */ 251 DECLINLINE(NTSTATUS) nemR0NtPerformIoControl(PGVM pGVM, uint32_t uFunction, void *pvInput, uint32_t cbInput,253 DECLINLINE(NTSTATUS) nemR0NtPerformIoControl(PGVM pGVM, PVMCPUCC pVCpu, uint32_t uFunction, void *pvInput, uint32_t cbInput, 252 254 void *pvOutput, uint32_t cbOutput) 253 255 { … … 256 258 * Input and output parameters are part of the VM CPU structure. 257 259 */ 258 PVM pVM = pGVM->pVM; 260 VMCPU_ASSERT_EMT(pVCpu); 261 # ifdef VBOX_BUGREF_9217 262 if (pvInput) 263 AssertReturn(((uintptr_t)pvInput + cbInput) - (uintptr_t)pVCpu <= sizeof(*pVCpu), VERR_INVALID_PARAMETER); 264 if (pvOutput) 265 AssertReturn(((uintptr_t)pvOutput + cbOutput) - (uintptr_t)pVCpu <= sizeof(*pVCpu), VERR_INVALID_PARAMETER); 266 # else 267 PVMCC pVM = pGVM->pVM; 259 268 size_t const cbVM = RT_UOFFSETOF_DYN(VM, aCpus[pGVM->cCpus]); 260 269 if (pvInput) … … 262 271 if (pvOutput) 263 272 AssertReturn(((uintptr_t)pvOutput + cbOutput) - (uintptr_t)pVM <= cbVM, VERR_INVALID_PARAMETER); 273 # endif 264 274 #endif 265 275 … … 267 277 int rc = SUPR0IoCtlPerform(pGVM->nemr0.s.pIoCtlCtx, uFunction, 268 278 pvInput, 279 #ifdef VBOX_BUGREF_9217 280 pvInput ? (uintptr_t)pvInput + pVCpu->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 281 #else 269 282 pvInput ? (uintptr_t)pvInput + pGVM->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 283 #endif 270 284 cbInput, 271 285 pvOutput, 286 #ifdef VBOX_BUGREF_9217 287 pvOutput ? (uintptr_t)pvOutput + pVCpu->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 288 #else 272 289 pvOutput ? (uintptr_t)pvOutput + pGVM->nemr0.s.offRing3ConversionDelta : NIL_RTR3PTR, 290 #endif 273 291 cbOutput, 274 292 &rcNt); 275 293 if (RT_SUCCESS(rc) || !NT_SUCCESS((NTSTATUS)rcNt)) 276 294 return (NTSTATUS)rcNt; 295 #ifndef VBOX_BUGREF_9217 296 RT_NOREF(pVCpu); 297 #endif 277 298 return STATUS_UNSUCCESSFUL; 278 299 } … … 287 308 * @thread EMT(0) 288 309 */ 289 VMMR0_INT_DECL(int) NEMR0InitVMPart2(PGVM pGVM, PVM pVM)310 VMMR0_INT_DECL(int) NEMR0InitVMPart2(PGVM pGVM, PVMCC pVM) 290 311 { 291 312 int rc = GVMMR0ValidateGVMandVMandEMT(pGVM, pVM, 0); … … 342 363 rc = SUPR0IoCtlSetupForHandle(pGVM->pSession, pVM->nem.s.hPartitionDevice, 0, &pGVM->nemr0.s.pIoCtlCtx); 343 364 AssertLogRelRCReturn(rc, rc); 365 #ifdef VBOX_BUGREF_9217 366 for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) 367 { 368 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 369 pGVCpu->nemr0.s.offRing3ConversionDelta = (uintptr_t)pGVM->aCpus[idCpu].pVCpuR3 - (uintptr_t)pGVCpu; 370 } 371 #else 344 372 pGVM->nemr0.s.offRing3ConversionDelta = (uintptr_t)pVM->pVMR3 - (uintptr_t)pGVM->pVM; 373 #endif 345 374 346 375 /* 347 376 * Get the partition ID. 348 377 */ 349 PVMCPU pVCpu = &pGVM->pVM->aCpus[0]; 350 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlGetHvPartitionId.uFunction, NULL, 0, 351 &pVCpu->nem.s.uIoCtlBuf.idPartition, sizeof(pVCpu->nem.s.uIoCtlBuf.idPartition)); 378 #ifdef VBOX_BUGREF_9217 379 PVMCPUCC pVCpu0 = &pGVM->aCpus[0]; 380 #else 381 PVMCPUCC pVCpu0 = &pGVM->pVM->aCpus[0]; 382 #endif 383 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu0, pGVM->nemr0.s.IoCtlGetHvPartitionId.uFunction, NULL, 0, 384 &pVCpu0->nem.s.uIoCtlBuf.idPartition, sizeof(pVCpu0->nem.s.uIoCtlBuf.idPartition)); 352 385 AssertLogRelMsgReturn(NT_SUCCESS(rcNt), ("IoCtlGetHvPartitionId failed: %#x\n", rcNt), VERR_NEM_INIT_FAILED); 353 pGVM->nemr0.s.idHvPartition = pVCpu ->nem.s.uIoCtlBuf.idPartition;386 pGVM->nemr0.s.idHvPartition = pVCpu0->nem.s.uIoCtlBuf.idPartition; 354 387 AssertLogRelMsgReturn(pGVM->nemr0.s.idHvPartition == pVM->nem.s.idHvPartition, 355 388 ("idHvPartition mismatch: r0=%#RX64, r3=%#RX64\n", pGVM->nemr0.s.idHvPartition, pVM->nem.s.idHvPartition), … … 419 452 * Worker for NEMR0MapPages and others. 420 453 */ 421 NEM_TMPL_STATIC int nemR0WinMapPages(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,454 NEM_TMPL_STATIC int nemR0WinMapPages(PGVM pGVM, PVMCC pVM, PGVMCPU pGVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, 422 455 uint32_t cPages, uint32_t fFlags) 423 456 { … … 501 534 * @thread EMT(idCpu) 502 535 */ 503 VMMR0_INT_DECL(int) NEMR0MapPages(PGVM pGVM, PVM pVM, VMCPUID idCpu)536 VMMR0_INT_DECL(int) NEMR0MapPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 504 537 { 505 538 /* … … 509 542 if (RT_SUCCESS(rc)) 510 543 { 511 PVMCPU pVCpu = &pVM->aCpus[idCpu];544 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 512 545 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 513 546 … … 581 614 * @thread EMT(idCpu) 582 615 */ 583 VMMR0_INT_DECL(int) NEMR0UnmapPages(PGVM pGVM, PVM pVM, VMCPUID idCpu)616 VMMR0_INT_DECL(int) NEMR0UnmapPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 584 617 { 585 618 /* … … 589 622 if (RT_SUCCESS(rc)) 590 623 { 591 PVMCPU pVCpu = &pVM->aCpus[idCpu];624 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 592 625 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 593 626 … … 617 650 NEM_TMPL_STATIC int nemR0WinExportState(PGVM pGVM, PGVMCPU pGVCpu, PCPUMCTX pCtx) 618 651 { 619 PVMCPU pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu]; 652 #ifdef VBOX_BUGREF_9217 653 PVMCPUCC pVCpu = pGVCpu; 654 #else 655 PVMCPUCC pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu]; 656 #endif 620 657 HV_INPUT_SET_VP_REGISTERS *pInput = (HV_INPUT_SET_VP_REGISTERS *)pGVCpu->nemr0.s.HypercallData.pbPage; 621 658 AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3); … … 1295 1332 * hypercall page and arguments. 1296 1333 */ 1297 VMMR0_INT_DECL(int) NEMR0ExportState(PGVM pGVM, PVM pVM, VMCPUID idCpu)1334 VMMR0_INT_DECL(int) NEMR0ExportState(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 1298 1335 { 1299 1336 #if defined(NEM_WIN_WITH_RING0_RUNLOOP) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) … … 1304 1341 if (RT_SUCCESS(rc)) 1305 1342 { 1306 PVMCPU pVCpu = &pVM->aCpus[idCpu];1343 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1307 1344 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 1308 1345 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); … … 1339 1376 AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3); 1340 1377 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); 1378 #ifdef VBOX_BUGREF_9217 1379 Assert(pCtx == &pGVCpu->cpum.GstCtx); 1380 #else 1341 1381 Assert(pCtx == &pGVCpu->pVCpu->cpum.GstCtx); 1382 #endif 1342 1383 1343 1384 fWhat &= pCtx->fExtrn; … … 1507 1548 1508 1549 # ifdef LOG_ENABLED 1550 # ifdef VBOX_BUGREF_9217 1551 const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pGVM); 1552 # else 1509 1553 const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pGVM->pVM); 1554 # endif 1510 1555 # endif 1511 1556 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) … … 1571 1616 * Copy information to the CPUM context. 1572 1617 */ 1573 PVMCPU pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu]; 1618 # ifdef VBOX_BUGREF_9217 1619 PVMCPUCC pVCpu = pGVCpu; 1620 # else 1621 PVMCPUCC pVCpu = &pGVM->pVM->aCpus[pGVCpu->idCpu]; 1622 # endif 1574 1623 iReg = 0; 1575 1624 … … 2215 2264 * CPUMCTX_EXTERN_ALL for everything. 2216 2265 */ 2217 VMMR0_INT_DECL(int) NEMR0ImportState(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t fWhat)2266 VMMR0_INT_DECL(int) NEMR0ImportState(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t fWhat) 2218 2267 { 2219 2268 #if defined(NEM_WIN_WITH_RING0_RUNLOOP) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) … … 2224 2273 if (RT_SUCCESS(rc)) 2225 2274 { 2226 PVMCPU pVCpu = &pVM->aCpus[idCpu];2275 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 2227 2276 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2228 2277 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); … … 2299 2348 * hypercall page and arguments. 2300 2349 */ 2301 VMMR0_INT_DECL(int) NEMR0QueryCpuTick(PGVM pGVM, PVM pVM, VMCPUID idCpu)2350 VMMR0_INT_DECL(int) NEMR0QueryCpuTick(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 2302 2351 { 2303 2352 #if defined(NEM_WIN_WITH_RING0_RUNLOOP) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) … … 2308 2357 if (RT_SUCCESS(rc)) 2309 2358 { 2310 PVMCPU pVCpu = &pVM->aCpus[idCpu];2359 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 2311 2360 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2312 2361 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); … … 2409 2458 * @param uPausedTscValue The TSC value at the time of pausing. 2410 2459 */ 2411 VMMR0_INT_DECL(int) NEMR0ResumeCpuTickOnAll(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t uPausedTscValue)2460 VMMR0_INT_DECL(int) NEMR0ResumeCpuTickOnAll(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t uPausedTscValue) 2412 2461 { 2413 2462 #if defined(NEM_WIN_WITH_RING0_RUNLOOP) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) … … 2418 2467 if (RT_SUCCESS(rc)) 2419 2468 { 2420 PVMCPU pVCpu = &pVM->aCpus[idCpu];2469 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 2421 2470 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2422 2471 AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API); … … 2441 2490 #ifdef NEM_WIN_WITH_RING0_RUNLOOP 2442 2491 if (pGVM->nemr0.s.fMayUseRing0Runloop) 2443 { 2444 PVM pVM = pGVM->pVM; 2492 # ifdef VBOX_BUGREF_9217 2493 return nemHCWinRunGC(pGVM, &pGVM->aCpus[idCpu], pGVM, &pGVM->aCpus[idCpu]); 2494 # else 2495 { 2496 PVMCC pVM = pGVM->pVM; 2445 2497 return nemHCWinRunGC(pVM, &pVM->aCpus[idCpu], pGVM, &pGVM->aCpus[idCpu]); 2446 2498 } 2499 # endif 2447 2500 return VERR_NEM_RING3_ONLY; 2448 2501 #else … … 2462 2515 * page and arguments. 2463 2516 */ 2464 VMMR0_INT_DECL(int) NEMR0UpdateStatistics(PGVM pGVM, PVM pVM, VMCPUID idCpu)2517 VMMR0_INT_DECL(int) NEMR0UpdateStatistics(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 2465 2518 { 2466 2519 /* … … 2535 2588 * @param u64Arg What to query. 0 == registers. 2536 2589 */ 2537 VMMR0_INT_DECL(int) NEMR0DoExperiment(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64Arg)2590 VMMR0_INT_DECL(int) NEMR0DoExperiment(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, uint64_t u64Arg) 2538 2591 { 2539 2592 /* … … 2546 2599 2547 2600 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2548 PVMCPU pVCpu = &pVM->aCpus[idCpu];2601 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 2549 2602 if (u64Arg == 0) 2550 2603 { -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r80074 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_PDM_DEVICE 23 24 #define PDMPCIDEV_INCLUDE_PRIVATE /* Hack to get pdmpcidevint.h included at the right point. */ … … 26 27 #include <VBox/vmm/pgm.h> 27 28 #include <VBox/vmm/mm.h> 28 #include <VBox/vmm/vm .h>29 #include <VBox/vmm/vmcc.h> 29 30 #include <VBox/vmm/gvm.h> 30 31 #include <VBox/vmm/vmm.h> … … 60 61 * Internal Functions * 61 62 *********************************************************************************************************************************/ 62 static bool pdmR0IsaSetIrq(PVM pVM, int iIrq, int iLevel, uint32_t uTagSrc);63 static bool pdmR0IsaSetIrq(PVMCC pVM, int iIrq, int iLevel, uint32_t uTagSrc); 63 64 64 65 … … 132 133 LogFlow(("pdmR0DevHlp_PCISetIrq: caller=%p/%d: pPciDev=%p:{%#x} iIrq=%d iLevel=%d\n", 133 134 pDevIns, pDevIns->iInstance, pPciDev, pPciDev->uDevFn, iIrq, iLevel)); 134 PVM 135 PVMCC pVM = pDevIns->Internal.s.pVMR0; 135 136 PPDMPCIBUS pPciBus = pPciDev->Int.s.pPdmBusR0; 136 137 … … 185 186 PDMDEV_ASSERT_DEVINS(pDevIns); 186 187 LogFlow(("pdmR0DevHlp_ISASetIrq: caller=%p/%d: iIrq=%d iLevel=%d\n", pDevIns, pDevIns->iInstance, iIrq, iLevel)); 187 PVM pVM = pDevIns->Internal.s.pVMR0;188 PVMCC pVM = pDevIns->Internal.s.pVMR0; 188 189 189 190 pdmLock(pVM); … … 214 215 PDMDEV_ASSERT_DEVINS(pDevIns); 215 216 LogFlow(("pdmR0DevHlp_IoApicSendMsi: caller=%p/%d: GCPhys=%RGp uValue=%#x\n", pDevIns, pDevIns->iInstance, GCPhys, uValue)); 216 PVM pVM = pDevIns->Internal.s.pVMR0;217 PVMCC pVM = pDevIns->Internal.s.pVMR0; 217 218 218 219 uint32_t uTagSrc; … … 341 342 342 343 /** @interface_method_impl{PDMDEVHLPR0,pfnGetVM} */ 343 static DECLCALLBACK(PVM ) pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns)344 static DECLCALLBACK(PVMCC) pdmR0DevHlp_GetVM(PPDMDEVINS pDevIns) 344 345 { 345 346 PDMDEV_ASSERT_DEVINS(pDevIns); … … 350 351 351 352 /** @interface_method_impl{PDMDEVHLPR0,pfnGetVMCPU} */ 352 static DECLCALLBACK(PVMCPU ) pdmR0DevHlp_GetVMCPU(PPDMDEVINS pDevIns)353 static DECLCALLBACK(PVMCPUCC) pdmR0DevHlp_GetVMCPU(PPDMDEVINS pDevIns) 353 354 { 354 355 PDMDEV_ASSERT_DEVINS(pDevIns); … … 460 461 #ifdef VBOX_BUGREF_9217 461 462 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 462 PVMCPU pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */463 PVMCPUCC pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */ 463 464 #else 464 PVM pVM = pDevIns->Internal.s.pVMR0;465 PVMCPU pVCpu = &pVM->aCpus[0];/* for PIC we always deliver to CPU 0, MP use APIC */465 PVMCC pVM = pDevIns->Internal.s.pVMR0; 466 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); /* for PIC we always deliver to CPU 0, MP use APIC */ 466 467 #endif 467 468 /** @todo r=ramshankar: Propagating rcRZ and make all callers handle it? */ … … 476 477 #ifdef VBOX_BUGREF_9217 477 478 PGVM pGVM = (PGVM)pDevIns->Internal.s.pVMR0; 478 PVMCPU pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */479 PVMCPUCC pVCpu = &pGVM->aCpus[0]; /* for PIC we always deliver to CPU 0, MP use APIC */ 479 480 #else 480 PVM pVM = pDevIns->Internal.s.pVMR0;481 PVMCPU pVCpu = &pVM->aCpus[0];/* for PIC we always deliver to CPU 0, MP use APIC */481 PVMCC pVM = pDevIns->Internal.s.pVMR0; 482 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); /* for PIC we always deliver to CPU 0, MP use APIC */ 482 483 #endif 483 484 /** @todo r=ramshankar: Propagating rcRZ and make all callers handle it? */ … … 528 529 { 529 530 PDMDEV_ASSERT_DEVINS(pDevIns); 530 PVM pVM = pDevIns->Internal.s.pVMR0;531 PVMCC pVM = pDevIns->Internal.s.pVMR0; 531 532 LogFlow(("pdmR0IoApicHlp_ApicBusDeliver: caller=%p/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 uVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8 uTagSrc=%#x\n", 532 533 pDevIns, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, uVector, u8Polarity, u8TriggerMode, uTagSrc)); … … 577 578 PDMDEV_ASSERT_DEVINS(pDevIns); 578 579 Log4(("pdmR0PciHlp_IsaSetIrq: iIrq=%d iLevel=%d uTagSrc=%#x\n", iIrq, iLevel, uTagSrc)); 579 PVM pVM = pDevIns->Internal.s.pVMR0;580 PVMCC pVM = pDevIns->Internal.s.pVMR0; 580 581 581 582 pdmLock(pVM); … … 590 591 PDMDEV_ASSERT_DEVINS(pDevIns); 591 592 Log4(("pdmR0PciHlp_IoApicSetIrq: iIrq=%d iLevel=%d uTagSrc=%#x\n", iIrq, iLevel, uTagSrc)); 592 PVM pVM = pDevIns->Internal.s.pVMR0;593 PVMCC pVM = pDevIns->Internal.s.pVMR0; 593 594 594 595 if (pVM->pdm.s.IoApic.pDevInsR0) … … 619 620 PDMDEV_ASSERT_DEVINS(pDevIns); 620 621 Log4(("pdmR0PciHlp_IoApicSendMsi: GCPhys=%p uValue=%d uTagSrc=%#x\n", GCPhys, uValue, uTagSrc)); 621 PVM pVM = pDevIns->Internal.s.pVMR0;622 PVMCC pVM = pDevIns->Internal.s.pVMR0; 622 623 if (pVM->pdm.s.IoApic.pDevInsR0) 623 624 pVM->pdm.s.IoApic.pfnSendMsiR0(pVM->pdm.s.IoApic.pDevInsR0, GCPhys, uValue, uTagSrc); … … 801 802 * @remarks The caller holds the PDM lock. 802 803 */ 803 static bool pdmR0IsaSetIrq(PVM pVM, int iIrq, int iLevel, uint32_t uTagSrc)804 static bool pdmR0IsaSetIrq(PVMCC pVM, int iIrq, int iLevel, uint32_t uTagSrc) 804 805 { 805 806 if (RT_LIKELY( ( pVM->pdm.s.IoApic.pDevInsR0 … … 838 839 * @param pReq Pointer to the request buffer. 839 840 */ 840 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PGVM pGVM, PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq)841 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PGVM pGVM, PVMCC pVM, PPDMDEVICECALLREQHANDLERREQ pReq) 841 842 { 842 843 /* -
trunk/src/VBox/VMM/VMMR0/PDMR0Driver.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_PDM_DRIVER 23 24 #include "PDMInternal.h" 24 25 #include <VBox/vmm/pdm.h> 25 #include <VBox/vmm/vm .h>26 #include <VBox/vmm/vmcc.h> 26 27 #include <VBox/vmm/gvmm.h> 27 28 … … 40 41 * @param pReq Pointer to the request buffer. 41 42 */ 42 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PGVM pGVM, PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq)43 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PGVM pGVM, PVMCC pVM, PPDMDRIVERCALLREQHANDLERREQ pReq) 43 44 { 44 45 /* -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r78431 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_PGM 23 24 #include <VBox/rawpci.h> … … 25 26 #include <VBox/vmm/gmm.h> 26 27 #include "PGMInternal.h" 27 #include <VBox/vmm/vm .h>28 #include <VBox/vmm/vmcc.h> 28 29 #include <VBox/vmm/gvm.h> 29 30 #include "PGMInline.h" … … 71 72 * must clear the new pages. 72 73 */ 73 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu)74 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 74 75 { 75 76 /* … … 81 82 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 82 83 #else 83 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pVM->aCpus[idCpu]);84 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu)); 84 85 #endif 85 86 … … 198 199 * @remarks Must be called from within the PGM critical section. 199 200 */ 200 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, PVM pVM, VMCPUID idCpu)201 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 201 202 { 202 203 /* … … 208 209 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 209 210 #else 210 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pVM->aCpus[idCpu]);211 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu)); 211 212 #endif 212 213 … … 242 243 * must clear the new pages. 243 244 */ 244 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PGVM pGVM, PVM pVM, VMCPUID idCpu)245 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 245 246 { 246 247 /* … … 252 253 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pGVM->aCpus[idCpu]); 253 254 #else 254 PGM_LOCK_ASSERT_OWNER_EX(pVM, &pVM->aCpus[idCpu]);255 PGM_LOCK_ASSERT_OWNER_EX(pVM, VMCC_GET_CPU(pVM, idCpu)); 255 256 #endif 256 257 Assert(!pVM->pgm.s.cLargeHandyPages); … … 397 398 * @param pVM The cross context VM structure. 398 399 */ 399 VMMR0_INT_DECL(int) PGMR0PhysSetupIoMmu(PGVM pGVM, PVM pVM)400 VMMR0_INT_DECL(int) PGMR0PhysSetupIoMmu(PGVM pGVM, PVMCC pVM) 400 401 { 401 402 int rc = GVMMR0ValidateGVMandVM(pGVM, pVM); … … 459 460 * @param GCPhysFault The fault address. 460 461 */ 461 VMMR0DECL(int) PGMR0Trap0eHandlerNestedPaging(PVM pVM, PVMCPUpVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr,462 VMMR0DECL(int) PGMR0Trap0eHandlerNestedPaging(PVMCC pVM, PVMCPUCC pVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr, 462 463 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault) 463 464 { … … 588 589 * (VT-x). 589 590 */ 590 VMMR0DECL(VBOXSTRICTRC) PGMR0Trap0eHandlerNPMisconfig(PVM pVM, PVMCPUpVCpu, PGMMODE enmShwPagingMode,591 VMMR0DECL(VBOXSTRICTRC) PGMR0Trap0eHandlerNPMisconfig(PVMCC pVM, PVMCPUCC pVCpu, PGMMODE enmShwPagingMode, 591 592 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault, uint32_t uErr) 592 593 { -
trunk/src/VBox/VMM/VMMR0/PGMR0Bth.h
r76553 r80274 21 21 *******************************************************************************/ 22 22 RT_C_DECLS_BEGIN 23 PGM_BTH_DECL(int, Trap0eHandler)(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken);23 PGM_BTH_DECL(int, Trap0eHandler)(PVMCPUCC pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken); 24 24 RT_C_DECLS_END 25 25 -
trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
r78431 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_PGM_SHARED 23 24 #include <VBox/vmm/pgm.h> 24 25 #include <VBox/vmm/gmm.h> 25 26 #include "PGMInternal.h" 26 #include <VBox/vmm/vm .h>27 #include <VBox/vmm/vmcc.h> 27 28 #include <VBox/vmm/gvm.h> 28 29 #include "PGMInline.h" … … 49 50 * process. 50 51 */ 51 VMMR0DECL(int) PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PCRTGCPTR64 paRegionsGCPtrs)52 VMMR0DECL(int) PGMR0SharedModuleCheck(PVMCC pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, PCRTGCPTR64 paRegionsGCPtrs) 52 53 { 53 54 #ifdef VBOX_BUGREF_9217 54 PVMCPU pVCpu = &pGVM->aCpus[idCpu];55 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 55 56 #else 56 PVMCPU pVCpu = &pVM->aCpus[idCpu];57 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 57 58 #endif 58 59 int rc = VINF_SUCCESS; … … 172 173 #else 173 174 for (VMCPUID idCurCpu = 0; idCurCpu < pVM->cCpus; idCurCpu++) 174 CPUMSetChangedFlags( &pVM->aCpus[idCurCpu], CPUM_CHANGED_GLOBAL_TLB_FLUSH);175 CPUMSetChangedFlags(VMCC_GET_CPU(pVM, idCurCpu), CPUM_CHANGED_GLOBAL_TLB_FLUSH); 175 176 #endif 176 177 -
trunk/src/VBox/VMM/VMMR0/TRPMR0.cpp
r80015 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_TRPM 23 24 #include <VBox/vmm/trpm.h> 24 25 #include "TRPMInternal.h" 25 #include <VBox/vmm/vm .h>26 #include <VBox/vmm/vmcc.h> 26 27 #include <VBox/vmm/vmm.h> 27 28 #include <iprt/errcore.h> … … 42 43 * @remark Must be called with interrupts disabled. 43 44 */ 44 VMMR0DECL(void) TRPMR0DispatchHostInterrupt(PVM pVM)45 VMMR0DECL(void) TRPMR0DispatchHostInterrupt(PVMCC pVM) 45 46 { 46 47 /* 47 48 * Get the active interrupt vector number. 48 49 */ 49 PVMCPU pVCpu = VMMGetCpu0(pVM);50 PVMCPUCC pVCpu = VMMGetCpu0(pVM); 50 51 RTUINT uActiveVector = pVCpu->trpm.s.uActiveVector; 51 52 pVCpu->trpm.s.uActiveVector = UINT32_MAX; -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r80052 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_VMM 23 24 #include <VBox/vmm/vmm.h> … … 34 35 #include <VBox/vmm/tm.h> 35 36 #include "VMMInternal.h" 36 #include <VBox/vmm/vm .h>37 #include <VBox/vmm/vmcc.h> 37 38 #include <VBox/vmm/gvm.h> 38 39 #ifdef VBOX_WITH_PCI_PASSTHROUGH … … 366 367 * @thread EMT(0) 367 368 */ 368 static int vmmR0InitVM(PGVM pGVM, PVM pVM, uint32_t uSvnRev, uint32_t uBuildType)369 static int vmmR0InitVM(PGVM pGVM, PVMCC pVM, uint32_t uSvnRev, uint32_t uBuildType) 369 370 { 370 371 VMM_CHECK_SMAP_SETUP(); … … 396 397 */ 397 398 #ifdef VBOX_BUGREF_9217 398 PVMCPU pVCpu = &pGVM->aCpus[0];399 PVMCPUCC pVCpu = &pGVM->aCpus[0]; 399 400 #else 400 PVMCPU pVCpu = &pVM->aCpus[0];401 PVMCPUCC pVCpu = VMCC_GET_CPU_0(pVM); 401 402 #endif 402 403 … … 534 535 * @param idCpu The EMT that's calling. 535 536 */ 536 static int vmmR0InitVMEmt(PGVM pGVM, PVM pVM, VMCPUID idCpu)537 static int vmmR0InitVMEmt(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 537 538 { 538 539 /* Paranoia (caller checked these already). */ … … 545 546 */ 546 547 #ifdef VBOX_BUGREF_9217 547 PVMCPU pVCpu = &pGVM->aCpus[idCpu];548 PVMCPUCC pVCpu = &pGVM->aCpus[idCpu]; 548 549 #else 549 PVMCPU pVCpu = &pVM->aCpus[idCpu];550 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 550 551 #endif 551 552 PVMMR0LOGGER pR0Logger = pVCpu->vmm.s.pR0LoggerR0; … … 579 580 * @thread EMT(0) or session clean up thread. 580 581 */ 581 VMMR0_INT_DECL(int) VMMR0TermVM(PGVM pGVM, PVM pVM, VMCPUID idCpu)582 VMMR0_INT_DECL(int) VMMR0TermVM(PGVM pGVM, PVMCC pVM, VMCPUID idCpu) 582 583 { 583 584 /* … … 627 628 * @param enmInterruptibility Guest CPU interruptbility level. 628 629 */ 629 static int vmmR0DoHaltInterrupt(PVMCPU pVCpu, unsigned uMWait, CPUMINTERRUPTIBILITY enmInterruptibility)630 static int vmmR0DoHaltInterrupt(PVMCPUCC pVCpu, unsigned uMWait, CPUMINTERRUPTIBILITY enmInterruptibility) 630 631 { 631 632 Assert(!TRPMHasTrap(pVCpu)); … … 727 728 * parameters and statistics. 728 729 */ 729 static int vmmR0DoHalt(PGVM pGVM, PVM pVM, PGVMCPU pGVCpu, PVMCPUpVCpu)730 static int vmmR0DoHalt(PGVM pGVM, PVMCC pVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu) 730 731 { 731 732 #ifdef VBOX_BUGREF_9217 … … 908 909 static DECLCALLBACK(void) vmmR0ThreadCtxCallback(RTTHREADCTXEVENT enmEvent, void *pvUser) 909 910 { 910 PVMCPU pVCpu = (PVMCPU)pvUser;911 PVMCPUCC pVCpu = (PVMCPUCC)pvUser; 911 912 912 913 switch (enmEvent) … … 980 981 * @thread EMT(pVCpu) 981 982 */ 982 VMMR0_INT_DECL(int) VMMR0ThreadCtxHookCreateForEmt(PVMCPU pVCpu)983 VMMR0_INT_DECL(int) VMMR0ThreadCtxHookCreateForEmt(PVMCPUCC pVCpu) 983 984 { 984 985 VMCPU_ASSERT_EMT(pVCpu); … … 1009 1010 * @remarks Can be called from any thread. 1010 1011 */ 1011 VMMR0_INT_DECL(void) VMMR0ThreadCtxHookDestroyForEmt(PVMCPU pVCpu)1012 VMMR0_INT_DECL(void) VMMR0ThreadCtxHookDestroyForEmt(PVMCPUCC pVCpu) 1012 1013 { 1013 1014 int rc = RTThreadCtxHookDestroy(pVCpu->vmm.s.hCtxHook); … … 1026 1027 * this call. This means you have to be careful with what you do! 1027 1028 */ 1028 VMMR0_INT_DECL(void) VMMR0ThreadCtxHookDisable(PVMCPU pVCpu)1029 VMMR0_INT_DECL(void) VMMR0ThreadCtxHookDisable(PVMCPUCC pVCpu) 1029 1030 { 1030 1031 /* … … 1063 1064 * @param pVCpu The cross context virtual CPU structure. 1064 1065 */ 1065 DECLINLINE(bool) vmmR0ThreadCtxHookIsEnabled(PVMCPU pVCpu)1066 DECLINLINE(bool) vmmR0ThreadCtxHookIsEnabled(PVMCPUCC pVCpu) 1066 1067 { 1067 1068 return RTThreadCtxHookIsEnabled(pVCpu->vmm.s.hCtxHook); … … 1075 1076 * @param pVCpu The cross context virtual CPU structure. 1076 1077 */ 1077 VMMR0_INT_DECL(bool) VMMR0ThreadCtxHookIsEnabled(PVMCPU pVCpu)1078 VMMR0_INT_DECL(bool) VMMR0ThreadCtxHookIsEnabled(PVMCPUCC pVCpu) 1078 1079 { 1079 1080 return vmmR0ThreadCtxHookIsEnabled(pVCpu); … … 1088 1089 * @param rc The status code. 1089 1090 */ 1090 static void vmmR0RecordRC(PVM pVM, PVMCPUpVCpu, int rc)1091 static void vmmR0RecordRC(PVMCC pVM, PVMCPUCC pVCpu, int rc) 1091 1092 { 1092 1093 /* … … 1295 1296 * @remarks Assume called with interrupts _enabled_. 1296 1297 */ 1297 VMMR0DECL(void) VMMR0EntryFast(PGVM pGVM, PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation)1298 VMMR0DECL(void) VMMR0EntryFast(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation) 1298 1299 { 1299 1300 /* … … 1311 1312 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 1312 1313 #ifdef VBOX_BUGREF_9217 1313 PVMCPU pVCpu = pGVCpu;1314 PVMCPUCC pVCpu = pGVCpu; 1314 1315 #else 1315 PVMCPU pVCpu = &pVM->aCpus[idCpu];1316 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 1316 1317 #endif 1317 1318 RTNATIVETHREAD const hNativeThread = RTThreadNativeSelf(); … … 1581 1582 * @param pSession The session argument. 1582 1583 */ 1583 DECLINLINE(bool) vmmR0IsValidSession(PVM pVM, PSUPDRVSESSION pClaimedSession, PSUPDRVSESSION pSession)1584 DECLINLINE(bool) vmmR0IsValidSession(PVMCC pVM, PSUPDRVSESSION pClaimedSession, PSUPDRVSESSION pSession) 1584 1585 { 1585 1586 /* This must be set! */ … … 1613 1614 * @remarks Assume called with interrupts _enabled_. 1614 1615 */ 1615 static int vmmR0EntryExWorker(PGVM pGVM, PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation,1616 static int vmmR0EntryExWorker(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, 1616 1617 PSUPVMMR0REQHDR pReqHdr, uint64_t u64Arg, PSUPDRVSESSION pSession) 1617 1618 { … … 1656 1657 } 1657 1658 1659 #ifdef VBOX_BUGREF_9217 1660 if (RT_LIKELY( pVM->enmVMState >= VMSTATE_CREATING 1661 && pVM->enmVMState <= VMSTATE_TERMINATED 1662 && pVM->cCpus == pGVM->cCpus 1663 && pVM->pSession == pSession 1664 && pVM->pSelf == pVM)) 1665 #else 1658 1666 if (RT_LIKELY( pVM->enmVMState >= VMSTATE_CREATING 1659 1667 && pVM->enmVMState <= VMSTATE_TERMINATED … … 1661 1669 && pVM->pSession == pSession 1662 1670 && pVM->pVMR0 == pVM)) 1671 #endif 1663 1672 { /* likely */ } 1664 1673 else 1665 1674 { 1675 #ifdef VBOX_BUGREF_9217 1676 SUPR0Printf("vmmR0EntryExWorker: Invalid pVM=%p:{.enmVMState=%d, .cCpus=%#x(==%#x), .pSession=%p(==%p), .pSelf=%p(==%p)}! (op=%d)\n", 1677 pVM, pVM->enmVMState, pVM->cCpus, pGVM->cCpus, pVM->pSession, pSession, pVM->pSelf, pVM, enmOperation); 1678 #else 1666 1679 SUPR0Printf("vmmR0EntryExWorker: Invalid pVM=%p:{.enmVMState=%d, .cCpus=%#x(==%#x), .pSession=%p(==%p), .pVMR0=%p(==%p)}! (op=%d)\n", 1667 1680 pVM, pVM->enmVMState, pVM->cCpus, pGVM->cCpus, pVM->pSession, pSession, pVM->pVMR0, pVM, enmOperation); 1681 #endif 1668 1682 return VERR_INVALID_POINTER; 1669 1683 } … … 2228 2242 { 2229 2243 PGVM pGVM; 2230 PVM 2244 PVMCC pVM; 2231 2245 VMCPUID idCpu; 2232 2246 VMMR0OPERATION enmOperation; … … 2270 2284 * @remarks Assume called with interrupts _enabled_. 2271 2285 */ 2272 VMMR0DECL(int) VMMR0EntryEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation,2286 VMMR0DECL(int) VMMR0EntryEx(PGVM pGVM, PVMCC pVM, VMCPUID idCpu, VMMR0OPERATION enmOperation, 2273 2287 PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession) 2274 2288 { … … 2280 2294 && pGVM != NULL 2281 2295 && idCpu < pGVM->cCpus 2282 && pVM->pVMR0 != NULL) 2296 && pVM->pSession == pSession 2297 #ifdef VBOX_BUGREF_9217 2298 && pVM->pSelf != NULL 2299 #else 2300 && pVM->pVMR0 != NULL 2301 #endif 2302 ) 2283 2303 { 2284 2304 switch (enmOperation) … … 2296 2316 PGVMCPU pGVCpu = &pGVM->aCpus[idCpu]; 2297 2317 #ifdef VBOX_BUGREF_9217 2298 PVMCPU pVCpu = pGVCpu;2318 PVMCPUCC pVCpu = pGVCpu; 2299 2319 #else 2300 PVMCPU pVCpu = &pVM->aCpus[idCpu];2320 PVMCPUCC pVCpu = VMCC_GET_CPU(pVM, idCpu); 2301 2321 #endif 2302 2322 RTNATIVETHREAD hNativeThread = RTThreadNativeSelf(); … … 2337 2357 * @sa VMMIsLongJumpArmed 2338 2358 */ 2339 VMMR0_INT_DECL(bool) VMMR0IsLongJumpArmed(PVMCPU pVCpu)2359 VMMR0_INT_DECL(bool) VMMR0IsLongJumpArmed(PVMCPUCC pVCpu) 2340 2360 { 2341 2361 #ifdef RT_ARCH_X86 … … 2356 2376 * @thread EMT 2357 2377 */ 2358 VMMR0_INT_DECL(bool) VMMR0IsInRing3LongJump(PVMCPU pVCpu)2378 VMMR0_INT_DECL(bool) VMMR0IsInRing3LongJump(PVMCPUCC pVCpu) 2359 2379 { 2360 2380 return pVCpu->vmm.s.CallRing3JmpBufR0.fInRing3Call; … … 2388 2408 return; /* quietly */ 2389 2409 2390 PVM pVM = pR0Logger->pVM;2410 PVMCC pVM = pR0Logger->pVM; 2391 2411 if ( !VALID_PTR(pVM) 2392 || pVM->pVMR0 != pVM) 2412 # ifdef VBOX_BUGREF_9217 2413 || pVM->pSelf != pVM 2414 # else 2415 || pVM->pVMR0 != pVM 2416 # endif 2417 ) 2393 2418 { 2394 2419 # ifdef DEBUG 2420 # ifdef VBOX_BUGREF_9217 2421 SUPR0Printf("vmmR0LoggerFlush: pVM=%p! pSelf=%p! pLogger=%p\n", pVM, pVM->pSelf, pLogger); 2422 # else 2395 2423 SUPR0Printf("vmmR0LoggerFlush: pVM=%p! pVMR0=%p! pLogger=%p\n", pVM, pVM->pVMR0, pLogger); 2424 # endif 2396 2425 # endif 2397 2426 return; 2398 2427 } 2399 2428 2400 PVMCPU pVCpu = VMMGetCpu(pVM);2429 PVMCPUCC pVCpu = VMMGetCpu(pVM); 2401 2430 if (pVCpu) 2402 2431 { … … 2435 2464 * @param pVCpu The cross context virtual CPU structure. 2436 2465 */ 2437 VMMR0_INT_DECL(void) VMMR0LogFlushDisable(PVMCPU pVCpu)2466 VMMR0_INT_DECL(void) VMMR0LogFlushDisable(PVMCPUCC pVCpu) 2438 2467 { 2439 2468 if (pVCpu->vmm.s.pR0LoggerR0) … … 2449 2478 * @param pVCpu The cross context virtual CPU structure. 2450 2479 */ 2451 VMMR0_INT_DECL(void) VMMR0LogFlushEnable(PVMCPU pVCpu)2480 VMMR0_INT_DECL(void) VMMR0LogFlushEnable(PVMCPUCC pVCpu) 2452 2481 { 2453 2482 if (pVCpu->vmm.s.pR0LoggerR0) … … 2463 2492 * @param pVCpu The cross context virtual CPU structure. 2464 2493 */ 2465 VMMR0_INT_DECL(bool) VMMR0IsLogFlushDisabled(PVMCPU pVCpu)2494 VMMR0_INT_DECL(bool) VMMR0IsLogFlushDisabled(PVMCPUCC pVCpu) 2466 2495 { 2467 2496 if (pVCpu->vmm.s.pR0LoggerR0) … … 2483 2512 { 2484 2513 #ifdef VBOX_BUGREF_9217 2485 PVMCPU pVCpu = pGVCpu;2514 PVMCPUCC pVCpu = pGVCpu; 2486 2515 #else 2487 PVMCPU pVCpu = pGVCpu->pVCpu;2516 PVMCPUCC pVCpu = pGVCpu->pVCpu; 2488 2517 #endif 2489 2518 if (RT_VALID_PTR(pVCpu)) … … 2528 2557 return true; 2529 2558 #else 2530 PVM pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD);2559 PVMCC pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD); 2531 2560 if (pVM) 2532 2561 { 2533 PVMCPU pVCpu = VMMGetCpu(pVM);2562 PVMCPUCC pVCpu = VMMGetCpu(pVM); 2534 2563 2535 2564 if (pVCpu) … … 2578 2607 * To the global VMM buffer. 2579 2608 */ 2580 PVM pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD);2609 PVMCC pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD); 2581 2610 if (pVM) 2582 2611 RTStrPrintf(pVM->vmm.s.szRing0AssertMsg1, sizeof(pVM->vmm.s.szRing0AssertMsg1), … … 2641 2670 * Push it to the global VMM buffer. 2642 2671 */ 2643 PVM pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD);2672 PVMCC pVM = GVMMR0GetVMByEMT(NIL_RTNATIVETHREAD); 2644 2673 if (pVM) 2645 2674 { -
trunk/src/VBox/VMM/VMMRZ/CPUMRZ.cpp
r80064 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_CPUM 23 24 #include <VBox/vmm/cpum.h> -
trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 22 23 #define LOG_GROUP LOG_GROUP_DBGF 23 24 #include <VBox/vmm/dbgf.h> … … 28 29 #include <VBox/log.h> 29 30 #include "DBGFInternal.h" 30 #include <VBox/vmm/vm .h>31 #include <VBox/vmm/vmcc.h> 31 32 #include <VBox/err.h> 32 33 #include <iprt/assert.h> -
trunk/src/VBox/VMM/VMMRZ/VMMRZ.cpp
r76553 r80274 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VBOX_BUGREF_9217_PART_I 23 #define LOG_GROUP LOG_GROUP_VMM 22 24 #include <VBox/vmm/vmm.h> 23 25 #include "VMMInternal.h" 24 #include <VBox/vmm/vm .h>26 #include <VBox/vmm/vmcc.h> 25 27 #include <VBox/err.h> 26 28 … … 44 46 * @param uArg The argument to the operation. 45 47 */ 46 VMMRZDECL(int) VMMRZCallRing3(PVM pVM, PVMCPUpVCpu, VMMCALLRING3 enmOperation, uint64_t uArg)48 VMMRZDECL(int) VMMRZCallRing3(PVMCC pVM, PVMCPUCC pVCpu, VMMCALLRING3 enmOperation, uint64_t uArg) 47 49 { 48 50 VMCPU_ASSERT_EMT(pVCpu); … … 116 118 * @param uArg The argument to the operation. 117 119 */ 118 VMMRZDECL(int) VMMRZCallRing3NoCpu(PVM pVM, VMMCALLRING3 enmOperation, uint64_t uArg)120 VMMRZDECL(int) VMMRZCallRing3NoCpu(PVMCC pVM, VMMCALLRING3 enmOperation, uint64_t uArg) 119 121 { 120 122 return VMMRZCallRing3(pVM, VMMGetCpu(pVM), enmOperation, uArg); … … 128 130 * @thread EMT. 129 131 */ 130 VMMRZDECL(void) VMMRZCallRing3Disable(PVMCPU pVCpu)132 VMMRZDECL(void) VMMRZCallRing3Disable(PVMCPUCC pVCpu) 131 133 { 132 134 VMCPU_ASSERT_EMT(pVCpu); … … 164 166 * @thread EMT. 165 167 */ 166 VMMRZDECL(void) VMMRZCallRing3Enable(PVMCPU pVCpu)168 VMMRZDECL(void) VMMRZCallRing3Enable(PVMCPUCC pVCpu) 167 169 { 168 170 VMCPU_ASSERT_EMT(pVCpu); … … 198 200 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 199 201 */ 200 VMMRZDECL(bool) VMMRZCallRing3IsEnabled(PVMCPU pVCpu)202 VMMRZDECL(bool) VMMRZCallRing3IsEnabled(PVMCPUCC pVCpu) 201 203 { 202 204 VMCPU_ASSERT_EMT(pVCpu); … … 215 217 * @return VBox status code. 216 218 */ 217 VMMRZDECL(int) VMMRZCallRing3SetNotification(PVMCPU pVCpu, R0PTRTYPE(PFNVMMR0CALLRING3NOTIFICATION) pfnCallback, RTR0PTR pvUser)219 VMMRZDECL(int) VMMRZCallRing3SetNotification(PVMCPUCC pVCpu, R0PTRTYPE(PFNVMMR0CALLRING3NOTIFICATION) pfnCallback, RTR0PTR pvUser) 218 220 { 219 221 AssertPtrReturn(pVCpu, VERR_INVALID_POINTER); … … 234 236 * @param pVCpu The cross context virtual CPU structure. 235 237 */ 236 VMMRZDECL(void) VMMRZCallRing3RemoveNotification(PVMCPU pVCpu)238 VMMRZDECL(void) VMMRZCallRing3RemoveNotification(PVMCPUCC pVCpu) 237 239 { 238 240 pVCpu->vmm.s.pfnCallRing3CallbackR0 = NULL; … … 246 248 * @returns true if there the notification is active, false otherwise. 247 249 */ 248 VMMRZDECL(bool) VMMRZCallRing3IsNotificationSet(PVMCPU pVCpu)250 VMMRZDECL(bool) VMMRZCallRing3IsNotificationSet(PVMCPUCC pVCpu) 249 251 { 250 252 return pVCpu->vmm.s.pfnCallRing3CallbackR0 != NULL; -
trunk/src/VBox/VMM/include/HMInternal.h
r80268 r80274 675 675 * @param pVCpu Pointer to the cross context per-CPU structure. 676 676 */ 677 typedef DECLCALLBACK(int) FNHMVMXSTARTVM(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVM pVM, PVMCPUpVCpu);677 typedef DECLCALLBACK(int) FNHMVMXSTARTVM(RTHCUINT fResume, PCPUMCTX pCtx, void *pvUnused, PVMCC pVM, PVMCPUCC pVCpu); 678 678 /** Pointer to a VMX StartVM function. */ 679 679 typedef R0PTRTYPE(FNHMVMXSTARTVM *) PFNHMVMXSTARTVM; 680 680 681 681 /** SVM VMRun function. */ 682 typedef DECLCALLBACK(int) FNHMSVMVMRUN(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVM pVM, PVMCPUpVCpu);682 typedef DECLCALLBACK(int) FNHMSVMVMRUN(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVMCC pVM, PVMCPUCC pVCpu); 683 683 /** Pointer to a SVM VMRun function. */ 684 684 typedef R0PTRTYPE(FNHMSVMVMRUN *) PFNHMSVMVMRUN; -
trunk/src/VBox/VMM/include/NEMInternal.h
r76585 r80274 361 361 /** Hypercall input/ouput page. */ 362 362 NEMR0HYPERCALLDATA HypercallData; 363 # ifdef VBOX_BUGREF_9217 364 /** Delta to add to convert a ring-0 pointer to a ring-3 one. */ 365 uintptr_t offRing3ConversionDelta; 366 # endif 363 367 # else 364 368 uint32_t uDummy; … … 376 380 /** I/O control context. */ 377 381 PSUPR0IOCTLCTX pIoCtlCtx; 382 # ifndef VBOX_BUGREF_9217 378 383 /** Delta to add to convert a ring-0 pointer to a ring-3 one. */ 379 384 uintptr_t offRing3ConversionDelta; 385 # endif 380 386 /** Info about the VidGetHvPartitionId I/O control interface. */ 381 387 NEMWINIOCTL IoCtlGetHvPartitionId; -
trunk/src/VBox/VMM/include/PDMInternal.h
r78208 r80274 148 148 149 149 /** R0 pointer to the VM this instance was created for. */ 150 PVMR0pVMR0;150 R0PTRTYPE(PVMCC) pVMR0; 151 151 /** Associated PCI device list head (first is default). (R0 ptr) */ 152 152 R0PTRTYPE(PPDMPCIDEV) pHeadPciDevR0; … … 244 244 PVMR3 pVMR3; 245 245 /** Pointer to the VM this instance was created for, ring-0 context. */ 246 PVMR0pVMR0;246 R0PTRTYPE(PVMCC) pVMR0; 247 247 /** Pointer to the VM this instance was created for, raw-mode context. */ 248 248 PVMRC pVMRC; -
trunk/src/VBox/VMM/include/VMMInternal.h
r80019 r80274 75 75 { 76 76 /** Pointer to Pointer to the VM. */ 77 R0PTRTYPE(PVM )pVM;77 R0PTRTYPE(PVMCC) pVM; 78 78 /** Size of the allocated logger instance (Logger). */ 79 79 uint32_t cbLogger;
Note:
See TracChangeset
for help on using the changeset viewer.