VirtualBox

Changeset 91939 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Oct 21, 2021 12:43:45 PM (3 years ago)
Author:
vboxsync
Message:

VMM/*: Eliminated MMHyperR3ToRC, TMR3GetImportRC and few other things. bugref:9517

Location:
trunk/src/VBox/VMM/VMMR3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDM.cpp

    r91895 r91939  
    679679
    680680    }
    681 #endif
     681#endif /* VBOX_WITH_RAW_MODE_KEEP */
    682682}
    683683
  • trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp

    r91905 r91939  
    746746                        AssertReleaseRCReturn(rc, rc);
    747747                    }
     748#ifdef VBOX_WITH_RAW_MODE_KEEP
    748749                    if (   (pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC)
    749750                        && VM_IS_RAW_MODE_ENABLED(pVM))
     
    753754                        AssertReleaseRCReturn(rc, rc);
    754755                    }
     756#endif
    755757
    756758                    pDrv->iNextInstance++;
  • trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp

    r91854 r91939  
    398398            RTRCPTR RCPtr = 0;
    399399            rc = VMMR3GetImportRC(pVM, pszSymbol, &RCPtr);
    400             if (RT_SUCCESS(rc))
    401                 *pValue = RCPtr;
    402         }
    403         else if (   !strncmp(pszSymbol, "TM", 2)
    404                  || !strcmp(pszSymbol, "g_pSUPGlobalInfoPage"))
    405         {
    406             RTRCPTR RCPtr = 0;
    407             rc = TMR3GetImportRC(pVM, pszSymbol, &RCPtr);
    408400            if (RT_SUCCESS(rc))
    409401                *pValue = RCPtr;
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r91904 r91939  
    924924        if (RT_SUCCESS(rc))
    925925        {
    926             pVM->pgm.s.pvZeroPgRC = MMHyperR3ToRC(pVM, pVM->pgm.s.pvZeroPgR3);
    927926            pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3);
    928927            pVM->pgm.s.HCPhysZeroPg = MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.pvZeroPgR3);
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r91854 r91939  
    291291    pVM->tm.s.VirtualGetRawDataR3.pfnBadCpuIndex = tmVirtualNanoTSBadCpuIndex;
    292292    pVM->tm.s.VirtualGetRawDataR3.pu64Prev       = &pVM->tm.s.u64VirtualRawPrev;
    293     pVM->tm.s.VirtualGetRawDataRC.pu64Prev       = MMHyperR3ToRC(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);
    294293    pVM->tm.s.VirtualGetRawDataR0.pu64Prev       = MMHyperR3ToR0(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);
    295294    AssertRelease(pVM->tm.s.VirtualGetRawDataR0.pu64Prev);
     
    675674    STAM_REL_REG_USED(pVM,(void*)&pVM->tm.s.VirtualGetRawDataR0.c1nsSteps,STAMTYPE_U32, "/TM/R0/1nsSteps",                     STAMUNIT_OCCURENCES, "Virtual time 1ns steps (due to TSC / GIP variations).");
    676675    STAM_REL_REG_USED(pVM,(void*)&pVM->tm.s.VirtualGetRawDataR0.cBadPrev, STAMTYPE_U32, "/TM/R0/cBadPrev",                     STAMUNIT_OCCURENCES, "Times the previous virtual time was considered erratic (shouldn't ever happen).");
    677     STAM_REL_REG_USED(pVM,(void*)&pVM->tm.s.VirtualGetRawDataRC.c1nsSteps,STAMTYPE_U32, "/TM/RC/1nsSteps",                     STAMUNIT_OCCURENCES, "Virtual time 1ns steps (due to TSC / GIP variations).");
    678     STAM_REL_REG_USED(pVM,(void*)&pVM->tm.s.VirtualGetRawDataRC.cBadPrev, STAMTYPE_U32, "/TM/RC/cBadPrev",                     STAMUNIT_OCCURENCES, "Times the previous virtual time was considered erratic (shouldn't ever happen).");
    679676    STAM_REL_REG(     pVM,(void*)&pVM->tm.s.offVirtualSync,               STAMTYPE_U64, "/TM/VirtualSync/CurrentOffset",               STAMUNIT_NS, "The current offset. (subtract GivenUp to get the lag)");
    680677    STAM_REL_REG_USED(pVM,(void*)&pVM->tm.s.offVirtualSyncGivenUp,        STAMTYPE_U64, "/TM/VirtualSync/GivenUp",                     STAMUNIT_NS, "Nanoseconds of the 'CurrentOffset' that's been given up and won't ever be attempted caught up with.");
     
    692689    STAM_REG_USED(pVM,(void *)&pVM->tm.s.VirtualGetRawDataR0.cExpired,    STAMTYPE_U32, "/TM/R0/cExpired",                     STAMUNIT_OCCURENCES, "Times the TSC interval expired (overlaps 1ns steps).");
    693690    STAM_REG_USED(pVM,(void *)&pVM->tm.s.VirtualGetRawDataR0.cUpdateRaces,STAMTYPE_U32, "/TM/R0/cUpdateRaces",                 STAMUNIT_OCCURENCES, "Thread races when updating the previous timestamp.");
    694     STAM_REG_USED(pVM,(void *)&pVM->tm.s.VirtualGetRawDataRC.cExpired,    STAMTYPE_U32, "/TM/RC/cExpired",                     STAMUNIT_OCCURENCES, "Times the TSC interval expired (overlaps 1ns steps).");
    695     STAM_REG_USED(pVM,(void *)&pVM->tm.s.VirtualGetRawDataRC.cUpdateRaces,STAMTYPE_U32, "/TM/RC/cUpdateRaces",                 STAMUNIT_OCCURENCES, "Thread races when updating the previous timestamp.");
    696691    STAM_REG(pVM, &pVM->tm.s.StatDoQueues,                            STAMTYPE_PROFILE, "/TM/DoQueues",                    STAMUNIT_TICKS_PER_CALL, "Profiling timer TMR3TimerQueuesDo.");
    697692    STAM_REG(pVM, &pVM->tm.s.aTimerQueues[TMCLOCK_VIRTUAL].StatDo,    STAMTYPE_PROFILE, "/TM/DoQueues/Virtual",            STAMUNIT_TICKS_PER_CALL, "Time spent on the virtual clock queue.");
     
    10691064     * Resolve symbols.
    10701065     */
    1071     if (VM_IS_RAW_MODE_ENABLED(pVM))
    1072     {
    1073         rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBad",           &pVM->tm.s.VirtualGetRawDataRC.pfnBad);
    1074         AssertRCReturn(rc, rc);
    1075         rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSBadCpuIndex",   &pVM->tm.s.VirtualGetRawDataRC.pfnBadCpuIndex);
    1076         AssertRCReturn(rc, rc);
    1077         rc = PDMR3LdrGetSymbolRC(pVM, NULL, "tmVirtualNanoTSRediscover",    &pVM->tm.s.VirtualGetRawDataRC.pfnRediscover);
    1078         AssertRCReturn(rc, rc);
    1079         pVM->tm.s.pfnVirtualGetRawRC = pVM->tm.s.VirtualGetRawDataRC.pfnRediscover;
    1080     }
    1081 
    10821066    rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSBad",           &pVM->tm.s.VirtualGetRawDataR0.pfnBad);
    10831067    AssertRCReturn(rc, rc);
     
    11501134{
    11511135    LogFlow(("TMR3Relocate\n"));
    1152 
    1153     if (VM_IS_RAW_MODE_ENABLED(pVM))
    1154     {
    1155         pVM->tm.s.pvGIPRC           = MMHyperR3ToRC(pVM, pVM->tm.s.pvGIPR3);
    1156         pVM->tm.s.VirtualGetRawDataRC.pu64Prev       += offDelta;
    1157         pVM->tm.s.VirtualGetRawDataRC.pfnBad         += offDelta;
    1158         pVM->tm.s.VirtualGetRawDataRC.pfnBadCpuIndex += offDelta;
    1159         pVM->tm.s.VirtualGetRawDataRC.pfnRediscover  += offDelta;
    1160         pVM->tm.s.pfnVirtualGetRawRC                 += offDelta;
    1161     }
     1136    RT_NOREF(pVM, offDelta);
    11621137}
    11631138
     
    12821257        pVCpu->tm.s.u64TSCLastSeen = 0;
    12831258    }
    1284 }
    1285 
    1286 
    1287 /**
    1288  * Resolve a builtin RC symbol.
    1289  * Called by PDM when loading or relocating GC modules.
    1290  *
    1291  * @returns VBox status
    1292  * @param   pVM             The cross context VM structure.
    1293  * @param   pszSymbol       Symbol to resolve.
    1294  * @param   pRCPtrValue     Where to store the symbol value.
    1295  * @remark  This has to     work before TMR3Relocate() is called.
    1296  */
    1297 VMM_INT_DECL(int) TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue)
    1298 {
    1299     if (!strcmp(pszSymbol, "g_pSUPGlobalInfoPage"))
    1300         *pRCPtrValue = MMHyperR3ToRC(pVM, &pVM->tm.s.pvGIPRC);
    1301     //else if (..)
    1302     else
    1303         return VERR_SYMBOL_NOT_FOUND;
    1304     return VINF_SUCCESS;
    13051259}
    13061260
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