VirtualBox

Ignore:
Timestamp:
Jan 19, 2022 11:35:13 PM (3 years ago)
Author:
vboxsync
Message:

VMM/NEM-win: Kicked out most of the ring-0 code because bugref:10118 + bugref:10162 means we won't use it again.

File:
1 edited

Legend:

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

    r93305 r93351  
    105105
    106106
    107 #ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    108 
    109 /**
    110  * Wrapper around VMMR0_DO_NEM_MAP_PAGES for a single page.
    111  *
    112  * @returns VBox status code.
    113  * @param   pVM         The cross context VM structure.
    114  * @param   pVCpu       The cross context virtual CPU structure of the caller.
    115  * @param   GCPhysSrc   The source page.  Does not need to be page aligned.
    116  * @param   GCPhysDst   The destination page.  Same as @a GCPhysSrc except for
    117  *                      when A20 is disabled.
    118  * @param   fFlags      HV_MAP_GPA_XXX.
    119  */
    120 DECLINLINE(int) nemHCWinHypercallMapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhysSrc, RTGCPHYS GCPhysDst, uint32_t fFlags)
    121 {
    122 #ifdef IN_RING0
    123     /** @todo optimize further, caller generally has the physical address. */
    124     return nemR0WinMapPages(pVM, pVCpu,
    125                             GCPhysSrc & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK,
    126                             GCPhysDst & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK,
    127                             1, fFlags);
    128 #else
    129     pVCpu->nem.s.Hypercall.MapPages.GCPhysSrc   = GCPhysSrc & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK;
    130     pVCpu->nem.s.Hypercall.MapPages.GCPhysDst   = GCPhysDst & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK;
    131     pVCpu->nem.s.Hypercall.MapPages.cPages      = 1;
    132     pVCpu->nem.s.Hypercall.MapPages.fFlags      = fFlags;
    133     return VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_MAP_PAGES, 0, NULL);
    134 #endif
    135 }
    136 
    137 
    138 /**
    139  * Wrapper around VMMR0_DO_NEM_UNMAP_PAGES for a single page.
    140  *
    141  * @returns VBox status code.
    142  * @param   pVM         The cross context VM structure.
    143  * @param   pVCpu       The cross context virtual CPU structure of the caller.
    144  * @param   GCPhys      The page to unmap.  Does not need to be page aligned.
    145  */
    146 DECLINLINE(int) nemHCWinHypercallUnmapPage(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys)
    147 {
    148 # ifdef IN_RING0
    149     return nemR0WinUnmapPages(pVM, pVCpu, GCPhys & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK, 1);
    150 # else
    151     pVCpu->nem.s.Hypercall.UnmapPages.GCPhys    = GCPhys & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK;
    152     pVCpu->nem.s.Hypercall.UnmapPages.cPages    = 1;
    153     return VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_UNMAP_PAGES, 0, NULL);
    154 # endif
    155 }
    156 
    157 #endif /* NEM_WIN_USE_HYPERCALLS_FOR_PAGES */
    158107#ifndef IN_RING0
    159108
    160109NEM_TMPL_STATIC int nemHCWinCopyStateToHyperV(PVMCC pVM, PVMCPUCC pVCpu)
    161110{
    162 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
    163 #  if !defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) && defined(NEM_WIN_WITH_RING0_RUNLOOP)
    164     if (pVM->nem.s.fUseRing0Runloop)
    165 #  endif
    166     {
    167         int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_EXPORT_STATE, 0, NULL);
    168         AssertLogRelRCReturn(rc, rc);
    169         return rc;
    170     }
    171 # endif
    172 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS
    173 
    174111    /*
    175112     * The following is very similar to what nemR0WinExportState() does.
     
    492429#  undef ADD_REG128
    493430#  undef ADD_SEG
    494 
    495 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS */
    496431}
    497432
     
    499434NEM_TMPL_STATIC int nemHCWinCopyStateFromHyperV(PVMCC pVM, PVMCPUCC pVCpu, uint64_t fWhat)
    500435{
    501 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
    502 #  if !defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) && defined(NEM_WIN_WITH_RING0_RUNLOOP)
    503     if (pVM->nem.s.fUseRing0Runloop)
    504 #  endif
    505     {
    506         /* See NEMR0ImportState */
    507         int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_IMPORT_STATE, fWhat, NULL);
    508         if (RT_SUCCESS(rc))
    509             return rc;
    510         if (rc == VERR_NEM_FLUSH_TLB)
    511         {
    512             rc = PGMFlushTLB(pVCpu, pVCpu->cpum.GstCtx.cr3, true /*fGlobal*/);
    513             return rc;
    514         }
    515         AssertLogRelRCReturn(rc, rc);
    516         return rc;
    517     }
    518 # endif
    519 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS
    520436    WHV_REGISTER_NAME  aenmNames[128];
    521437
     
    11381054
    11391055    return VINF_SUCCESS;
    1140 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS */
    11411056}
    11421057
     
    11561071
    11571072#ifdef IN_RING0
    1158 # ifdef NEM_WIN_WITH_RING0_RUNLOOP
    1159     return nemR0WinImportState(pVCpu->pGVM, pVCpu, &pVCpu->cpum.GstCtx, fWhat, true /*fCanUpdateCr3*/);
    1160 # else
    11611073    RT_NOREF(pVCpu, fWhat);
    11621074    return VERR_NOT_IMPLEMENTED;
    1163 # endif
    11641075#else
    11651076    return nemHCWinCopyStateFromHyperV(pVCpu->pVMR3, pVCpu, fWhat);
     
    11851096    AssertReturn(VM_IS_NEM_ENABLED(pVM), VERR_NEM_IPE_9);
    11861097
    1187 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
    1188 #  if !defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) && defined(NEM_WIN_WITH_RING0_RUNLOOP)
    1189     if (pVM->nem.s.fUseRing0Runloop)
    1190 #  endif
    1191     {
    1192         /* Call ring-0 and get the values. */
    1193         int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_QUERY_CPU_TICK, 0, NULL);
    1194         AssertLogRelRCReturn(rc, rc);
    1195         *pcTicks = pVCpu->nem.s.Hypercall.QueryCpuTick.cTicks;
    1196         if (puAux)
    1197             *puAux = pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX
    1198                    ? pVCpu->nem.s.Hypercall.QueryCpuTick.uAux : CPUMGetGuestTscAux(pVCpu);
    1199         return VINF_SUCCESS;
    1200     }
    1201 # endif
    1202 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS
    12031098    /* Call the offical API. */
    12041099    WHV_REGISTER_NAME  aenmNames[2] = { WHvX64RegisterTsc, WHvX64RegisterTscAux };
     
    12141109        *pcTicks = pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX ? aValues[0].Reg64 : CPUMGetGuestTscAux(pVCpu);
    12151110    return VINF_SUCCESS;
    1216 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS */
    12171111#else  /* IN_RING0 */
    1218 # ifdef NEM_WIN_WITH_RING0_RUNLOOP
    1219     int rc = nemR0WinQueryCpuTick(pVCpu->pGVM, pVCpu, pcTicks, puAux);
    1220     if (RT_SUCCESS(rc) && puAux && !(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX))
    1221         *puAux = CPUMGetGuestTscAux(pVCpu);
    1222     return rc;
    1223 # else
    12241112    RT_NOREF(pVCpu, pcTicks, puAux);
    12251113    return VERR_NOT_IMPLEMENTED;
    1226 # endif
    12271114#endif /* IN_RING0 */
    12281115}
     
    12421129{
    12431130#ifdef IN_RING0
    1244 # ifdef NEM_WIN_WITH_RING0_RUNLOOP
    1245     return nemR0WinResumeCpuTickOnAll(pVM, pVCpu, uPausedTscValue);
    1246 # else
    12471131    RT_NOREF(pVM, pVCpu, uPausedTscValue);
    12481132    return VERR_NOT_IMPLEMENTED;
    1249 # endif
    12501133#else  /* IN_RING3 */
    12511134    VMCPU_ASSERT_EMT_RETURN(pVCpu, VERR_VM_THREAD_NOT_EMT);
    12521135    AssertReturn(VM_IS_NEM_ENABLED(pVM), VERR_NEM_IPE_9);
    12531136
    1254 # if defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
    1255 #  if !defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS) && defined(NEM_WIN_WITH_RING0_RUNLOOP)
    1256     if (pVM->nem.s.fUseRing0Runloop)
    1257 #  endif
    1258     {
    1259         /* Call ring-0 and do it all there. */
    1260         return VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_NEM_RESUME_CPU_TICK_ON_ALL, uPausedTscValue, NULL);
    1261     }
    1262 # endif
    1263 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS
    12641137    /*
    12651138     * Call the offical API to do the job.
     
    12941167
    12951168    return VINF_SUCCESS;
    1296 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS */
    12971169#endif /* IN_RING3 */
    12981170}
    1299 
    1300 #ifdef NEMWIN_NEED_GET_REGISTER
    1301 # if defined(IN_RING0) || defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS)
    1302 /** Worker for assertion macro. */
    1303 NEM_TMPL_STATIC int nemHCWinGetRegister(PVMCPUCC pVCpu, PGVMCPU pGVCpu, uint32_t enmReg, HV_REGISTER_VALUE *pRetValue)
    1304 {
    1305     RT_ZERO(*pRetValue);
    1306 #  ifdef IN_RING3
    1307     RT_NOREF(pVCpu, pGVCpu, enmReg);
    1308     return VERR_NOT_IMPLEMENTED;
    1309 #  else
    1310     NOREF(pVCpu);
    1311 
    1312     /*
    1313      * Hypercall parameters.
    1314      */
    1315     HV_INPUT_GET_VP_REGISTERS *pInput = (HV_INPUT_GET_VP_REGISTERS *)pGVCpu->nem.s.HypercallData.pbPage;
    1316     AssertPtrReturn(pInput, VERR_INTERNAL_ERROR_3);
    1317     AssertReturn(g_pfnHvlInvokeHypercall, VERR_NEM_MISSING_KERNEL_API);
    1318 
    1319     pInput->PartitionId = pVCpu->pGVM->nemr0.s.idHvPartition;
    1320     pInput->VpIndex     = pVCpu->idCpu;
    1321     pInput->fFlags      = 0;
    1322     pInput->Names[0]    = (HV_REGISTER_NAME)enmReg;
    1323 
    1324     size_t const cbInput = RT_ALIGN_Z(RT_UOFFSETOF(HV_INPUT_GET_VP_REGISTERS, Names[1]), 32);
    1325     HV_REGISTER_VALUE *paValues = (HV_REGISTER_VALUE *)((uint8_t *)pInput + cbInput);
    1326     RT_BZERO(paValues, sizeof(paValues[0]) * 1);
    1327 
    1328     /*
    1329      * Make the hypercall and copy out the value.
    1330      */
    1331     uint64_t uResult = g_pfnHvlInvokeHypercall(HV_MAKE_CALL_INFO(HvCallGetVpRegisters, 1),
    1332                                                pGVCpu->nem.s.HypercallData.HCPhysPage,
    1333                                                pGVCpu->nem.s.HypercallData.HCPhysPage + cbInput);
    1334     AssertLogRelMsgReturn(uResult == HV_MAKE_CALL_REP_RET(1), ("uResult=%RX64 cRegs=%#x\n", uResult, 1),
    1335                           VERR_NEM_GET_REGISTERS_FAILED);
    1336 
    1337     *pRetValue = paValues[0];
    1338     return VINF_SUCCESS;
    1339 #  endif
    1340 }
    1341 # else
    1342 /** Worker for assertion macro. */
    1343 NEM_TMPL_STATIC int nemR3WinGetRegister(PVMCPUCC a_pVCpu, uint32_t a_enmReg, WHV_REGISTER_VALUE pValue)
    1344 {
    1345     RT_ZERO(*pRetValue);
    1346     RT_NOREF(pVCpu, pGVCpu, enmReg);
    1347     return VERR_NOT_IMPLEMENTED;
    1348 }
    1349 # endif
    1350 #endif
    13511171
    13521172
     
    13791199
    13801200
    1381 #if defined(NEM_WIN_USE_OUR_OWN_RUN_API) || defined(NEM_WIN_WITH_RING0_RUNLOOP)
    1382 # ifdef IN_RING3 /* hopefully not needed in ring-0, as we'd need KTHREADs and KeAlertThread. */
     1201#if defined(NEM_WIN_USE_OUR_OWN_RUN_API)
     1202# ifdef IN_RING3 /* hopefully not needed in ring-0, as we'd need KETHREADs and KeAlertThread. */
    13831203/**
    13841204 * Our own WHvCancelRunVirtualProcessor that can later be moved to ring-0.
     
    14461266}
    14471267# endif /* IN_RING3 */
    1448 #endif /* NEM_WIN_USE_OUR_OWN_RUN_API || NEM_WIN_WITH_RING0_RUNLOOP */
     1268#endif /* NEM_WIN_USE_OUR_OWN_RUN_API */
    14491269
    14501270
     
    16121432#endif /* IN_RING3 && !NEM_WIN_TEMPLATE_MODE_OWN_RUN_API */
    16131433
    1614 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING3)
     1434#if defined(IN_RING3)
    16151435
    16161436NEM_TMPL_STATIC DECLCALLBACK(int)
    16171437nemHCWinUnmapOnePageCallback(PVMCC pVM, PVMCPUCC pVCpu, RTGCPHYS GCPhys, uint8_t *pu2NemState, void *pvUser)
    16181438{
    1619     RT_NOREF_PV(pvUser);
    1620 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1621     int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhys);
    1622     AssertRC(rc);
    1623     if (RT_SUCCESS(rc))
    1624 # else
    1625     RT_NOREF_PV(pVCpu);
     1439    RT_NOREF(pvUser, pVCpu);
    16261440    STAM_REL_PROFILE_START(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
    16271441    HRESULT hrc = WHvUnmapGpaRange(pVM->nem.s.hPartition, GCPhys, X86_PAGE_SIZE);
    16281442    STAM_REL_PROFILE_STOP(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
    16291443    if (SUCCEEDED(hrc))
    1630 # endif
    16311444    {
    16321445        Log5(("NEM GPA unmap all: %RGp (cMappedPages=%u)\n", GCPhys, pVM->nem.s.cMappedPages - 1));
     
    16361449    else
    16371450    {
    1638 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1639         LogRel(("nemHCWinUnmapOnePageCallback: GCPhys=%RGp rc=%Rrc\n", GCPhys, rc));
    1640 # else
    16411451        LogRel(("nemHCWinUnmapOnePageCallback: GCPhys=%RGp %s hrc=%Rhrc (%#x) Last=%#x/%u (cMappedPages=%u)\n",
    16421452                GCPhys, g_apszPageStates[*pu2NemState], hrc, hrc, RTNtLastStatusValue(),
    16431453                RTNtLastErrorValue(), pVM->nem.s.cMappedPages));
    1644 # endif
    16451454        *pu2NemState = NEM_WIN_PAGE_STATE_NOT_SET;
    16461455        STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
     
    17041513     * We don't really consider downgrades here, as they shouldn't happen.
    17051514     */
    1706 # ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    17071515    /** @todo Someone at microsoft please explain:
    17081516     * I'm not sure WTF was going on, but I ended up in a loop if I remapped a
     
    17131521     * with new protection or backing.
    17141522     */
    1715 # endif
    17161523    int rc;
    17171524    switch (u2State)
     
    17561563            }
    17571564
    1758 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1759             /* Upgrade page to writable. */
    1760 /** @todo test this*/
    1761             if (   (pInfo->fNemProt & NEM_PAGE_PROT_WRITE)
    1762                 && pState->fWriteAccess)
    1763             {
    1764                 rc = nemHCWinHypercallMapPage(pVM, pVCpu, GCPhysSrc, GCPhys,
    1765                                               HV_MAP_GPA_READABLE   | HV_MAP_GPA_WRITABLE
    1766                                               | HV_MAP_GPA_EXECUTABLE | HV_MAP_GPA_EXECUTABLE_AGAIN);
    1767                 AssertRC(rc);
    1768                 if (RT_SUCCESS(rc))
    1769                 {
    1770                     STAM_REL_COUNTER_INC(&pVM->nem.s.StatRemapPage);
    1771                     pInfo->u2NemState = NEM_WIN_PAGE_STATE_WRITABLE;
    1772                     pState->fDidSomething = true;
    1773                     pState->fCanResume    = true;
    1774                     Log5(("NEM GPA write-upgrade/exit: %RGp (was %s, cMappedPages=%u)\n",
    1775                           GCPhys, g_apszPageStates[u2State], pVM->nem.s.cMappedPages));
    1776                 }
    1777                 else
    1778                     STAM_REL_COUNTER_INC(&pVM->nem.s.StatRemapPageFailed);
    1779             }
    1780             else
    1781             {
    1782                 /* Need to emulate the acces. */
    1783                 AssertBreak(pInfo->fNemProt != NEM_PAGE_PROT_NONE); /* There should be no downgrades. */
    1784                 rc = VINF_SUCCESS;
    1785             }
    1786             return rc;
    1787 # else
    17881565            break;
    1789 # endif
    17901566
    17911567        case NEM_WIN_PAGE_STATE_WRITABLE:
     
    18021578                return VINF_SUCCESS;
    18031579            }
    1804 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1805             AssertFailed(); /* There should be no downgrades. */
    1806 # endif
    18071580            break;
    18081581
     
    18151588     * If this fails, which it does every so often, just unmap everything for now.
    18161589     */
    1817 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1818     rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhys);
    1819     AssertRC(rc);
    1820     if (RT_SUCCESS(rc))
    1821 # else
    18221590    /** @todo figure out whether we mess up the state or if it's WHv.   */
    18231591    STAM_REL_PROFILE_START(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
     
    18251593    STAM_REL_PROFILE_STOP(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
    18261594    if (SUCCEEDED(hrc))
    1827 # endif
    18281595    {
    18291596        pState->fDidSomething = true;
     
    18361603    }
    18371604    STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
    1838 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    1839     LogRel(("nemHCWinHandleMemoryAccessPageCheckerCallback/unmap: GCPhysDst=%RGp rc=%Rrc\n", GCPhys, rc));
    1840     return rc;
    1841 # elif defined(VBOX_WITH_PGM_NEM_MODE)
     1605# if defined(VBOX_WITH_PGM_NEM_MODE)
    18421606    LogRel(("nemHCWinHandleMemoryAccessPageCheckerCallback/unmap: GCPhysDst=%RGp %s hrc=%Rhrc (%#x)\n",
    18431607            GCPhys, g_apszPageStates[u2State], hrc, hrc));
     
    18591623}
    18601624
    1861 #endif /* defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING3) */
     1625#endif /* defined(IN_RING3) */
    18621626
    18631627
     
    38773641
    38783642
    3879 #if defined(IN_RING0) && defined(NEM_WIN_WITH_RING0_RUNLOOP)
    3880 /**
    3881  * Perform an I/O control operation on the partition handle (VID.SYS),
    3882  * restarting on alert-like behaviour.
    3883  *
    3884  * @returns NT status code.
    3885  * @param   pGVM            The ring-0 VM structure.
    3886  * @param   pGVCpu          The global (ring-0) per CPU structure.
    3887  * @param   fFlags          The wait flags.
    3888  * @param   cMillies        The timeout in milliseconds
    3889  */
    3890 static NTSTATUS nemR0NtPerformIoCtlMessageSlotHandleAndGetNext(PGVM pGVM, PGVMCPU pGVCpu, uint32_t fFlags, uint32_t cMillies)
    3891 {
    3892     pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu     = pGVCpu->idCpu;
    3893     pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags   = fFlags;
    3894     pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies;
    3895     NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
    3896                                             &pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext,
    3897                                             pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput,
    3898                                             NULL, 0);
    3899     if (rcNt == STATUS_SUCCESS)
    3900     { /* likely */ }
    3901     /*
    3902      * Generally, if we get down here, we have been interrupted between ACK'ing
    3903      * a message and waiting for the next due to a NtAlertThread call.  So, we
    3904      * should stop ACK'ing the previous message and get on waiting on the next.
    3905      * See similar stuff in nemHCWinRunGC().
    3906      */
    3907     else if (   rcNt == STATUS_TIMEOUT
    3908              || rcNt == STATUS_ALERTED    /* just in case */
    3909              || rcNt == STATUS_KERNEL_APC /* just in case */
    3910              || rcNt == STATUS_USER_APC   /* just in case */)
    3911     {
    3912         DBGFTRACE_CUSTOM(pGVCpu->CTX_SUFF(pVM), "IoCtlMessageSlotHandleAndGetNextRestart/1 %#x (f=%#x)", rcNt, fFlags);
    3913         STAM_REL_COUNTER_INC(&pGVCpu->nem.s.StatStopCpuPendingAlerts);
    3914         Assert(fFlags & VID_MSHAGN_F_GET_NEXT_MESSAGE);
    3915 
    3916         pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu     = pGVCpu->idCpu;
    3917         pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags   = fFlags & ~VID_MSHAGN_F_HANDLE_MESSAGE;
    3918         pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMillies;
    3919         rcNt = nemR0NtPerformIoControl(pGVM, pGVCpu, pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.uFunction,
    3920                                        &pGVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext,
    3921                                        pGVM->nemr0.s.IoCtlMessageSlotHandleAndGetNext.cbInput,
    3922                                        NULL, 0);
    3923         DBGFTRACE_CUSTOM(pGVM, "IoCtlMessageSlotHandleAndGetNextRestart/2 %#x", rcNt);
    3924     }
    3925     return rcNt;
    3926 }
    3927 #endif /* IN_RING0 */
    3928 
    3929 
    39303643#ifdef NEM_WIN_TEMPLATE_MODE_OWN_RUN_API
    39313644/**
     
    42523965    for (unsigned iLoop = 0;; iLoop++)
    42533966    {
    4254 # if !defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) && !defined(VBOX_WITH_PGM_NEM_MODE)
     3967# ifndef VBOX_WITH_PGM_NEM_MODE
    42553968        /*
    42563969         * Hack alert!
     
    45984311
    45994312#endif /* defined(NEM_WIN_TEMPLATE_MODE_OWN_RUN_API) || defined(IN_RING3) */
    4600 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING3)
     4313#ifdef IN_RING3
    46014314
    46024315/**
     
    46094322    if (pInfo->u2NemState > NEM_WIN_PAGE_STATE_UNMAPPED)
    46104323    {
    4611 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4612         int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhys);
    4613         AssertRC(rc);
    4614         if (RT_SUCCESS(rc))
    4615 # else
    46164324        HRESULT hrc = WHvUnmapGpaRange(pVM->nem.s.hPartition, GCPhys, X86_PAGE_SIZE);
    46174325        if (SUCCEEDED(hrc))
    4618 # endif
    46194326        {
    46204327            STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPage);
     
    46264333        {
    46274334            STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
    4628 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4629             LogRel(("nemHCWinUnsetForA20CheckerCallback/unmap: GCPhys=%RGp rc=%Rrc\n", GCPhys, rc));
    4630             return rc;
    4631 # else
    46324335            LogRel(("nemHCWinUnsetForA20CheckerCallback/unmap: GCPhys=%RGp hrc=%Rhrc (%#x) Last=%#x/%u\n",
    46334336                    GCPhys, hrc, hrc, RTNtLastStatusValue(), RTNtLastErrorValue()));
    46344337            return VERR_NEM_IPE_2;
    4635 # endif
    46364338        }
    46374339    }
     
    46724374
    46734375    *pu2State = UINT8_MAX;
    4674 #if !defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) && defined(VBOX_WITH_PGM_NEM_MODE) && defined(IN_RING3)
     4376#if defined(VBOX_WITH_PGM_NEM_MODE) && defined(IN_RING3)
    46754377    if (pvMemR3)
    46764378    {
     
    47014403
    47024404
    4703 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING3)
     4405#ifdef IN_RING3
    47044406/**
    47054407 * Worker that maps pages into Hyper-V.
     
    47234425                                           uint32_t fPageProt, uint8_t *pu2State, bool fBackingChanged)
    47244426{
    4725 # ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4726     /*
    4727      * When using the hypercalls instead of the ring-3 APIs, we don't need to
    4728      * unmap memory before modifying it.  We still want to track the state though,
    4729      * since unmap will fail when called an unmapped page and we don't want to redo
    4730      * upgrades/downgrades.
    4731      */
    4732     uint8_t const u2OldState = *pu2State;
    4733     int rc;
    4734     if (fPageProt == NEM_PAGE_PROT_NONE)
    4735     {
    4736         if (u2OldState > NEM_WIN_PAGE_STATE_UNMAPPED)
    4737         {
    4738             rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhysDst);
    4739             if (RT_SUCCESS(rc))
    4740             {
    4741                 *pu2State = NEM_WIN_PAGE_STATE_UNMAPPED;
    4742                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPage);
    4743                 uint32_t cMappedPages = ASMAtomicDecU32(&pVM->nem.s.cMappedPages); NOREF(cMappedPages);
    4744                 Log5(("NEM GPA unmapped/set: %RGp (was %s, cMappedPages=%u)\n", GCPhysDst, g_apszPageStates[u2OldState], cMappedPages));
    4745             }
    4746             else
    4747             {
    4748                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
    4749                 AssertLogRelMsgFailed(("nemHCNativeSetPhysPage/unmap: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4750             }
    4751         }
    4752         else
    4753             rc = VINF_SUCCESS;
    4754     }
    4755     else if (fPageProt & NEM_PAGE_PROT_WRITE)
    4756     {
    4757         if (u2OldState != NEM_WIN_PAGE_STATE_WRITABLE || fBackingChanged)
    4758         {
    4759             rc = nemHCWinHypercallMapPage(pVM, pVCpu, GCPhysSrc, GCPhysDst,
    4760                                             HV_MAP_GPA_READABLE   | HV_MAP_GPA_WRITABLE
    4761                                           | HV_MAP_GPA_EXECUTABLE | HV_MAP_GPA_EXECUTABLE_AGAIN);
    4762             if (RT_SUCCESS(rc))
    4763             {
    4764                 *pu2State = NEM_WIN_PAGE_STATE_WRITABLE;
    4765                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPage);
    4766                 uint32_t cMappedPages = u2OldState <= NEM_WIN_PAGE_STATE_UNMAPPED
    4767                                       ? ASMAtomicIncU32(&pVM->nem.s.cMappedPages) : pVM->nem.s.cMappedPages;
    4768                 Log5(("NEM GPA writable/set: %RGp (was %s, cMappedPages=%u)\n", GCPhysDst, g_apszPageStates[u2OldState], cMappedPages));
    4769                 NOREF(cMappedPages);
    4770             }
    4771             else
    4772             {
    4773                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPageFailed);
    4774                 AssertLogRelMsgFailed(("nemHCNativeSetPhysPage/writable: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4775             }
    4776         }
    4777         else
    4778             rc = VINF_SUCCESS;
    4779     }
    4780     else
    4781     {
    4782         if (u2OldState != NEM_WIN_PAGE_STATE_READABLE || fBackingChanged)
    4783         {
    4784             rc = nemHCWinHypercallMapPage(pVM, pVCpu, GCPhysSrc, GCPhysDst,
    4785                                           HV_MAP_GPA_READABLE | HV_MAP_GPA_EXECUTABLE | HV_MAP_GPA_EXECUTABLE_AGAIN);
    4786             if (RT_SUCCESS(rc))
    4787             {
    4788                 *pu2State = NEM_WIN_PAGE_STATE_READABLE;
    4789                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPage);
    4790                 uint32_t cMappedPages = u2OldState <= NEM_WIN_PAGE_STATE_UNMAPPED
    4791                                       ? ASMAtomicIncU32(&pVM->nem.s.cMappedPages) : pVM->nem.s.cMappedPages;
    4792                 Log5(("NEM GPA read+exec/set: %RGp (was %s, cMappedPages=%u)\n", GCPhysDst, g_apszPageStates[u2OldState], cMappedPages));
    4793                 NOREF(cMappedPages);
    4794             }
    4795             else
    4796             {
    4797                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPageFailed);
    4798                 AssertLogRelMsgFailed(("nemHCNativeSetPhysPage/writable: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4799             }
    4800         }
    4801         else
    4802             rc = VINF_SUCCESS;
    4803     }
    4804 
    4805     return VINF_SUCCESS;
    4806 
    4807 # else /* !NEM_WIN_USE_HYPERCALLS_FOR_PAGES */
    48084427    /*
    48094428     * Looks like we need to unmap a page before we can change the backing
     
    48204439        if (u2OldState > NEM_WIN_PAGE_STATE_UNMAPPED)
    48214440        {
    4822 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4823             int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhysDst);
    4824             AssertRC(rc);
    4825             if (RT_SUCCESS(rc))
    4826             {
    4827                 *pu2State = NEM_WIN_PAGE_STATE_UNMAPPED;
    4828                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPage);
    4829                 uint32_t cMappedPages = ASMAtomicDecU32(&pVM->nem.s.cMappedPages); NOREF(cMappedPages);
    4830                 if (u2NewState == NEM_WIN_PAGE_STATE_UNMAPPED)
    4831                 {
    4832                     Log5(("NEM GPA unmapped/set: %RGp (was %s, cMappedPages=%u)\n",
    4833                           GCPhysDst, g_apszPageStates[u2OldState], cMappedPages));
    4834                     return VINF_SUCCESS;
    4835                 }
    4836             }
    4837             else
    4838             {
    4839                 STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
    4840                 LogRel(("nemHCNativeSetPhysPage/unmap: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4841                 return rc;
    4842             }
    4843 #  else
    48444441            STAM_REL_PROFILE_START(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
    48454442            HRESULT hrc = WHvUnmapGpaRange(pVM->nem.s.hPartition, GCPhysDst, X86_PAGE_SIZE);
     
    48644461                return VERR_NEM_INIT_FAILED;
    48654462            }
    4866 #  endif
    48674463        }
    48684464    }
     
    48734469    if (fPageProt & NEM_PAGE_PROT_WRITE)
    48744470    {
    4875 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4876         int rc = nemHCWinHypercallMapPage(pVM, pVCpu, GCPhysSrc, GCPhysDst,
    4877                                             HV_MAP_GPA_READABLE   | HV_MAP_GPA_WRITABLE
    4878                                           | HV_MAP_GPA_EXECUTABLE | HV_MAP_GPA_EXECUTABLE_AGAIN);
    4879         AssertRC(rc);
    4880         if (RT_SUCCESS(rc))
    4881         {
    4882             *pu2State = NEM_WIN_PAGE_STATE_WRITABLE;
    4883             STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPage);
    4884             uint32_t cMappedPages = ASMAtomicIncU32(&pVM->nem.s.cMappedPages); NOREF(cMappedPages);
    4885             Log5(("NEM GPA mapped/set: %RGp %s (was %s, cMappedPages=%u)\n",
    4886                   GCPhysDst, g_apszPageStates[u2NewState], g_apszPageStates[u2OldState], cMappedPages));
    4887             return VINF_SUCCESS;
    4888         }
    4889         STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPageFailed);
    4890         LogRel(("nemHCNativeSetPhysPage/writable: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4891         return rc;
    4892 #  else
    48934471        void *pvPage;
    48944472        int rc = nemR3NativeGCPhys2R3PtrWriteable(pVM, GCPhysSrc, &pvPage);
     
    49134491        LogRel(("nemHCNativeSetPhysPage/writable: GCPhysSrc=%RGp rc=%Rrc\n", GCPhysSrc, rc));
    49144492        return rc;
    4915 #  endif
    49164493    }
    49174494
    49184495    if (fPageProt & NEM_PAGE_PROT_READ)
    49194496    {
    4920 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    4921         int rc = nemHCWinHypercallMapPage(pVM, pVCpu, GCPhysSrc, GCPhysDst,
    4922                                           HV_MAP_GPA_READABLE | HV_MAP_GPA_EXECUTABLE | HV_MAP_GPA_EXECUTABLE_AGAIN);
    4923         AssertRC(rc);
    4924         if (RT_SUCCESS(rc))
    4925         {
    4926             *pu2State = NEM_WIN_PAGE_STATE_READABLE;
    4927             STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPage);
    4928             uint32_t cMappedPages = ASMAtomicIncU32(&pVM->nem.s.cMappedPages); NOREF(cMappedPages);
    4929             Log5(("NEM GPA mapped/set: %RGp %s (was %s, cMappedPages=%u)\n",
    4930                   GCPhysDst, g_apszPageStates[u2NewState], g_apszPageStates[u2OldState], cMappedPages));
    4931             return VINF_SUCCESS;
    4932         }
    4933         STAM_REL_COUNTER_INC(&pVM->nem.s.StatMapPageFailed);
    4934         LogRel(("nemHCNativeSetPhysPage/readonly: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4935         return rc;
    4936 #  else
    49374497        const void *pvPage;
    49384498        int rc = nemR3NativeGCPhys2R3PtrReadOnly(pVM, GCPhysSrc, &pvPage);
     
    49594519        LogRel(("nemHCNativeSetPhysPage/readonly: GCPhysSrc=%RGp rc=%Rrc\n", GCPhysSrc, rc));
    49604520        return rc;
    4961 #  endif
    49624521    }
    49634522
     
    49654524    *pu2State = NEM_WIN_PAGE_STATE_UNMAPPED;
    49664525    return VINF_SUCCESS;
    4967 # endif /* !NEM_WIN_USE_HYPERCALLS_FOR_PAGES */
    4968 }
    4969 #endif /* defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES) || defined(IN_RING3) */
     4526}
     4527#endif /* IN_RING3 */
    49704528
    49714529
     
    49794537    }
    49804538
    4981 #if defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES)
    4982     PVMCPUCC pVCpu = VMMGetCpu(pVM);
    4983     int rc = nemHCWinHypercallUnmapPage(pVM, pVCpu, GCPhysDst);
    4984     AssertRC(rc);
    4985     if (RT_SUCCESS(rc))
    4986     {
    4987         STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPage);
    4988         uint32_t cMappedPages = ASMAtomicDecU32(&pVM->nem.s.cMappedPages); NOREF(cMappedPages);
    4989         Log5(("NEM GPA unmapped/just: %RGp (was %s, cMappedPages=%u)\n", GCPhysDst, g_apszPageStates[*pu2State], cMappedPages));
    4990         *pu2State = NEM_WIN_PAGE_STATE_UNMAPPED;
    4991         return VINF_SUCCESS;
    4992     }
    4993     STAM_REL_COUNTER_INC(&pVM->nem.s.StatUnmapPageFailed);
    4994     LogRel(("nemHCJustUnmapPageFromHyperV/unmap: GCPhysDst=%RGp rc=%Rrc\n", GCPhysDst, rc));
    4995     return rc;
    4996 
    4997 #elif defined(IN_RING3)
     4539#if defined(IN_RING3)
    49984540    STAM_REL_PROFILE_START(&pVM->nem.s.StatProfUnmapGpaRangePage, a);
    49994541    HRESULT hrc = WHvUnmapGpaRange(pVM->nem.s.hPartition, GCPhysDst & ~(RTGCPHYS)X86_PAGE_OFFSET_MASK, X86_PAGE_SIZE);
     
    50274569
    50284570    int rc;
    5029 #ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    5030     PVMCPUCC pVCpu = VMMGetCpu(pVM);
    5031 # ifdef NEM_WIN_WITH_A20
     4571    RT_NOREF_PV(fPageProt);
     4572#ifdef NEM_WIN_WITH_A20
    50324573    if (   pVM->nem.s.fA20Enabled
    50334574        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5034 # endif
    5035         rc = nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, true /*fBackingChanged*/);
    5036 # ifdef NEM_WIN_WITH_A20
    5037     else
    5038     {
    5039         /* To keep effort at a minimum, we unmap the HMA page alias and resync it lazily when needed. */
    5040         rc = nemHCWinUnmapPageForA20Gate(pVM, pVCpu, GCPhys | RT_BIT_32(20));
    5041         if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys) && RT_SUCCESS(rc))
    5042             rc = nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, true /*fBackingChanged*/);
    5043 
    5044     }
    5045 # endif
    5046 #else
    5047     RT_NOREF_PV(fPageProt);
    5048 # ifdef NEM_WIN_WITH_A20
    5049     if (   pVM->nem.s.fA20Enabled
    5050         || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5051 # endif
     4575#endif
    50524576        rc = nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    5053 # ifdef NEM_WIN_WITH_A20
     4577#ifdef NEM_WIN_WITH_A20
    50544578    else if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys))
    50554579        rc = nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    50564580    else
    50574581        rc = VINF_SUCCESS; /* ignore since we've got the alias page at this address. */
    5058 # endif
    50594582#endif
    50604583    return rc;
     
    50704593    RT_NOREF(HCPhys, enmType, pvR3);
    50714594
    5072 #ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    5073     PVMCPUCC pVCpu = VMMGetCpu(pVM);
    5074 # ifdef NEM_WIN_WITH_A20
     4595    RT_NOREF_PV(fPageProt);
     4596#ifdef NEM_WIN_WITH_A20
    50754597    if (   pVM->nem.s.fA20Enabled
    50764598        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5077 # endif
    5078         nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, false /*fBackingChanged*/);
    5079 # ifdef NEM_WIN_WITH_A20
    5080     else
    5081     {
    5082         /* To keep effort at a minimum, we unmap the HMA page alias and resync it lazily when needed. */
    5083         nemHCWinUnmapPageForA20Gate(pVM, pVCpu, GCPhys | RT_BIT_32(20));
    5084         if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys))
    5085             nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, false /*fBackingChanged*/);
    5086     }
    5087 # endif
    5088 #else
    5089     RT_NOREF_PV(fPageProt);
    5090 # ifdef NEM_WIN_WITH_A20
    5091     if (   pVM->nem.s.fA20Enabled
    5092         || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5093 # endif
     4599#endif
    50944600        nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    5095 # ifdef NEM_WIN_WITH_A20
     4601#ifdef NEM_WIN_WITH_A20
    50964602    else if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys))
    50974603        nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    50984604    /* else: ignore since we've got the alias page at this address. */
    5099 # endif
    51004605#endif
    51014606}
     
    51104615    RT_NOREF(HCPhysPrev, HCPhysNew, pvNewR3, enmType);
    51114616
    5112 #ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    5113     PVMCPUCC pVCpu = VMMGetCpu(pVM);
    5114 # ifdef NEM_WIN_WITH_A20
     4617    RT_NOREF_PV(fPageProt);
     4618#ifdef NEM_WIN_WITH_A20
    51154619    if (   pVM->nem.s.fA20Enabled
    51164620        || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5117 # endif
    5118         nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, true /*fBackingChanged*/);
    5119 # ifdef NEM_WIN_WITH_A20
    5120     else
    5121     {
    5122         /* To keep effort at a minimum, we unmap the HMA page alias and resync it lazily when needed. */
    5123         nemHCWinUnmapPageForA20Gate(pVM, pVCpu, GCPhys | RT_BIT_32(20));
    5124         if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys))
    5125             nemHCNativeSetPhysPage(pVM, pVCpu, GCPhys, GCPhys, fPageProt, pu2State, true /*fBackingChanged*/);
    5126     }
    5127 # endif
    5128 #else
    5129     RT_NOREF_PV(fPageProt);
    5130 # ifdef NEM_WIN_WITH_A20
    5131     if (   pVM->nem.s.fA20Enabled
    5132         || !NEM_WIN_IS_RELEVANT_TO_A20(GCPhys))
    5133 # endif
     4621#endif
    51344622        nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    5135 # ifdef NEM_WIN_WITH_A20
     4623#ifdef NEM_WIN_WITH_A20
    51364624    else if (!NEM_WIN_IS_SUBJECT_TO_A20(GCPhys))
    51374625        nemHCJustUnmapPageFromHyperV(pVM, GCPhys, pu2State);
    51384626    /* else: ignore since we've got the alias page at this address. */
    5139 # endif
    51404627#endif
    51414628}
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