VirtualBox

Changeset 91939 in vbox


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
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/mm.h

    r91907 r91939  
    159159#endif
    160160VMMDECL(RTR0PTR)    MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr);
    161 VMMDECL(RTRCPTR)    MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr);
    162161VMMDECL(RTR3PTR)    MMHyperRCToR3(PVM pVM, RTRCPTR RCPtr);
    163162VMMDECL(RTR0PTR)    MMHyperRCToR0(PVM pVM, RTRCPTR RCPtr);
  • trunk/include/VBox/vmm/tm.h

    r87792 r91939  
    270270VMM_INT_DECL(int)       TMR3Term(PVM pVM);
    271271VMM_INT_DECL(void)      TMR3Reset(PVM pVM);
    272 VMM_INT_DECL(int)       TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);
    273272VMM_INT_DECL(int)       TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback,
    274273                                              void *pvUser, uint32_t fFlags, const char *pszName, PTMTIMERHANDLE phTimer);
  • trunk/src/VBox/VMM/VMMAll/MMAll.cpp

    r91907 r91939  
    368368
    369369
    370 /**
    371  * Converts a ring-3 host context address in the Hypervisor memory region to a guest context address.
    372  *
    373  * @returns guest context address.
    374  * @param   pVM         The cross context VM structure.
    375  * @param   R3Ptr       The ring-3 host context address.
    376  *                      You'll be damned if this is not in the HMA! :-)
    377  * @thread  The Emulation Thread.
    378  */
    379 VMMDECL(RTRCPTR) MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr)
    380 {
    381     uint32_t off;
    382     PMMLOOKUPHYPER pLookup = mmHyperLookupR3(pVM, R3Ptr, &off);
    383     if (pLookup)
    384         return mmHyperLookupCalcRC(pVM, pLookup, off);
    385     AssertMsgFailed(("R3Ptr=%p is not inside the hypervisor memory area!\n", R3Ptr));
    386     return NIL_RTRCPTR;
    387 }
    388 
    389 
    390370#ifndef IN_RING3
    391371/**
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r91852 r91939  
    157157    AssertPtr(ppPhysHandler);
    158158    AssertReturn(pType->u32Magic == PGMPHYSHANDLERTYPEINT_MAGIC, VERR_INVALID_HANDLE);
     159#ifdef VBOX_WITH_RAW_MODE_KEEP
    159160    AssertMsgReturn(    (RTRCUINTPTR)pvUserRC < 0x10000
    160161                    ||  MMHyperR3ToRC(pVM, MMHyperRCToR3(pVM, pvUserRC)) == pvUserRC,
    161162                    ("Not RC pointer! pvUserRC=%RRv\n", pvUserRC),
    162163                    VERR_INVALID_PARAMETER);
     164#endif
    163165#if 0 /* No longer valid. */
    164166    AssertMsgReturn(    (RTR0UINTPTR)pvUserR0 < 0x10000
  • 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
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r91931 r91939  
    31143114    /** The ring-0 mapping of the zero page. */
    31153115    RTR0PTR                         pvZeroPgR0;
    3116     /** The GC mapping of the zero page. */
    3117     RTRCPTR                         pvZeroPgRC;
    3118     RTRCPTR                         RCPtrAlignment3;
    31193116    /** @}*/
    31203117
  • trunk/src/VBox/VMM/include/TMInternal.h

    r90639 r91939  
    490490    /** The ring-0 data structure for the RTTimeNanoTS workers used by tmVirtualGetRawNanoTS. */
    491491    RTTIMENANOTSDATAR0          VirtualGetRawDataR0;
    492     /** The ring-0 data structure for the RTTimeNanoTS workers used by tmVirtualGetRawNanoTS. */
    493     RTTIMENANOTSDATARC          VirtualGetRawDataRC;
    494492    /** Pointer to the ring-3 tmVirtualGetRawNanoTS worker function. */
    495493    R3PTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawR3;
    496494    /** Pointer to the ring-0 tmVirtualGetRawNanoTS worker function. */
    497495    R0PTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawR0;
    498     /** Pointer to the raw-mode tmVirtualGetRawNanoTS worker function. */
    499     RCPTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawRC;
    500     /** Alignment. */
    501     RTRCPTR                     AlignmentRCPtr;
    502496    /** The guest virtual timer synchronous time when fVirtualSyncTicking is cleared.
    503497     * When fVirtualSyncTicking is set it holds the last time returned to
     
    577571    /** File to touch on UTC jump. */
    578572    R3PTRTYPE(char *)           pszUtcTouchFileOnJump;
    579     /** Just to avoid dealing with 32-bit alignment trouble. */
    580     R3PTRTYPE(char *)           pszAlignment2b;
    581 
    582     /** Pointer to our RC mapping of the GIP. */
    583     RCPTRTYPE(void *)           pvGIPRC;
     573
    584574    /** Pointer to our R3 mapping of the GIP. */
    585575    R3PTRTYPE(void *)           pvGIPR3;
    586 
    587576
    588577    /** The schedule timer timer handle (runtime timer).
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