Changeset 80274 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 14, 2019 2:34:38 PM (5 years ago)
- File:
-
- 1 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))
Note:
See TracChangeset
for help on using the changeset viewer.