Changeset 91939 in vbox
- Timestamp:
- Oct 21, 2021 12:43:45 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/mm.h
r91907 r91939 159 159 #endif 160 160 VMMDECL(RTR0PTR) MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr); 161 VMMDECL(RTRCPTR) MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr);162 161 VMMDECL(RTR3PTR) MMHyperRCToR3(PVM pVM, RTRCPTR RCPtr); 163 162 VMMDECL(RTR0PTR) MMHyperRCToR0(PVM pVM, RTRCPTR RCPtr); -
trunk/include/VBox/vmm/tm.h
r87792 r91939 270 270 VMM_INT_DECL(int) TMR3Term(PVM pVM); 271 271 VMM_INT_DECL(void) TMR3Reset(PVM pVM); 272 VMM_INT_DECL(int) TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue);273 272 VMM_INT_DECL(int) TMR3TimerCreateDevice(PVM pVM, PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, 274 273 void *pvUser, uint32_t fFlags, const char *pszName, PTMTIMERHANDLE phTimer); -
trunk/src/VBox/VMM/VMMAll/MMAll.cpp
r91907 r91939 368 368 369 369 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 390 370 #ifndef IN_RING3 391 371 /** -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r91852 r91939 157 157 AssertPtr(ppPhysHandler); 158 158 AssertReturn(pType->u32Magic == PGMPHYSHANDLERTYPEINT_MAGIC, VERR_INVALID_HANDLE); 159 #ifdef VBOX_WITH_RAW_MODE_KEEP 159 160 AssertMsgReturn( (RTRCUINTPTR)pvUserRC < 0x10000 160 161 || MMHyperR3ToRC(pVM, MMHyperRCToR3(pVM, pvUserRC)) == pvUserRC, 161 162 ("Not RC pointer! pvUserRC=%RRv\n", pvUserRC), 162 163 VERR_INVALID_PARAMETER); 164 #endif 163 165 #if 0 /* No longer valid. */ 164 166 AssertMsgReturn( (RTR0UINTPTR)pvUserR0 < 0x10000 -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r91895 r91939 679 679 680 680 } 681 #endif 681 #endif /* VBOX_WITH_RAW_MODE_KEEP */ 682 682 } 683 683 -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r91905 r91939 746 746 AssertReleaseRCReturn(rc, rc); 747 747 } 748 #ifdef VBOX_WITH_RAW_MODE_KEEP 748 749 if ( (pDrv->pReg->fFlags & PDM_DRVREG_FLAGS_RC) 749 750 && VM_IS_RAW_MODE_ENABLED(pVM)) … … 753 754 AssertReleaseRCReturn(rc, rc); 754 755 } 756 #endif 755 757 756 758 pDrv->iNextInstance++; -
trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp
r91854 r91939 398 398 RTRCPTR RCPtr = 0; 399 399 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);408 400 if (RT_SUCCESS(rc)) 409 401 *pValue = RCPtr; -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r91904 r91939 924 924 if (RT_SUCCESS(rc)) 925 925 { 926 pVM->pgm.s.pvZeroPgRC = MMHyperR3ToRC(pVM, pVM->pgm.s.pvZeroPgR3);927 926 pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3); 928 927 pVM->pgm.s.HCPhysZeroPg = MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.pvZeroPgR3); -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r91854 r91939 291 291 pVM->tm.s.VirtualGetRawDataR3.pfnBadCpuIndex = tmVirtualNanoTSBadCpuIndex; 292 292 pVM->tm.s.VirtualGetRawDataR3.pu64Prev = &pVM->tm.s.u64VirtualRawPrev; 293 pVM->tm.s.VirtualGetRawDataRC.pu64Prev = MMHyperR3ToRC(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev);294 293 pVM->tm.s.VirtualGetRawDataR0.pu64Prev = MMHyperR3ToR0(pVM, (void *)&pVM->tm.s.u64VirtualRawPrev); 295 294 AssertRelease(pVM->tm.s.VirtualGetRawDataR0.pu64Prev); … … 675 674 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)."); 676 675 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).");679 676 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)"); 680 677 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."); … … 692 689 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)."); 693 690 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.");696 691 STAM_REG(pVM, &pVM->tm.s.StatDoQueues, STAMTYPE_PROFILE, "/TM/DoQueues", STAMUNIT_TICKS_PER_CALL, "Profiling timer TMR3TimerQueuesDo."); 697 692 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."); … … 1069 1064 * Resolve symbols. 1070 1065 */ 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 1082 1066 rc = PDMR3LdrGetSymbolR0(pVM, NULL, "tmVirtualNanoTSBad", &pVM->tm.s.VirtualGetRawDataR0.pfnBad); 1083 1067 AssertRCReturn(rc, rc); … … 1150 1134 { 1151 1135 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); 1162 1137 } 1163 1138 … … 1282 1257 pVCpu->tm.s.u64TSCLastSeen = 0; 1283 1258 } 1284 }1285 1286 1287 /**1288 * Resolve a builtin RC symbol.1289 * Called by PDM when loading or relocating GC modules.1290 *1291 * @returns VBox status1292 * @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 else1303 return VERR_SYMBOL_NOT_FOUND;1304 return VINF_SUCCESS;1305 1259 } 1306 1260 -
trunk/src/VBox/VMM/include/PGMInternal.h
r91931 r91939 3114 3114 /** The ring-0 mapping of the zero page. */ 3115 3115 RTR0PTR pvZeroPgR0; 3116 /** The GC mapping of the zero page. */3117 RTRCPTR pvZeroPgRC;3118 RTRCPTR RCPtrAlignment3;3119 3116 /** @}*/ 3120 3117 -
trunk/src/VBox/VMM/include/TMInternal.h
r90639 r91939 490 490 /** The ring-0 data structure for the RTTimeNanoTS workers used by tmVirtualGetRawNanoTS. */ 491 491 RTTIMENANOTSDATAR0 VirtualGetRawDataR0; 492 /** The ring-0 data structure for the RTTimeNanoTS workers used by tmVirtualGetRawNanoTS. */493 RTTIMENANOTSDATARC VirtualGetRawDataRC;494 492 /** Pointer to the ring-3 tmVirtualGetRawNanoTS worker function. */ 495 493 R3PTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawR3; 496 494 /** Pointer to the ring-0 tmVirtualGetRawNanoTS worker function. */ 497 495 R0PTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawR0; 498 /** Pointer to the raw-mode tmVirtualGetRawNanoTS worker function. */499 RCPTRTYPE(PFNTIMENANOTSINTERNAL) pfnVirtualGetRawRC;500 /** Alignment. */501 RTRCPTR AlignmentRCPtr;502 496 /** The guest virtual timer synchronous time when fVirtualSyncTicking is cleared. 503 497 * When fVirtualSyncTicking is set it holds the last time returned to … … 577 571 /** File to touch on UTC jump. */ 578 572 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 584 574 /** Pointer to our R3 mapping of the GIP. */ 585 575 R3PTRTYPE(void *) pvGIPR3; 586 587 576 588 577 /** The schedule timer timer handle (runtime timer).
Note:
See TracChangeset
for help on using the changeset viewer.