VirtualBox

Changeset 93207 in vbox


Ignore:
Timestamp:
Jan 12, 2022 7:14:56 PM (3 years ago)
Author:
vboxsync
Message:

VMM/NEM-win: Just drop the ring-0 bits when NEM/PGM mode is enabled. bugref:10122 bugref:10162

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r93115 r93207  
    575575VMMR0_SOURCES.linux.amd64 += VMMR0/NEMR0Native-stubs.cpp
    576576
     577  if 0
    577578VMMR0_SOURCES.win.amd64 += \
    578579        VMMR0/NEMR0Native-win.cpp \
     
    580581VMMR0_DEFS.win.amd64    += VBOX_WITH_NATIVE_NEM VBOX_WITH_NEM_R0
    581582VMMR0/NEMR0Native-win.cpp_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK_INCS)
     583  else
     584VMMR0_SOURCES.win.amd64 += VMMR0/NEMR0Native-stubs.cpp
     585  endif
    582586
    583587VMMR0_SOURCES.darwin.amd64 += \
  • trunk/src/VBox/VMM/VMMR3/NEMR3.cpp

    r93115 r93207  
    122122
    123123#ifdef RT_OS_WINDOWS
     124# ifndef VBOX_WITH_PGM_NEM_MODE
     125
    124126    /** @cfgm{/NEM/UseRing0Runloop, bool, true}
    125127     * Whether to use the ring-0 runloop (if enabled in the build) or the ring-3 one.
    126128     * The latter is generally slower.  This option serves as a way out in case
    127129     * something breaks in the ring-0 loop. */
    128 # ifdef NEM_WIN_USE_RING0_RUNLOOP_BY_DEFAULT
     130#  ifdef NEM_WIN_USE_RING0_RUNLOOP_BY_DEFAULT
    129131    bool fUseRing0Runloop = true;
    130 # else
     132#  else
    131133    bool fUseRing0Runloop = false;
    132 # endif
     134#  endif
    133135    rc = CFGMR3QueryBoolDef(pCfgNem, "UseRing0Runloop", &fUseRing0Runloop, fUseRing0Runloop);
    134136    AssertLogRelRCReturn(rc, rc);
    135137    pVM->nem.s.fUseRing0Runloop = fUseRing0Runloop;
     138# endif
    136139#endif
    137140
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r93115 r93207  
    13291329             */
    13301330            rc = nemR3WinInitDiscoverIoControlProperties(pVM, pErrInfo);
     1331#ifndef VBOX_WITH_PGM_NEM_MODE
    13311332            if (rc == VERR_NEM_RING3_ONLY)
    13321333            {
     
    13381339                rc = VINF_SUCCESS;
    13391340            }
     1341#endif
    13401342            if (RT_SUCCESS(rc))
    13411343            {
     1344#ifndef VBOX_WITH_PGM_NEM_MODE
    13421345                /*
    13431346                 * Check out our ring-0 capabilities.
    13441347                 */
    13451348                rc = SUPR3CallVMMR0Ex(VMCC_GET_VMR0_FOR_CALL(pVM), 0 /*idCpu*/, VMMR0_DO_NEM_INIT_VM, 0, NULL);
     1349#endif
    13461350                if (RT_SUCCESS(rc))
    13471351                {
     
    15651569        hPartitionDevice = NULL;
    15661570    }
     1571#ifndef VBOX_WITH_PGM_NEM_MODE
    15671572    if (   hPartitionDevice == NULL
    15681573        || hPartitionDevice == (HANDLE)(intptr_t)-1)
    15691574        return VMSetError(pVM, VERR_NEM_VM_CREATE_FAILED, RT_SRC_POS,
    15701575                          "Failed to get device handle for partition %p: %Rhrc", hPartition, hrc);
     1576#endif
    15711577
    15721578    /* Test the handle. */
    15731579    HV_PARTITION_PROPERTY uValue;
    15741580    if (!g_pfnVidGetPartitionProperty(hPartitionDevice, HvPartitionPropertyProcessorVendor, &uValue))
     1581#ifndef VBOX_WITH_PGM_NEM_MODE
    15751582        return VMSetError(pVM, VERR_NEM_VM_CREATE_FAILED, RT_SRC_POS,
    15761583                          "Failed to get device handle and/or partition ID for %p (hPartitionDevice=%p, Last=%#x/%u)",
    15771584                          hPartition, hPartitionDevice, RTNtLastStatusValue(), RTNtLastErrorValue());
     1585#else
     1586        hPartitionDevice = INVALID_HANDLE_VALUE;
     1587#endif
    15781588    LogRel(("NEM: HvPartitionPropertyProcessorVendor=%#llx (%lld)\n", uValue, uValue));
    15791589
     
    15901600    if (!g_pfnVidGetHvPartitionId(hPartitionDevice, &idHvPartition))
    15911601    {
     1602#ifndef VBOX_WITH_PGM_NEM_MODE
    15921603        if (RTNtLastErrorValue() != ERROR_INVALID_FUNCTION) /* Will try get it later in VMMR0_DO_NEM_INIT_VM_PART_2. */
    15931604            return VMSetError(pVM, VERR_NEM_VM_CREATE_FAILED, RT_SRC_POS,
     
    15951606                              hPartition, hPartitionDevice, RTNtLastStatusValue(), RTNtLastErrorValue());
    15961607        LogRel(("NEM: VidGetHvPartitionId failed with ERROR_NOT_SUPPORTED, will try again later from ring-0...\n"));
     1608#endif
    15971609        idHvPartition = HV_PARTITION_ID_INVALID;
    15981610    }
     
    16591671     * Do some more ring-0 initialization now that we've got the partition handle.
    16601672     */
     1673#ifndef VBOX_WITH_PGM_NEM_MODE
    16611674    int rc = VMMR3CallR0Emt(pVM, pVM->apCpusR3[0], VMMR0_DO_NEM_INIT_VM_PART_2, 0, NULL);
     1675#else
     1676    int rc = VINF_SUCCESS;
     1677#endif
    16621678    if (RT_SUCCESS(rc))
    16631679    {
     
    16651681                hPartitionDevice, pVM->nem.s.idHvPartition));
    16661682
    1667 #if 1
     1683#ifndef VBOX_WITH_PGM_NEM_MODE
    16681684        VMMR3CallR0Emt(pVM, pVM->apCpusR3[0], VMMR0_DO_NEM_UPDATE_STATISTICS, 0, NULL);
    16691685        LogRel(("NEM: Memory balance: %#RX64 out of %#RX64 pages in use\n",
  • trunk/src/VBox/VMM/include/NEMInternal.h

    r93115 r93207  
    223223    /** WHvRunVpExitReasonException is supported. */
    224224    bool                        fExtendedXcptExit : 1;
     225# ifndef VBOX_WITH_PGM_NEM_MODE
    225226    /** Set if we're using the ring-0 API to do the work. */
    226227    bool                        fUseRing0Runloop : 1;
     228# endif
    227229# ifdef NEM_WIN_WITH_A20
    228230    /** Set if we've started more than one CPU and cannot mess with A20. */
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