VirtualBox

Changeset 80274 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 14, 2019 2:34:38 PM (5 years ago)
Author:
vboxsync
Message:

VMM: Refactoring VMMR0/* and VMMRZ/* to use VMCC & VMMCPUCC. bugref:9217

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h

    r80268 r80274  
    8787*   Internal Functions                                                                                                           *
    8888*********************************************************************************************************************************/
    89 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,
     89NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,
    9090                                           uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged);
    9191
     
    105105 * @param   fFlags      HV_MAP_GPA_XXX.
    106106 */
    107 DECLINLINE(int) nemHCWinHypercallMapPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, uint32_t fFlags)
     107DECLINLINE(int) nemHCWinHypercallMapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, uint32_t fFlags)
    108108{
    109109#ifdef IN_RING0
     
    133133 * @param   GCPhys      The page to unmap.  Does not need to be page aligned.
    134134 */
    135 DECLINLINE(int) nemHCWinHypercallUnmapPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys)
     135DECLINLINE(int) nemHCWinHypercallUnmapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys)
    136136{
    137137# ifdef IN_RING0
     
    149149#ifndef IN_RING0
    150150
    151 NEM_TMPL_STATIC int nemHCWinCopyStateToHyperV(PVM pVM, PVMCPU pVCpu)
     151NEM_TMPL_STATIC int nemHCWinCopyStateToHyperV(PVMCC pVM, PVMCPUCC pVCpu)
    152152{
    153153# if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
     
    483483
    484484
    485 NEM_TMPL_STATIC int nemHCWinCopyStateFromHyperV(PVM pVM, PVMCPU pVCpu, uint64_t fWhat)
     485NEM_TMPL_STATIC int nemHCWinCopyStateFromHyperV(PVMCC pVM, PVMCPUCC pVCpu, uint64_t fWhat)
    486486{
    487487# if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
     
    11251125 * @param   fWhat       What to import, CPUMCTX_EXTRN_XXX.
    11261126 */
    1127 VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPU pVCpu, uint64_t fWhat)
     1127VMM_INT_DECL(int) NEMImportStateOnDemand(PVMCPUCC pVCpu, uint64_t fWhat)
    11281128{
    11291129    STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatImportOnDemand);
     
    11321132# ifdef NEM_WIN_WITH_RING0_RUNLOOP
    11331133    /** @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
    11341137    PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf);
    11351138    AssertReturn(pGVM, VERR_INVALID_VMCPU_HANDLE);
     
    11391142
    11401143    return nemR0WinImportState(pGVM, &pGVM->aCpus[idCpu], &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/);
     1144#  endif
    11411145# else
    11421146    RT_NOREF(pVCpu, fWhat);
     
    11571161 * @param   puAux       Where to return the TSC_AUX register value.
    11581162 */
    1159 VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPU pVCpu, uint64_t *pcTicks, uint32_t *puAux)
     1163VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPUCC pVCpu, uint64_t *pcTicks, uint32_t *puAux)
    11601164{
    11611165    STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatQueryCpuTick);
    11621166
    11631167#ifdef IN_RING3
    1164     PVM pVM = pVCpu->CTX_SUFF(pVM);
     1168    PVMCC pVM = pVCpu->CTX_SUFF(pVM);
    11651169    VMCPU_ASSERT_EMT_RETURN(pVCpu, VERR_VM_THREAD_NOT_EMT);
    11661170    AssertReturn(VM_IS_NEM_ENABLED(pVM), VERR_NEM_IPE_9);
     
    11981202#else  /* IN_RING0 */
    11991203# ifdef NEM_WIN_WITH_RING0_RUNLOOP
     1204#  ifdef VBOX_BUGREF_9217
     1205    int rc = nemR0WinQueryCpuTick(pVCpu->pGVM, pVCpu, pcTicks, puAux);
     1206#  else
    12001207    /** @todo improve and secure this translation */
    12011208    PGVM pGVM = GVMMR0ByHandle(pVCpu->pVMR0->hSelf);
     
    12041211    ASMCompilerBarrier();
    12051212    AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_VMCPU_HANDLE);
    1206 
    12071213    int rc = nemR0WinQueryCpuTick(pGVM, &pGVM->aCpus[idCpu], pcTicks, puAux);
     1214#  endif
    12081215    if (RT_SUCCESS(rc) && puAux && !(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX))
    12091216        *puAux = CPUMGetGuestTscAux(pVCpu);
     
    12271234 * @param   uPausedTscValue The TSC value at the time of pausing.
    12281235 */
    1229 VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVM pVM, PVMCPU pVCpu, uint64_t uPausedTscValue)
     1236VMM_INT_DECL(int) NEMHCResumeCpuTickOnAll(PVMCC pVM, PVMCPUCC pVCpu, uint64_t uPausedTscValue)
    12301237{
    12311238#ifdef IN_RING0
    12321239# ifdef NEM_WIN_WITH_RING0_RUNLOOP
     1240#  ifdef VBOX_BUGREF_9217
     1241    return nemR0WinResumeCpuTickOnAll(pVM, pVCpu, uPausedTscValue);
     1242#  else
    12331243    /** @todo improve and secure this translation */
    12341244    PGVM pGVM = GVMMR0ByHandle(pVM->hSelf);
     
    12391249
    12401250    return nemR0WinResumeCpuTickOnAll(pGVM, &pGVM->aCpus[idCpu], uPausedTscValue);
     1251#  endif
    12411252# else
    12421253    RT_NOREF(pVM, pVCpu, uPausedTscValue);
     
    12961307# if defined(IN_RING0) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS)
    12971308/** Worker for assertion macro. */
    1298 NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPU pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue)
     1309NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue)
    12991310{
    13001311    RT_ZERO(*pRetValue);
     
    13361347# else
    13371348/** Worker for assertion macro. */
    1338 NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPU a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue)
     1349NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPUCC a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue)
    13391350{
    13401351    RT_ZERO(*pRetValue);
     
    13501361 * Get the virtual processor running status.
    13511362 */
    1352 DECLINLINE(VID_PROCESSOR_STATUS) nemHCWinCpuGetRunningStatus(PVMCPU pVCpu)
     1363DECLINLINE(VID_PROCESSOR_STATUS) nemHCWinCpuGetRunningStatus(PVMCPUCC pVCpu)
    13531364{
    13541365# ifdef IN_RING0
     
    13861397 *                          calling EMT.
    13871398 */
    1388 NEM_TMPL_STATIC int nemHCWinCancelRunVirtualProcessor(PVM pVM, PVMCPU pVCpu)
     1399NEM_TMPL_STATIC int nemHCWinCancelRunVirtualProcessor(PVMCC pVM, PVMCPUCC pVCpu)
    13891400{
    13901401    /*
     
    14481459 * Logs the current CPU state.
    14491460 */
    1450 NEM_TMPL_STATIC void nemHCWinLogState(PVM pVM, PVMCPU pVCpu)
     1461NEM_TMPL_STATIC void nemHCWinLogState(PVMCC pVM, PVMCPUCC pVCpu)
    14511462{
    14521463    if (LogIs3Enabled())
     
    15651576 */
    15661577DECLINLINE(void)
    1567 nemHCWinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, uint8_t cbMinInstr)
     1578nemHCWinAdvanceGuestRipAndClearRF(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, uint8_t cbMinInstr)
    15681579{
    15691580    Assert(!(pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS)));
     
    15901601 * @param   cbMinInstr      The minimum instruction length, or 1 if not unknown.
    15911602 */
    1592 DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPU pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx, uint8_t cbMinInstr)
     1603DECLINLINE(void) nemR3WinAdvanceGuestRipAndClearRF(PVMCPUCC pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx, uint8_t cbMinInstr)
    15931604{
    15941605    Assert(!(pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS)));
     
    16101621
    16111622NEM_TMPL_STATIC DECLCALLBACK(int)
    1612 nemHCWinUnmapOnePageCallback(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, uint8_t *pu2NemState, void *pvUser)
     1623nemHCWinUnmapOnePageCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, uint8_t *pu2NemState, void *pvUser)
    16131624{
    16141625    RT_NOREF_PV(pvUser);
     
    16631674 */
    16641675NEM_TMPL_STATIC DECLCALLBACK(int)
    1665 nemHCWinHandleMemoryAccessPageCheckerCallback(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, PPGMPHYSNEMPAGEINFO pInfo, void *pvUser)
     1676nemHCWinHandleMemoryAccessPageCheckerCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, PPGMPHYSNEMPAGEINFO pInfo, void *pvUser)
    16661677{
    16671678    NEMHCWINHMACPCCSTATE *pState = (NEMHCWINHMACPCCSTATE *)pvUser;
     
    18481859 * @param   pszCaller       Who is doing the importing.
    18491860 */
    1850 DECLINLINE(VBOXSTRICTRC) nemR0WinImportStateStrict(PGVM pGVM, PGVMCPU pGVCpu, PVMCPU pVCpu, uint64_t fWhat, const char *pszCaller)
     1861DECLINLINE(VBOXSTRICTRC) nemR0WinImportStateStrict(PGVM pGVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu, uint64_t fWhat, const char *pszCaller)
    18511862{
    18521863    int rc = nemR0WinImportState(pGVM, pGVCpu, &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/);
     
    18791890 * @param   pszCaller       Who is doing the importing.
    18801891 */
    1881 DECLINLINE(VBOXSTRICTRC) nemHCWinImportStateIfNeededStrict(PVMCPU pVCpu, PGVMCPU pGVCpu, uint64_t fWhat, const char *pszCaller)
     1892DECLINLINE(VBOXSTRICTRC) nemHCWinImportStateIfNeededStrict(PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint64_t fWhat, const char *pszCaller)
    18821893{
    18831894    if (pVCpu->cpum.GstCtx.fExtrn & fWhat)
     
    19051916 * @sa      nemR3WinCopyStateFromX64Header
    19061917 */
    1907 DECLINLINE(void) nemHCWinCopyStateFromX64Header(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pHdr)
     1918DECLINLINE(void) nemHCWinCopyStateFromX64Header(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pHdr)
    19081919{
    19091920    Assert(   (pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_NEM_WIN_INHIBIT_INT))
     
    19361947 * @sa      nemHCWinCopyStateFromX64Header
    19371948 */
    1938 DECLINLINE(void) nemR3WinCopyStateFromX64Header(PVMCPU pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx)
     1949DECLINLINE(void) nemR3WinCopyStateFromX64Header(PVMCPUCC pVCpu, WHV_VP_EXIT_CONTEXT const *pExitCtx)
    19391950{
    19401951    Assert(   (pVCpu->cpum.GstCtx.fExtrn & (CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RFLAGS | CPUMCTX_EXTRN_CS | CPUMCTX_EXTRN_NEM_WIN_INHIBIT_INT))
     
    19721983 */
    19731984NEM_TMPL_STATIC VBOXSTRICTRC
    1974 nemHCWinHandleMessageMemory(PVM pVM, PVMCPU pVCpu, HV_X64_MEMORY_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
     1985nemHCWinHandleMessageMemory(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_MEMORY_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
    19751986{
    19761987    uint64_t const uHostTsc = ASMReadTSC();
     
    20982109 */
    20992110NEM_TMPL_STATIC VBOXSTRICTRC
    2100 nemR3WinHandleExitMemory(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     2111nemR3WinHandleExitMemory(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    21012112{
    21022113    uint64_t const uHostTsc = ASMReadTSC();
     
    21962207 */
    21972208NEM_TMPL_STATIC VBOXSTRICTRC
    2198 nemHCWinHandleMessageIoPort(PVM pVM, PVMCPU pVCpu, HV_X64_IO_PORT_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
     2209nemHCWinHandleMessageIoPort(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_IO_PORT_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
    21992210{
    22002211    /*
     
    24112422 * @sa      nemHCWinHandleMessageIoPort
    24122423 */
    2413 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitIoPort(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     2424NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitIoPort(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    24142425{
    24152426    Assert(   pExit->IoPortAccess.AccessInfo.AccessSize == 1
     
    25792590 */
    25802591NEM_TMPL_STATIC VBOXSTRICTRC
    2581 nemHCWinHandleMessageInterruptWindow(PVM pVM, PVMCPU pVCpu, HV_X64_INTERRUPT_WINDOW_MESSAGE const *pMsg, PGVMCPU pGVCpu)
     2592nemHCWinHandleMessageInterruptWindow(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_INTERRUPT_WINDOW_MESSAGE const *pMsg, PGVMCPU pGVCpu)
    25822593{
    25832594    /*
     
    26142625 * @sa      nemHCWinHandleMessageInterruptWindow
    26152626 */
    2616 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitInterruptWindow(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     2627NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitInterruptWindow(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    26172628{
    26182629    /*
     
    26532664 * @sa      nemR3WinHandleExitCpuId
    26542665 */
    2655 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVM pVM, PVMCPU pVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg,
     2666NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageCpuId(PVMCC pVM, PVMCPUCC pVCpu, HV_X64_CPUID_INTERCEPT_MESSAGE const *pMsg,
    26562667                                                        PGVMCPU pGVCpu)
    26572668{
     
    27452756 */
    27462757NEM_TMPL_STATIC VBOXSTRICTRC
    2747 nemR3WinHandleExitCpuId(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     2758nemR3WinHandleExitCpuId(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    27482759{
    27492760    PCEMEXITREC pExitRec = EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FT(EMEXIT_F_KIND_EM, EMEXITTYPE_CPUID),
     
    28202831 * @sa      nemR3WinHandleExitMsr
    28212832 */
    2822 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageMsr(PVMCPU pVCpu, HV_X64_MSR_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
     2833NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleMessageMsr(PVMCPUCC pVCpu, HV_X64_MSR_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
    28232834{
    28242835    /*
     
    29722983 * @sa      nemHCWinHandleMessageMsr
    29732984 */
    2974 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitMsr(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     2985NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitMsr(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    29752986{
    29762987    /*
     
    31683179 */
    31693180DECLINLINE(void)
    3170 nemHCWinCopyStateFromExceptionMessage(PVMCPU pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, bool fClearXcpt)
     3181nemHCWinCopyStateFromExceptionMessage(PVMCPUCC pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, bool fClearXcpt)
    31713182{
    31723183    nemHCWinCopyStateFromX64Header(pVCpu, &pMsg->Header);
     
    32003211 * @param   fClearXcpt      Clear pending exception.
    32013212 */
    3202 DECLINLINE(void) nemR3WinCopyStateFromExceptionMessage(PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, bool fClearXcpt)
     3213DECLINLINE(void) nemR3WinCopyStateFromExceptionMessage(PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit, bool fClearXcpt)
    32033214{
    32043215    nemR3WinCopyStateFromX64Header(pVCpu, &pExit->VpContext);
     
    32203231 */
    32213232NEM_TMPL_STATIC VBOXSTRICTRC
    3222 nemHCWinHandleMessageException(PVMCPU pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
     3233nemHCWinHandleMessageException(PVMCPUCC pVCpu, HV_X64_EXCEPTION_INTERCEPT_MESSAGE const *pMsg, PGVMCPU pGVCpu)
    32233234{
    32243235    /*
     
    33473358 * @sa      nemR3WinHandleExitException
    33483359 */
    3349 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitException(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     3360NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitException(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    33503361{
    33513362    /*
     
    34563467 */
    34573468NEM_TMPL_STATIC VBOXSTRICTRC
    3458 nemHCWinHandleMessageUnrecoverableException(PVMCPU pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, PGVMCPU pGVCpu)
     3469nemHCWinHandleMessageUnrecoverableException(PVMCPUCC pVCpu, HV_X64_INTERCEPT_MESSAGE_HEADER const *pMsgHdr, PGVMCPU pGVCpu)
    34593470{
    34603471    /* Check message register value sanity. */
     
    35143525 * @sa      nemHCWinHandleMessageUnrecoverableException
    35153526 */
    3516 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitUnrecoverableException(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     3527NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExitUnrecoverableException(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    35173528{
    35183529# if 0
     
    35743585 */
    35753586NEM_TMPL_STATIC VBOXSTRICTRC
    3576 nemHCWinHandleMessage(PVM pVM, PVMCPU pVCpu, VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader, PGVMCPU pGVCpu)
     3587nemHCWinHandleMessage(PVMCC pVM, PVMCPUCC pVCpu, VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader, PGVMCPU pGVCpu)
    35773588{
    35783589    if (pMappingHeader->enmVidMsgType == VidMessageHypervisorMessage)
     
    36683679 * @sa      nemHCWinHandleMessage
    36693680 */
    3670 NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExit(PVM pVM, PVMCPU pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
     3681NEM_TMPL_STATIC VBOXSTRICTRC nemR3WinHandleExit(PVMCC pVM, PVMCPUCC pVCpu, WHV_RUN_VP_EXIT_CONTEXT const *pExit)
    36713682{
    36723683    switch (pExit->ExitReason)
     
    37383749 * @param   cMillies        The timeout in milliseconds
    37393750 */
    3740 static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, PVMCPU pVCpu,
     3751static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, PVMCPUCC pVCpu,
    37413752                                                               uint32_t fFlags, uint32_t cMillies)
    37423753{
     
    37443755    pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags   = fFlags;
    37453756    pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies;
    3746     NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
     3757    NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
    37473758                                            &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext,
    37483759                                            pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput,
     
    37683779        pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags   = fFlags & ~VID_MSHAGN_F_HANDLE_MESSAGE;
    37693780        pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies;
    3770         rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
     3781        rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
    37713782                                       &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext,
    37723783                                       pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput,
     
    37983809 * @param   pGVCpu          The global (ring-0) per CPU structure (NULL in r3).
    37993810 */
    3800 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinStopCpu(PVM pVM, PVMCPU pVCpu, VBOXSTRICTRC rcStrict,
     3811NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinStopCpu(PVMCC pVM, PVMCPUCC pVCpu, VBOXSTRICTRC rcStrict,
    38013812                                             VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader,
    38023813                                             PGVM pGVM, PGVMCPU pGVCpu)
     
    38133824# ifdef IN_RING0
    38143825    pVCpu->nem.s.uIoCtlBuf.idCpu = pGVCpu->idCpu;
    3815     NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlStopVirtualProcessor.uFunction,
     3826    NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlStopVirtualProcessor.uFunction,
    38163827                                            &pVCpu->nem.s.uIoCtlBuf.idCpu, sizeof(pVCpu->nem.s.uIoCtlBuf.idCpu),
    38173828                                            NULL, 0);
     
    39513962 * @param   pfInterruptWindows  Where to return interrupt window flags.
    39523963 */
    3953 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleInterruptFF(PVM pVM, PVMCPU pVCpu, PGVMCPU pGVCpu, uint8_t *pfInterruptWindows)
     3964NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinHandleInterruptFF(PVMCC pVM, PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint8_t *pfInterruptWindows)
    39543965{
    39553966    Assert(!TRPMHasTrap(pVCpu));
     
    40594070 * @param   pGVCpu          The ring-0 per CPU structure (NULL in ring-3).
    40604071 */
    4061 NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinRunGC(PVM pVM, PVMCPU pVCpu, PGVM pGVM, PGVMCPU pGVCpu)
     4072NEM_TMPL_STATIC VBOXSTRICTRC nemHCWinRunGC(PVMCC pVM, PVMCPUCC pVCpu, PGVM pGVM, PGVMCPU pGVCpu)
    40624073{
    40634074    LogFlow(("NEM/%u: %04x:%08RX64 efl=%#08RX64 <=\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, pVCpu->cpum.GstCtx.rip, pVCpu->cpum.GstCtx.rflags));
     
    41984209#  ifdef IN_RING0
    41994210                pVCpu->nem.s.uIoCtlBuf.idCpu = pGVCpu->idCpu;
    4200                 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlStartVirtualProcessor.uFunction,
     4211                NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlStartVirtualProcessor.uFunction,
    42014212                                                        &pVCpu->nem.s.uIoCtlBuf.idCpu, sizeof(pVCpu->nem.s.uIoCtlBuf.idCpu),
    42024213                                                        NULL, 0);
     
    42354246                pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags   = pVCpu->nem.s.fHandleAndGetFlags;
    42364247                pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMsWait;
    4237                 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
     4248                NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
    42384249                                                        &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext,
    42394250                                                        pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput,
     
    44124423 * @callback_method_impl{FNPGMPHYSNEMCHECKPAGE}
    44134424 */
    4414 NEM_TMPL_STATIC DECLCALLBACK(int) nemHCWinUnsetForA20CheckerCallback(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys,
     4425NEM_TMPL_STATIC DECLCALLBACK(int) nemHCWinUnsetForA20CheckerCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys,
    44154426                                                                     PPGMPHYSNEMPAGEINFO pInfo, void *pvUser)
    44164427{
     
    44564467 * @param   GCPhys          The page to unmap.
    44574468 */
    4458 NEM_TMPL_STATIC int nemHCWinUnmapPageForA20Gate(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys)
     4469NEM_TMPL_STATIC int nemHCWinUnmapPageForA20Gate(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys)
    44594470{
    44604471    PGMPHYSNEMPAGEINFO Info;
     
    44644475
    44654476
    4466 void nemHCNativeNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb)
     4477void nemHCNativeNotifyHandlerPhysicalRegister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb)
    44674478{
    44684479    Log5(("nemHCNativeNotifyHandlerPhysicalRegister: %RGp LB %RGp enmKind=%d\n", GCPhys, cb, enmKind));
     
    44714482
    44724483
    4473 void nemHCNativeNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
     4484void nemHCNativeNotifyHandlerPhysicalDeregister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
    44744485                                                int fRestoreAsRAM, bool fRestoreAsRAM2)
    44754486{
     
    44804491
    44814492
    4482 void nemHCNativeNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,
     4493void nemHCNativeNotifyHandlerPhysicalModify(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld,
    44834494                                            RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM)
    44844495{
     
    45074518 * @thread  EMT(pVCpu)
    45084519 */
    4509 NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,
     4520NEM_TMPL_STATIC int nemHCNativeSetPhysPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst,
    45104521                                           uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged)
    45114522{
     
    47274738
    47284739
    4729 NEM_TMPL_STATIC int nemHCJustUnmapPageFromHyperV(PVM pVM, RTGCPHYS GCPhysDst, uint8_t *pu2State)
     4740NEM_TMPL_STATIC int nemHCJustUnmapPageFromHyperV(PVMCC pVM, RTGCPHYS GCPhysDst, uint8_t *pu2State)
    47304741{
    47314742    if (*pu2State <= NEM_WIN_PAGE_STATE_UNMAPPED)
     
    47374748
    47384749#if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0)
    4739     PVMCPU pVCpu = VMMGetCpu(pVM);
     4750    PVMCPUCC pVCpu = VMMGetCpu(pVM);
    47404751    int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhysDst);
    47414752    AssertRC(rc);
     
    47654776
    47664777
    4767 int nemHCNativeNotifyPhysPageAllocated(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
     4778int nemHCNativeNotifyPhysPageAllocated(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
    47684779                                       PGMPAGETYPE enmType, uint8_t *pu2State)
    47694780{
     
    47744785    int rc;
    47754786#if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0)
    4776     PVMCPU pVCpu = VMMGetCpu(pVM);
     4787    PVMCPUCC pVCpu = VMMGetCpu(pVM);
    47774788    if (   pVM->nem.s.fA20Enabled
    47784789        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
     
    48004811
    48014812
    4802 void nemHCNativeNotifyPhysPageProtChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
     4813void nemHCNativeNotifyPhysPageProtChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt,
    48034814                                          PGMPAGETYPE enmType, uint8_t *pu2State)
    48044815{
     
    48084819
    48094820#if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0)
    4810     PVMCPU pVCpu = VMMGetCpu(pVM);
     4821    PVMCPUCC pVCpu = VMMGetCpu(pVM);
    48114822    if (   pVM->nem.s.fA20Enabled
    48124823        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
     
    48314842
    48324843
    4833 void nemHCNativeNotifyPhysPageChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,
     4844void nemHCNativeNotifyPhysPageChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew,
    48344845                                     uint32_t fPageProt, PGMPAGETYPE enmType, uint8_t *pu2State)
    48354846{
     
    48394850
    48404851#if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING0)
    4841     PVMCPU pVCpu = VMMGetCpu(pVM);
     4852    PVMCPUCC pVCpu = VMMGetCpu(pVM);
    48424853    if (   pVM->nem.s.fA20Enabled
    48434854        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette