Changeset 62644 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jul 28, 2016 9:40:25 PM (8 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMCritSect.cpp
r62478 r62644 54 54 int pdmR3CritSectBothInitStats(PVM pVM) 55 55 { 56 RT_NOREF_PV(pVM); 56 57 STAM_REG(pVM, &pVM->pdm.s.StatQueuedCritSectLeaves, STAMTYPE_COUNTER, "/PDM/QueuedCritSectLeaves", STAMUNIT_OCCURENCES, 57 58 "Number of times a critical section leave request needed to be queued for ring-3 execution."); … … 154 155 if (pszName) 155 156 { 157 RT_SRC_POS_NOREF(); 156 158 #ifndef PDMCRITSECT_STRICT 157 159 pCritSect->Core.pValidatorRec = NULL; … … 246 248 pCritSect->Core.pValidatorRead = NULL; 247 249 pCritSect->Core.pValidatorWrite = NULL; 250 RT_SRC_POS_NOREF(); 248 251 #ifdef PDMCRITSECTRW_STRICT 249 252 # ifdef RT_LOCK_STRICT_ORDER -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r62478 r62644 2166 2166 VMMR3DECL(int) PGMR3InitFinalize(PVM pVM) 2167 2167 { 2168 int rc ;2168 int rc = VERR_IPE_UNINITIALIZED_STATUS; /* (MSC incorrectly thinks it can be usused uninitialized) */ 2169 2169 2170 2170 /* … … 4208 4208 */ 4209 4209 int cErrors = 0; 4210 const static PGMCHECKINTARGS s_LeftToRight = { true, NULL, NULL, NULL, pVM };4211 const static PGMCHECKINTARGS s_RightToLeft = { false, NULL, NULL, NULL, pVM };4212 PGMCHECKINTARGS Args = s_LeftToRight;4210 const PGMCHECKINTARGS LeftToRight = { true, NULL, NULL, NULL, pVM }; 4211 const PGMCHECKINTARGS RightToLeft = { false, NULL, NULL, NULL, pVM }; 4212 PGMCHECKINTARGS Args = LeftToRight; 4213 4213 cErrors += RTAvlroGCPhysDoWithAll(&pVM->pgm.s.pTreesR3->PhysHandlers, true, pgmR3CheckIntegrityPhysHandlerNode, &Args); 4214 Args = s_RightToLeft;4214 Args = RightToLeft; 4215 4215 cErrors += RTAvlroGCPhysDoWithAll(&pVM->pgm.s.pTreesR3->PhysHandlers, false, pgmR3CheckIntegrityPhysHandlerNode, &Args); 4216 4216 #ifdef VBOX_WITH_RAW_MODE 4217 Args = s_LeftToRight;4217 Args = LeftToRight; 4218 4218 cErrors += RTAvlroGCPtrDoWithAll( &pVM->pgm.s.pTreesR3->VirtHandlers, true, pgmR3CheckIntegrityVirtHandlerNode, &Args); 4219 Args = s_RightToLeft;4219 Args = RightToLeft; 4220 4220 cErrors += RTAvlroGCPtrDoWithAll( &pVM->pgm.s.pTreesR3->VirtHandlers, false, pgmR3CheckIntegrityVirtHandlerNode, &Args); 4221 Args = s_LeftToRight;4221 Args = LeftToRight; 4222 4222 cErrors += RTAvlroGCPtrDoWithAll( &pVM->pgm.s.pTreesR3->HyperVirtHandlers, true, pgmR3CheckIntegrityVirtHandlerNode, &Args); 4223 Args = s_RightToLeft;4223 Args = RightToLeft; 4224 4224 cErrors += RTAvlroGCPtrDoWithAll( &pVM->pgm.s.pTreesR3->HyperVirtHandlers, false, pgmR3CheckIntegrityVirtHandlerNode, &Args); 4225 Args = s_LeftToRight;4225 Args = LeftToRight; 4226 4226 cErrors += RTAvlroGCPhysDoWithAll(&pVM->pgm.s.pTreesR3->PhysToVirtHandlers, true, pgmR3CheckIntegrityPhysToVirtHandlerNode, &Args); 4227 Args = s_RightToLeft;4227 Args = RightToLeft; 4228 4228 cErrors += RTAvlroGCPhysDoWithAll(&pVM->pgm.s.pTreesR3->PhysToVirtHandlers, false, pgmR3CheckIntegrityPhysToVirtHandlerNode, &Args); 4229 4229 #endif /* VBOX_WITH_RAW_MODE */ -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r62478 r62644 1252 1252 && PGM_PAGE_IS_FT_DIRTY(pPage)) 1253 1253 { 1254 u nsignedcbPageRange = PAGE_SIZE;1255 u nsignediPageClean = iPage + 1;1254 uint32_t cbPageRange = PAGE_SIZE; 1255 uint32_t iPageClean = iPage + 1; 1256 1256 RTGCPHYS GCPhysPage = pRam->GCPhys + iPage * PAGE_SIZE; 1257 1257 uint8_t *pu8Page = NULL; … … 1285 1285 } 1286 1286 1287 for (iPage; iPage < iPageClean; iPage++) 1288 PGM_PAGE_CLEAR_FT_DIRTY(&pRam->aPages[iPage]); 1289 1290 iPage = iPageClean - 1; 1287 for (uint32_t iTmp = iPage; iTmp < iPageClean; iTmp++) 1288 PGM_PAGE_CLEAR_FT_DIRTY(&pRam->aPages[iTmp]); 1291 1289 } 1292 1290 break; … … 1509 1507 PPGMRAMRANGE pRam = (PPGMRAMRANGE)pvUser; 1510 1508 Assert(pRam->fFlags & PGM_RAM_RANGE_FLAGS_FLOATING); 1511 Assert(pRam->pSelfRC == GCPtrOld + PAGE_SIZE); 1509 Assert(pRam->pSelfRC == GCPtrOld + PAGE_SIZE); RT_NOREF_PV(GCPtrOld); 1512 1510 1513 1511 switch (enmMode) … … 2542 2540 if (RT_SUCCESS(rc)) 2543 2541 { 2544 void *pvPages;2545 2542 PSUPPAGE paPages = (PSUPPAGE)RTMemTmpAlloc(cPages * sizeof(SUPPAGE)); 2546 2543 if (RT_SUCCESS(rc)) 2544 { 2545 void *pvPages; 2547 2546 rc = SUPR3PageAllocEx(cPages, 0 /*fFlags*/, &pvPages, NULL /*pR0Ptr*/, paPages); 2548 if (RT_SUCCESS(rc))2549 {2550 memset(pvPages, 0, cPages * PAGE_SIZE);2551 2552 /*2553 * Create the MMIO2 range record for it.2554 */2555 const size_t cbRange = RT_OFFSETOF(PGMMMIO2RANGE, RamRange.aPages[cPages]);2556 PPGMMMIO2RANGE pNew;2557 rc = MMR3HyperAllocOnceNoRel(pVM, cbRange, 0, MM_TAG_PGM_PHYS, (void **)&pNew);2558 AssertLogRelMsgRC(rc, ("cbRamRange=%zu\n", cbRange));2559 2547 if (RT_SUCCESS(rc)) 2560 2548 { 2561 pNew->pDevInsR3 = pDevIns; 2562 pNew->pvR3 = pvPages; 2563 //pNew->pNext = NULL; 2564 //pNew->fMapped = false; 2565 //pNew->fOverlapping = false; 2566 pNew->iRegion = iRegion; 2567 pNew->idSavedState = UINT8_MAX; 2568 pNew->idMmio2 = idMmio2; 2569 pNew->RamRange.pSelfR0 = MMHyperCCToR0(pVM, &pNew->RamRange); 2570 pNew->RamRange.pSelfRC = MMHyperCCToRC(pVM, &pNew->RamRange); 2571 pNew->RamRange.GCPhys = NIL_RTGCPHYS; 2572 pNew->RamRange.GCPhysLast = NIL_RTGCPHYS; 2573 pNew->RamRange.pszDesc = pszDesc; 2574 pNew->RamRange.cb = cb; 2575 pNew->RamRange.fFlags = PGM_RAM_RANGE_FLAGS_AD_HOC_MMIO2; 2576 pNew->RamRange.pvR3 = pvPages; 2577 //pNew->RamRange.paLSPages = NULL; 2578 2579 uint32_t iPage = cPages; 2580 while (iPage-- > 0) 2549 memset(pvPages, 0, cPages * PAGE_SIZE); 2550 2551 /* 2552 * Create the MMIO2 range record for it. 2553 */ 2554 const size_t cbRange = RT_OFFSETOF(PGMMMIO2RANGE, RamRange.aPages[cPages]); 2555 PPGMMMIO2RANGE pNew; 2556 rc = MMR3HyperAllocOnceNoRel(pVM, cbRange, 0, MM_TAG_PGM_PHYS, (void **)&pNew); 2557 AssertLogRelMsgRC(rc, ("cbRamRange=%zu\n", cbRange)); 2558 if (RT_SUCCESS(rc)) 2581 2559 { 2582 PGM_PAGE_INIT(&pNew->RamRange.aPages[iPage], 2583 paPages[iPage].Phys, 2584 PGM_MMIO2_PAGEID_MAKE(idMmio2, iPage), 2585 PGMPAGETYPE_MMIO2, PGM_PAGE_STATE_ALLOCATED); 2560 pNew->pDevInsR3 = pDevIns; 2561 pNew->pvR3 = pvPages; 2562 //pNew->pNext = NULL; 2563 //pNew->fMapped = false; 2564 //pNew->fOverlapping = false; 2565 pNew->iRegion = iRegion; 2566 pNew->idSavedState = UINT8_MAX; 2567 pNew->idMmio2 = idMmio2; 2568 pNew->RamRange.pSelfR0 = MMHyperCCToR0(pVM, &pNew->RamRange); 2569 pNew->RamRange.pSelfRC = MMHyperCCToRC(pVM, &pNew->RamRange); 2570 pNew->RamRange.GCPhys = NIL_RTGCPHYS; 2571 pNew->RamRange.GCPhysLast = NIL_RTGCPHYS; 2572 pNew->RamRange.pszDesc = pszDesc; 2573 pNew->RamRange.cb = cb; 2574 pNew->RamRange.fFlags = PGM_RAM_RANGE_FLAGS_AD_HOC_MMIO2; 2575 pNew->RamRange.pvR3 = pvPages; 2576 //pNew->RamRange.paLSPages = NULL; 2577 2578 uint32_t iPage = cPages; 2579 while (iPage-- > 0) 2580 { 2581 PGM_PAGE_INIT(&pNew->RamRange.aPages[iPage], 2582 paPages[iPage].Phys, 2583 PGM_MMIO2_PAGEID_MAKE(idMmio2, iPage), 2584 PGMPAGETYPE_MMIO2, PGM_PAGE_STATE_ALLOCATED); 2585 } 2586 2587 /* update page count stats */ 2588 pVM->pgm.s.cAllPages += cPages; 2589 pVM->pgm.s.cPrivatePages += cPages; 2590 2591 /* 2592 * Link it into the list. 2593 * Since there is no particular order, just push it. 2594 */ 2595 /** @todo we can save us the linked list now, just search the lookup table... */ 2596 pgmLock(pVM); 2597 Assert(pVM->pgm.s.apMmio2RangesR3[idMmio2 - 1] == NULL); 2598 Assert(pVM->pgm.s.apMmio2RangesR0[idMmio2 - 1] == NIL_RTR0PTR); 2599 pNew->pNextR3 = pVM->pgm.s.pMmio2RangesR3; 2600 pVM->pgm.s.pMmio2RangesR3 = pNew; 2601 pVM->pgm.s.apMmio2RangesR3[idMmio2 - 1] = pNew; 2602 pVM->pgm.s.apMmio2RangesR0[idMmio2 - 1] = MMHyperCCToR0(pVM, pNew); 2603 pgmUnlock(pVM); 2604 2605 *ppv = pvPages; 2606 RTMemTmpFree(paPages); 2607 pgmPhysInvalidatePageMapTLB(pVM); 2608 return VINF_SUCCESS; 2586 2609 } 2587 2610 2588 /* update page count stats */ 2589 pVM->pgm.s.cAllPages += cPages; 2590 pVM->pgm.s.cPrivatePages += cPages; 2591 2592 /* 2593 * Link it into the list. 2594 * Since there is no particular order, just push it. 2595 */ 2596 /** @todo we can save us the linked list now, just search the lookup table... */ 2597 pgmLock(pVM); 2598 Assert(pVM->pgm.s.apMmio2RangesR3[idMmio2 - 1] == NULL); 2599 Assert(pVM->pgm.s.apMmio2RangesR0[idMmio2 - 1] == NIL_RTR0PTR); 2600 pNew->pNextR3 = pVM->pgm.s.pMmio2RangesR3; 2601 pVM->pgm.s.pMmio2RangesR3 = pNew; 2602 pVM->pgm.s.apMmio2RangesR3[idMmio2 - 1] = pNew; 2603 pVM->pgm.s.apMmio2RangesR0[idMmio2 - 1] = MMHyperCCToR0(pVM, pNew); 2604 pgmUnlock(pVM); 2605 2606 *ppv = pvPages; 2607 RTMemTmpFree(paPages); 2608 pgmPhysInvalidatePageMapTLB(pVM); 2609 return VINF_SUCCESS; 2611 SUPR3PageFreeEx(pvPages, cPages); 2610 2612 } 2611 2612 SUPR3PageFreeEx(pvPages, cPages);2613 2613 } 2614 2614 RTMemTmpFree(paPages); -
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r62478 r62644 2040 2040 return false; 2041 2041 } 2042 # else 2043 RT_NOREF_PV(pVM); 2042 2044 # endif 2043 2045 return true; … … 2500 2502 * @param pszMsg Message to prepend the log entry with. 2501 2503 */ 2502 VMMR3DECL(void) SELMR3DumpDescriptor(X86DESC Desc, RTSEL Sel, const char *pszMsg) 2503 { 2504 char szOutput[128]; 2505 selmR3FormatDescriptor(Desc, Sel, &szOutput[0], sizeof(szOutput)); 2506 Log(("%s: %s\n", pszMsg, szOutput)); 2507 NOREF(szOutput[0]); 2504 VMMR3DECL(void) SELMR3DumpDescriptor(X86DESC Desc, RTSEL Sel, const char *pszMsg) 2505 { 2506 #ifdef LOG_ENABLED 2507 if (LogIsEnabled()) 2508 { 2509 char szOutput[128]; 2510 selmR3FormatDescriptor(Desc, Sel, &szOutput[0], sizeof(szOutput)); 2511 Log(("%s: %s\n", pszMsg, szOutput)); 2512 } 2513 #else 2514 RT_NOREF3(Desc, Sel, pszMsg); 2515 #endif 2508 2516 } 2509 2517 -
trunk/src/VBox/VMM/VMMR3/STAM.cpp
r62478 r62644 830 830 do 831 831 { 832 PSTAMLOOKUP pChild = p Cur->papChildren[iCur];832 PSTAMLOOKUP pChild = papChildren[iCur]; 833 833 if (pChild->pDesc) 834 834 return pChild->pDesc; … … 908 908 * Check all children. 909 909 */ 910 PSTAMLOOKUP * papChildren = pCur->papChildren;910 PSTAMLOOKUP * const papChildren = pCur->papChildren; 911 911 do 912 912 { 913 PSTAMLOOKUP pChild = p Cur->papChildren[iCur];913 PSTAMLOOKUP pChild = papChildren[iCur]; 914 914 if (pChild->pDesc) 915 915 return pChild->pDesc; … … 963 963 * Check children backwards, depth first. 964 964 */ 965 PSTAMLOOKUP * papChildren = pCur->papChildren;965 PSTAMLOOKUP * const papChildren = pCur->papChildren; 966 966 do 967 967 { 968 PSTAMLOOKUP pChild = p Cur->papChildren[iCur];968 PSTAMLOOKUP pChild = papChildren[iCur]; 969 969 if (pChild->cChildren > 0) 970 970 { … … 1446 1446 * 1447 1447 * @returns VINF_SUCCESS 1448 * @param pUVM Pointer to the user mode VM structure.1449 1448 * @param pCur The descriptor to destroy. 1450 1449 */ 1451 static int stamR3DestroyDesc(P UVM pUVM, PSTAMDESC pCur)1450 static int stamR3DestroyDesc(PSTAMDESC pCur) 1452 1451 { 1453 1452 RTListNodeRemove(&pCur->ListEntry); … … 1493 1492 { 1494 1493 if (pCur->u.pv == pvSample) 1495 rc = stamR3DestroyDesc(p UVM, pCur);1494 rc = stamR3DestroyDesc(pCur); 1496 1495 } 1497 1496 … … 1526 1525 1527 1526 if (RTStrSimplePatternMatch(pszPat, pCur->pszName)) 1528 rc = stamR3DestroyDesc(p UVM, pCur);1527 rc = stamR3DestroyDesc(pCur); 1529 1528 1530 1529 /* advance. */ … … 1722 1721 ASMAtomicXchgU64(&pDesc->u.pProfile->cTicks, 0); 1723 1722 ASMAtomicXchgU64(&pDesc->u.pProfile->cTicksMax, 0); 1724 ASMAtomicXchgU64(&pDesc->u.pProfile->cTicksMin, ~0);1723 ASMAtomicXchgU64(&pDesc->u.pProfile->cTicksMin, UINT64_MAX); 1725 1724 break; 1726 1725 -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r62596 r62644 170 170 static bool tmR3HasFixedTSC(PVM pVM); 171 171 static const char * tmR3GetTSCModeName(PVM pVM); 172 static uint64_t tmR3CalibrateTSC( PVM pVM);172 static uint64_t tmR3CalibrateTSC(void); 173 173 static DECLCALLBACK(int) tmR3Save(PVM pVM, PSSMHANDLE pSSM); 174 174 static DECLCALLBACK(int) tmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); … … 415 415 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 416 416 { 417 pVM->tm.s.cTSCTicksPerSecond = tmR3CalibrateTSC( pVM);417 pVM->tm.s.cTSCTicksPerSecond = tmR3CalibrateTSC(); 418 418 if ( pVM->tm.s.enmTSCMode != TMTSCMODE_REAL_TSC_OFFSET 419 419 && pVM->tm.s.cTSCTicksPerSecond >= _4G) … … 925 925 * @returns Number of ticks per second. 926 926 */ 927 static uint64_t tmR3CalibrateTSC( PVM pVM)927 static uint64_t tmR3CalibrateTSC(void) 928 928 { 929 929 uint64_t u64Hz; … … 3253 3253 Assert( pVM->tm.s.enmTSCMode == TMTSCMODE_REAL_TSC_OFFSET 3254 3254 && pVM->tm.s.enmTSCMode != pVM->tm.s.enmOriginalTSCMode); 3255 RT_NOREF1(pvData); 3255 3256 3256 3257 /*
Note:
See TracChangeset
for help on using the changeset viewer.