diff options
Diffstat (limited to 'src/VBox/VMM/VMMR3')
-rw-r--r-- | src/VBox/VMM/VMMR3/CPUMDbg.cpp | 28 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp | 3 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/DBGFReg.cpp | 4 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/EMHwaccm.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/FTM.cpp | 6 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/HWACCM.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PATM.cpp | 4 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp | 113 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMBlkCache.cpp | 33 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMUsb.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGM.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMDbg.cpp | 5 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMMap.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMPhys.cpp | 1 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMPool.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMSavedState.cpp | 3 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMSharedPage.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGMShw.h | 1 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/SELM.cpp | 1 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/TM.cpp | 9 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/VM.cpp | 2 |
22 files changed, 95 insertions, 134 deletions
diff --git a/src/VBox/VMM/VMMR3/CPUMDbg.cpp b/src/VBox/VMM/VMMR3/CPUMDbg.cpp index 030b132c1d4..40caf7831d9 100644 --- a/src/VBox/VMM/VMMR3/CPUMDbg.cpp +++ b/src/VBox/VMM/VMMR3/CPUMDbg.cpp @@ -263,9 +263,7 @@ static DECLCALLBACK(int) cpumR3RegSet_ftw(void *pvUser, PCDBGFREGDESC pDesc, PCD */ static DECLCALLBACK(int) cpumR3RegGstGet_crX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) { - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; - + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); uint64_t u64Value; @@ -288,8 +286,7 @@ static DECLCALLBACK(int) cpumR3RegGstGet_crX(void *pvUser, PCDBGFREGDESC pDesc, static DECLCALLBACK(int) cpumR3RegGstSet_crX(void *pvUser, PCDBGFREGDESC pDesc, PCDBGFREGVAL pValue, PCDBGFREGVAL pfMask) { int rc; - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); @@ -345,9 +342,7 @@ static DECLCALLBACK(int) cpumR3RegGstSet_crX(void *pvUser, PCDBGFREGDESC pDesc, */ static DECLCALLBACK(int) cpumR3RegGstGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) { - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; - + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); uint64_t u64Value; @@ -370,8 +365,7 @@ static DECLCALLBACK(int) cpumR3RegGstGet_drX(void *pvUser, PCDBGFREGDESC pDesc, static DECLCALLBACK(int) cpumR3RegGstSet_drX(void *pvUser, PCDBGFREGDESC pDesc, PCDBGFREGVAL pValue, PCDBGFREGVAL pfMask) { int rc; - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); @@ -417,10 +411,9 @@ static DECLCALLBACK(int) cpumR3RegGstSet_drX(void *pvUser, PCDBGFREGDESC pDesc, */ static DECLCALLBACK(int) cpumR3RegGstGet_msr(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) { - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; - + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); + uint64_t u64Value; int rc = CPUMQueryGuestMsr(pVCpu, pDesc->offRegister, &u64Value); if (RT_SUCCESS(rc)) @@ -446,7 +439,6 @@ static DECLCALLBACK(int) cpumR3RegGstSet_msr(void *pvUser, PCDBGFREGDESC pDesc, { int rc; PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; VMCPU_ASSERT_EMT(pVCpu); @@ -497,9 +489,7 @@ static DECLCALLBACK(int) cpumR3RegGstSet_msr(void *pvUser, PCDBGFREGDESC pDesc, */ static DECLCALLBACK(int) cpumR3RegGstGet_stN(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) { - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum.s.Guest + pDesc->offRegister; - + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); Assert(pDesc->enmType == DBGFREGVALTYPE_R80); @@ -586,9 +576,7 @@ static DECLCALLBACK(int) cpumR3RegHyperSet_crX(void *pvUser, PCDBGFREGDESC pDesc */ static DECLCALLBACK(int) cpumR3RegHyperGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue) { - PVMCPU pVCpu = (PVMCPU)pvUser; - void const *pv = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister; - + PVMCPU pVCpu = (PVMCPU)pvUser; VMCPU_ASSERT_EMT(pVCpu); uint64_t u64Value; diff --git a/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp b/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp index c6462ab012b..c60d00e54b0 100644 --- a/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp +++ b/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp @@ -395,8 +395,7 @@ VMMR3DECL(int) DBGFR3AsSetAlias(PVM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor) RTDBGAS hAsOld; ASMAtomicXchgHandle(&pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld); uint32_t cRefs = RTDbgAsRelease(hAsOld); - Assert(cRefs > 0); - Assert(cRefs != UINT32_MAX); + Assert(cRefs > 0); Assert(cRefs != UINT32_MAX); NOREF(cRefs); rc = VINF_SUCCESS; } DBGF_AS_DB_UNLOCK_WRITE(pVM); diff --git a/src/VBox/VMM/VMMR3/DBGFReg.cpp b/src/VBox/VMM/VMMR3/DBGFReg.cpp index 8cc2f620dd1..c4ad5bcb985 100644 --- a/src/VBox/VMM/VMMR3/DBGFReg.cpp +++ b/src/VBox/VMM/VMMR3/DBGFReg.cpp @@ -470,7 +470,7 @@ static int dbgfR3RegRegisterCommon(PVM pVM, PCDBGFREGDESC paRegisters, DBGFREGSE while (iLookupRec-- > 0) { bool fInserted2 = RTStrSpaceInsert(&pVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core); - AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); + AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2); } DBGF_REG_DB_UNLOCK_WRITE(pVM); @@ -1724,8 +1724,6 @@ static void dbgfR3RegNmQueryAllPadEntries(PDBGFREGENTRYNM paRegs, size_t cRegs, */ static void dbgfR3RegNmQueryAllInSet(PCDBGFREGSET pSet, size_t cRegsToQuery, PDBGFREGENTRYNM paRegs, size_t cRegs) { - int rc = VINF_SUCCESS; - if (cRegsToQuery > pSet->cDescs) cRegsToQuery = pSet->cDescs; if (cRegsToQuery > cRegs) diff --git a/src/VBox/VMM/VMMR3/EMHwaccm.cpp b/src/VBox/VMM/VMMR3/EMHwaccm.cpp index 4e5a7111803..e9a2605400d 100644 --- a/src/VBox/VMM/VMMR3/EMHwaccm.cpp +++ b/src/VBox/VMM/VMMR3/EMHwaccm.cpp @@ -181,7 +181,9 @@ static int emR3ExecuteInstructionWorker(PVM pVM, PVMCPU pVCpu, int rcGC, const c static int emR3ExecuteInstructionWorker(PVM pVM, PVMCPU pVCpu, int rcGC) #endif { +#ifdef LOG_ENABLED PCPUMCTX pCtx = pVCpu->em.s.pCtx; +#endif int rc; /* diff --git a/src/VBox/VMM/VMMR3/FTM.cpp b/src/VBox/VMM/VMMR3/FTM.cpp index 24b23891790..e5866c4ac00 100644 --- a/src/VBox/VMM/VMMR3/FTM.cpp +++ b/src/VBox/VMM/VMMR3/FTM.cpp @@ -881,7 +881,7 @@ static int ftmR3SyncMem(PVM pVM) pNode->Core.Key = GCPhys; pNode->pPage = (void *)(pNode + 1); bool fRet = RTAvlGCPhysInsert(&pVM->ftm.s.standby.pPhysPageTree, &pNode->Core); - Assert(fRet); + Assert(fRet); NOREF(fRet); } /* Fetch the page. */ @@ -1017,7 +1017,7 @@ static DECLCALLBACK(int) ftmR3StandbyServeConnection(RTSOCKET Sock, void *pvUser if (RT_FAILURE(rc)) return VINF_SUCCESS; - /** todo: verify VM config. */ + /** @todo verify VM config. */ /* * Stop the server. @@ -1030,7 +1030,7 @@ static DECLCALLBACK(int) ftmR3StandbyServeConnection(RTSOCKET Sock, void *pvUser /* * Command processing loop. */ - bool fDone = false; + //bool fDone = false; for (;;) { bool fFullSync = false; diff --git a/src/VBox/VMM/VMMR3/HWACCM.cpp b/src/VBox/VMM/VMMR3/HWACCM.cpp index 919d36ca234..371bca4af3e 100644 --- a/src/VBox/VMM/VMMR3/HWACCM.cpp +++ b/src/VBox/VMM/VMMR3/HWACCM.cpp @@ -1559,7 +1559,7 @@ static int hwaccmR3TermCPU(PVM pVM) { for (VMCPUID i = 0; i < pVM->cCpus; i++) { - PVMCPU pVCpu = &pVM->aCpus[i]; + PVMCPU pVCpu = &pVM->aCpus[i]; NOREF(pVCpu); #ifdef VBOX_WITH_STATISTICS if (pVCpu->hwaccm.s.paStatExitReason) diff --git a/src/VBox/VMM/VMMR3/PATM.cpp b/src/VBox/VMM/VMMR3/PATM.cpp index 1ba174adb68..7212e669862 100644 --- a/src/VBox/VMM/VMMR3/PATM.cpp +++ b/src/VBox/VMM/VMMR3/PATM.cpp @@ -5625,7 +5625,7 @@ int patmR3RefreshPatch(PVM pVM, PPATMPATCHREC pPatchRec) /* Put the new patch back into the tree, because removing the old one kicked this one out. (hack alert) */ bool fInserted = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core); - Assert(fInserted); + Assert(fInserted); NOREF(fInserted); LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %RRv \n", pInstrGC)); STAM_COUNTER_INC(&pVM->patm.s.StatPatchRefreshSuccess); @@ -5677,7 +5677,7 @@ failure: /* Put the old patch back into the tree (or else it won't be saved) (hack alert) */ bool fInserted = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core); - Assert(fInserted); + Assert(fInserted); NOREF(fInserted); /* Enable again in case the dirty instruction is near the end and there are safe code paths. */ int rc2 = PATMR3EnablePatch(pVM, pInstrGC); diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp index 795ea90fe1f..113fce49174 100644 --- a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp +++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp @@ -1084,7 +1084,9 @@ static int pdmacFileEpRead(PPDMASYNCCOMPLETIONTASK pTask, PCRTSGSEG paSegments, size_t cSegments, size_t cbRead) { +#ifdef VBOX_WITH_STATISTICS PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint; +#endif LogFlowFunc(("pTask=%#p pEndpoint=%#p off=%RTfoff paSegments=%#p cSegments=%zu cbRead=%zu\n", pTask, pEndpoint, off, paSegments, cSegments, cbRead)); diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp index 19458071c4d..821d9c36628 100644 --- a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp +++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp @@ -1,11 +1,10 @@ /* $Id$ */ /** @file - * PDM Async I/O - Transport data asynchronous in R3 using EMT. - * Async File I/O manager. + * PDM Async I/O - Async File I/O manager. */ /* - * Copyright (C) 2006-2008 Oracle Corporation + * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -15,6 +14,10 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ + +/******************************************************************************* +* Header Files * +*******************************************************************************/ #define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION #define RT_STRICT #include <iprt/types.h> @@ -28,9 +31,10 @@ #include "PDMAsyncCompletionFileInternal.h" /** The update period for the I/O load statistics in ms. */ -#define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD 1000 +#define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD 1000 /** Maximum number of requests a manager will handle. */ -#define PDMACEPFILEMGR_REQS_STEP 512 +#define PDMACEPFILEMGR_REQS_STEP 512 + /******************************************************************************* * Internal functions * @@ -46,13 +50,12 @@ static PPDMACTASKFILE pdmacFileAioMgrNormalRangeLockFree(PPDMACEPFILEMGR pAioMgr static void pdmacFileAioMgrNormalReqCompleteRc(PPDMACEPFILEMGR pAioMgr, RTFILEAIOREQ hReq, int rc, size_t cbTransfered); + int pdmacFileAioMgrNormalInit(PPDMACEPFILEMGR pAioMgr) { - int rc = VINF_SUCCESS; - pAioMgr->cRequestsActiveMax = PDMACEPFILEMGR_REQS_STEP; - rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, RTFILEAIO_UNLIMITED_REQS); + int rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, RTFILEAIO_UNLIMITED_REQS); if (rc == VERR_OUT_OF_RANGE) rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, pAioMgr->cRequestsActiveMax); @@ -244,17 +247,15 @@ static bool pdmacFileAioMgrNormalIsBalancePossible(PPDMACEPFILEMGR pAioMgr) */ static void pdmacFileAioMgrNormalBalanceLoad(PPDMACEPFILEMGR pAioMgr) { - PPDMACEPFILEMGR pAioMgrNew = NULL; - int rc = VINF_SUCCESS; - /* * Check if balancing would improve the situation. */ if (pdmacFileAioMgrNormalIsBalancePossible(pAioMgr)) { - PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pAioMgr->pEndpointsHead->Core.pEpClass; + PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pAioMgr->pEndpointsHead->Core.pEpClass; + PPDMACEPFILEMGR pAioMgrNew = NULL; - rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgrNew, PDMACEPFILEMGRTYPE_ASYNC); + int rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgrNew, PDMACEPFILEMGRTYPE_ASYNC); if (RT_SUCCESS(rc)) { /* We will sort the list by request count per second. */ @@ -322,9 +323,6 @@ static void pdmacFileAioMgrNormalBalanceLoad(PPDMACEPFILEMGR pAioMgr) */ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) { - int rc = VINF_SUCCESS; - RTFILEAIOCTX hAioCtxNew = NIL_RTFILEAIOCTX; - LogFlowFunc(("pAioMgr=%#p\n", pAioMgr)); AssertMsg( pAioMgr->enmState == PDMACEPFILEMGRSTATE_GROWING @@ -341,8 +339,7 @@ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) while (pCurr) { RTFileClose(pCurr->hFile); - rc = RTFileOpen(&pCurr->hFile, pCurr->Core.pszUri, pCurr->fFlags); - AssertRC(rc); + int rc2 = RTFileOpen(&pCurr->hFile, pCurr->Core.pszUri, pCurr->fFlags); AssertRC(rc); pCurr = pCurr->AioMgr.pEndpointNext; } @@ -351,7 +348,8 @@ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) /* Create the new bigger context. */ pAioMgr->cRequestsActiveMax += PDMACEPFILEMGR_REQS_STEP; - rc = RTFileAioCtxCreate(&hAioCtxNew, RTFILEAIO_UNLIMITED_REQS); + RTFILEAIOCTX hAioCtxNew = NIL_RTFILEAIOCTX; + int rc = RTFileAioCtxCreate(&hAioCtxNew, RTFILEAIO_UNLIMITED_REQS); if (rc == VERR_OUT_OF_RANGE) rc = RTFileAioCtxCreate(&hAioCtxNew, pAioMgr->cRequestsActiveMax); @@ -359,7 +357,7 @@ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) { /* Close the old context. */ rc = RTFileAioCtxDestroy(pAioMgr->hAioCtx); - AssertRC(rc); + AssertRC(rc); /** @todo r=bird: Ignoring error code, will propagate. */ pAioMgr->hAioCtx = hAioCtxNew; @@ -386,11 +384,10 @@ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) #ifdef RT_OS_WINDOWS /* Assign the file to the new context. */ pCurr = pAioMgr->pEndpointsHead; - while (pCurr) { rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr->hFile); - AssertRC(rc); + AssertRC(rc); /** @todo r=bird: Ignoring error code, will propagate. */ pCurr = pCurr->AioMgr.pEndpointNext; } @@ -419,11 +416,11 @@ static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr) */ DECLINLINE(bool) pdmacFileAioMgrNormalRcIsFatal(int rcReq) { - return rcReq == VERR_DEV_IO_ERROR - || rcReq == VERR_FILE_IO_ERROR - || rcReq == VERR_DISK_IO_ERROR - || rcReq == VERR_DISK_FULL - || rcReq == VERR_FILE_TOO_BIG; + return rcReq == VERR_DEV_IO_ERROR + || rcReq == VERR_FILE_IO_ERROR + || rcReq == VERR_DISK_IO_ERROR + || rcReq == VERR_DISK_FULL + || rcReq == VERR_FILE_TOO_BIG; } /** @@ -503,9 +500,8 @@ DECLINLINE(void) pdmacFileAioMgrEpAddTask(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpo */ static RTFILEAIOREQ pdmacFileAioMgrNormalRequestAlloc(PPDMACEPFILEMGR pAioMgr) { - RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ; - /* Get a request handle. */ + RTFILEAIOREQ hReq; if (pAioMgr->iFreeEntry > 0) { pAioMgr->iFreeEntry--; @@ -516,7 +512,7 @@ static RTFILEAIOREQ pdmacFileAioMgrNormalRequestAlloc(PPDMACEPFILEMGR pAioMgr) else { int rc = RTFileAioReqCreate(&hReq); - AssertRC(rc); + AssertRCReturn(rc, NIL_RTFILEAIOREQ); } return hReq; @@ -545,15 +541,13 @@ static int pdmacFileAioMgrNormalReqsEnqueue(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PRTFILEAIOREQ pahReqs, unsigned cReqs) { - int rc; - pAioMgr->cRequestsActive += cReqs; pEndpoint->AioMgr.cRequestsActive += cReqs; LogFlow(("Enqueuing %d requests. I/O manager has a total of %d active requests now\n", cReqs, pAioMgr->cRequestsActive)); LogFlow(("Endpoint has a total of %d active requests now\n", pEndpoint->AioMgr.cRequestsActive)); - rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, pahReqs, cReqs); + int rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, pahReqs, cReqs); if (RT_FAILURE(rc)) { if (rc == VERR_FILE_AIO_INSUFFICIENT_RESSOURCES) @@ -611,11 +605,7 @@ static int pdmacFileAioMgrNormalReqsEnqueue(PPDMACEPFILEMGR pAioMgr, AssertRC(rc); } else if (rcReq != VERR_FILE_AIO_IN_PROGRESS) - { - PPDMACTASKFILE pTask = (PPDMACTASKFILE)RTFileAioReqGetUser(pahReqs[i]); - pdmacFileAioMgrNormalReqCompleteRc(pAioMgr, pahReqs[i], rcReq, 0); - } } @@ -644,12 +634,11 @@ static bool pdmacFileAioMgrNormalIsRangeLocked(PPDMASYNCCOMPLETIONENDPOINTFILE p RTFOFF offStart, size_t cbRange, PPDMACTASKFILE pTask) { - PPDMACFILERANGELOCK pRangeLock = NULL; /** < Range lock */ - AssertMsg( pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE || pTask->enmTransferType == PDMACTASKFILETRANSFER_READ, ("Invalid task type %d\n", pTask->enmTransferType)); + PPDMACFILERANGELOCK pRangeLock; pRangeLock = (PPDMACFILERANGELOCK)RTAvlrFileOffsetRangeGet(pEndpoint->AioMgr.pTreeRangesLocked, offStart); if (!pRangeLock) { @@ -665,7 +654,7 @@ static bool pdmacFileAioMgrNormalIsRangeLocked(PPDMASYNCCOMPLETIONENDPOINTFILE p /* Check whether we have one of the situations explained below */ if ( pRangeLock -#if 0 /** @todo: later. For now we will just block all requests if they interfere */ +#if 0 /** @todo later. For now we will just block all requests if they interfere */ && ( (pRangeLock->fReadLock && pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE) || (!pRangeLock->fReadLock) #endif @@ -744,15 +733,10 @@ static int pdmacFileAioMgrNormalTaskPrepareBuffered(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMACTASKFILE pTask, PRTFILEAIOREQ phReq) { - int rc = VINF_SUCCESS; - RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ; - PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass; - void *pvBuf = pTask->DataSeg.pvSeg; - AssertMsg( pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE - || (uint64_t)(pTask->Off + pTask->DataSeg.cbSeg) <= pEndpoint->cbFile, - ("Read exceeds file size offStart=%RTfoff cbToTransfer=%d cbFile=%llu\n", - pTask->Off, pTask->DataSeg.cbSeg, pEndpoint->cbFile)); + || (uint64_t)(pTask->Off + pTask->DataSeg.cbSeg) <= pEndpoint->cbFile, + ("Read exceeds file size offStart=%RTfoff cbToTransfer=%d cbFile=%llu\n", + pTask->Off, pTask->DataSeg.cbSeg, pEndpoint->cbFile)); pTask->fPrefetch = false; pTask->cbBounceBuffer = 0; @@ -775,12 +759,12 @@ static int pdmacFileAioMgrNormalTaskPrepareBuffered(PPDMACEPFILEMGR pAioMgr, * While the data is fetched from the file another request might arrive writing to * the same range. This will result in data corruption if both are executed concurrently. */ + int rc = VINF_SUCCESS; bool fLocked = pdmacFileAioMgrNormalIsRangeLocked(pEndpoint, pTask->Off, pTask->DataSeg.cbSeg, pTask); - if (!fLocked) { /* Get a request handle. */ - hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr); + RTFILEAIOREQ hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr); AssertMsg(hReq != NIL_RTFILEAIOREQ, ("Out of request handles\n")); if (pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE) @@ -822,11 +806,6 @@ static int pdmacFileAioMgrNormalTaskPrepareNonBuffered(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMACTASKFILE pTask, PRTFILEAIOREQ phReq) { - int rc = VINF_SUCCESS; - RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ; - PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass; - void *pvBuf = pTask->DataSeg.pvSeg; - /* * Check if the alignment requirements are met. * Offset, transfer size and buffer address @@ -861,12 +840,15 @@ static int pdmacFileAioMgrNormalTaskPrepareNonBuffered(PPDMACEPFILEMGR pAioMgr, * While the data is fetched from the file another request might arrive writing to * the same range. This will result in data corruption if both are executed concurrently. */ + int rc = VINF_SUCCESS; bool fLocked = pdmacFileAioMgrNormalIsRangeLocked(pEndpoint, offStart, cbToTransfer, pTask); - if (!fLocked) { + PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass; + void *pvBuf = pTask->DataSeg.pvSeg; + /* Get a request handle. */ - hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr); + RTFILEAIOREQ hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr); AssertMsg(hReq != NIL_RTFILEAIOREQ, ("Out of request handles\n")); if ( RT_UNLIKELY(cbToTransfer != pTask->DataSeg.cbSeg) @@ -962,8 +944,7 @@ static int pdmacFileAioMgrNormalProcessTaskList(PPDMACTASKFILE pTaskHead, { RTFILEAIOREQ apReqs[20]; unsigned cRequests = 0; - unsigned cMaxRequests = pAioMgr->cRequestsActiveMax - pAioMgr->cRequestsActive; - int rc = VINF_SUCCESS; + int rc = VINF_SUCCESS; AssertMsg(pEndpoint->enmState == PDMASYNCCOMPLETIONENDPOINTFILESTATE_ACTIVE, ("Trying to process request lists of a non active endpoint!\n")); @@ -1146,7 +1127,7 @@ static int pdmacFileAioMgrNormalQueueReqs(PPDMACEPFILEMGR pAioMgr, pEndpoint->AioMgr.pReqsPendingHead = NULL; pEndpoint->AioMgr.pReqsPendingTail = NULL; rc = pdmacFileAioMgrNormalProcessTaskList(pTasksHead, pAioMgr, pEndpoint); - AssertRC(rc); + AssertRC(rc); /** @todo r=bird: status code potentially overwritten. */ } if (!pEndpoint->pFlushReq && !pEndpoint->AioMgr.pReqsPendingHead) @@ -1591,13 +1572,13 @@ static void pdmacFileAioMgrNormalReqCompleteRc(PPDMACEPFILEMGR pAioMgr, RTFILEAI */ int pdmacFileAioMgrNormal(RTTHREAD ThreadSelf, void *pvUser) { - int rc = VINF_SUCCESS; - PPDMACEPFILEMGR pAioMgr = (PPDMACEPFILEMGR)pvUser; - uint64_t uMillisEnd = RTTimeMilliTS() + PDMACEPFILEMGR_LOAD_UPDATE_PERIOD; + int rc = VINF_SUCCESS; + PPDMACEPFILEMGR pAioMgr = (PPDMACEPFILEMGR)pvUser; + uint64_t uMillisEnd = RTTimeMilliTS() + PDMACEPFILEMGR_LOAD_UPDATE_PERIOD; - while ( (pAioMgr->enmState == PDMACEPFILEMGRSTATE_RUNNING) - || (pAioMgr->enmState == PDMACEPFILEMGRSTATE_SUSPENDING) - || (pAioMgr->enmState == PDMACEPFILEMGRSTATE_GROWING)) + while ( pAioMgr->enmState == PDMACEPFILEMGRSTATE_RUNNING + || pAioMgr->enmState == PDMACEPFILEMGRSTATE_SUSPENDING + || pAioMgr->enmState == PDMACEPFILEMGRSTATE_GROWING) { if (!pAioMgr->cRequestsActive) { diff --git a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp index 1ea19b03d74..9a4ed63c4a3 100644 --- a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp +++ b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp @@ -952,7 +952,7 @@ static DECLCALLBACK(int) pdmR3BlkCacheLoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_ /* Insert into the tree. */ bool fInserted = RTAvlrU64Insert(pBlkCache->pTree, &pEntry->Core); - Assert(fInserted); + Assert(fInserted); NOREF(fInserted); /* Add to the dirty list. */ pdmBlkCacheAddDirtyEntry(pBlkCache, pEntry); @@ -1544,18 +1544,15 @@ VMMR3DECL(void) PDMR3BlkCacheReleaseUsb(PVM pVM, PPDMUSBINS pUsbIns) static PPDMBLKCACHEENTRY pdmBlkCacheGetCacheEntryByOffset(PPDMBLKCACHE pBlkCache, uint64_t off) { - PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache; - PPDMBLKCACHEENTRY pEntry = NULL; - - STAM_PROFILE_ADV_START(&pCache->StatTreeGet, Cache); + STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeGet, Cache); RTSemRWRequestRead(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT); - pEntry = (PPDMBLKCACHEENTRY)RTAvlrU64RangeGet(pBlkCache->pTree, off); + PPDMBLKCACHEENTRY pEntry = (PPDMBLKCACHEENTRY)RTAvlrU64RangeGet(pBlkCache->pTree, off); if (pEntry) pdmBlkCacheEntryRef(pEntry); RTSemRWReleaseRead(pBlkCache->SemRWEntries); - STAM_PROFILE_ADV_STOP(&pCache->StatTreeGet, Cache); + STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeGet, Cache); return pEntry; } @@ -1572,9 +1569,7 @@ static PPDMBLKCACHEENTRY pdmBlkCacheGetCacheEntryByOffset(PPDMBLKCACHE pBlkCache static void pdmBlkCacheGetCacheBestFitEntryByOffset(PPDMBLKCACHE pBlkCache, uint64_t off, PPDMBLKCACHEENTRY *ppEntryAbove) { - PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache; - - STAM_PROFILE_ADV_START(&pCache->StatTreeGet, Cache); + STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeGet, Cache); RTSemRWRequestRead(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT); if (ppEntryAbove) @@ -1586,18 +1581,16 @@ static void pdmBlkCacheGetCacheBestFitEntryByOffset(PPDMBLKCACHE pBlkCache, uint RTSemRWReleaseRead(pBlkCache->SemRWEntries); - STAM_PROFILE_ADV_STOP(&pCache->StatTreeGet, Cache); + STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeGet, Cache); } static void pdmBlkCacheInsertEntry(PPDMBLKCACHE pBlkCache, PPDMBLKCACHEENTRY pEntry) { - PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache; - - STAM_PROFILE_ADV_START(&pCache->StatTreeInsert, Cache); + STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeInsert, Cache); RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT); bool fInserted = RTAvlrU64Insert(pBlkCache->pTree, &pEntry->Core); - AssertMsg(fInserted, ("Node was not inserted into tree\n")); - STAM_PROFILE_ADV_STOP(&pCache->StatTreeInsert, Cache); + AssertMsg(fInserted, ("Node was not inserted into tree\n")); NOREF(fInserted); + STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeInsert, Cache); RTSemRWReleaseWrite(pBlkCache->SemRWEntries); } @@ -2474,7 +2467,7 @@ VMMR3DECL(int) PDMR3BlkCacheDiscard(PPDMBLKCACHE pBlkCache, PCRTRANGE paRanges, if (!(pEntry->fFlags & PDMBLKCACHE_ENTRY_IO_IN_PROGRESS)) { pdmBlkCacheLockEnter(pCache); - pdmBlkCacheEntryRemoveFromList(pEntry); + pdmBlkCacheEntryRemoveFromList(pEntry); STAM_PROFILE_ADV_START(&pCache->StatTreeRemove, Cache); RTAvlrU64Remove(pBlkCache->pTree, pEntry->Core.Key); @@ -2520,7 +2513,7 @@ VMMR3DECL(int) PDMR3BlkCacheDiscard(PPDMBLKCACHE pBlkCache, PCRTRANGE paRanges, else /* I/O in progress flag not set */ { pdmBlkCacheLockEnter(pCache); - pdmBlkCacheEntryRemoveFromList(pEntry); + pdmBlkCacheEntryRemoveFromList(pEntry); RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT); STAM_PROFILE_ADV_START(&pCache->StatTreeRemove, Cache); @@ -2537,7 +2530,7 @@ VMMR3DECL(int) PDMR3BlkCacheDiscard(PPDMBLKCACHE pBlkCache, PCRTRANGE paRanges, else /* Entry is on the ghost list just remove cache entry. */ { pdmBlkCacheLockEnter(pCache); - pdmBlkCacheEntryRemoveFromList(pEntry); + pdmBlkCacheEntryRemoveFromList(pEntry); RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT); STAM_PROFILE_ADV_START(&pCache->StatTreeRemove, Cache); @@ -2580,7 +2573,7 @@ static PPDMBLKCACHEWAITER pdmBlkCacheWaiterComplete(PPDMBLKCACHE pBlkCache, PPDMBLKCACHEWAITER pNext = pWaiter->pNext; PPDMBLKCACHEREQ pReq = pWaiter->pReq; - pdmBlkCacheReqUpdate(pBlkCache, pWaiter->pReq, rc, true); + pdmBlkCacheReqUpdate(pBlkCache, pReq, rc, true); RTMemFree(pWaiter); diff --git a/src/VBox/VMM/VMMR3/PDMUsb.cpp b/src/VBox/VMM/VMMR3/PDMUsb.cpp index dfde745f492..acbe244d02d 100644 --- a/src/VBox/VMM/VMMR3/PDMUsb.cpp +++ b/src/VBox/VMM/VMMR3/PDMUsb.cpp @@ -1209,7 +1209,7 @@ static DECLCALLBACK(int) pdmR3UsbHlp_DBGFInfoRegister(PPDMUSBINS pUsbIns, const PVM pVM = pUsbIns->Internal.s.pVM; VM_ASSERT_EMT(pVM); - /** @todo int rc = DBGFR3InfoRegisterUsb(pVM, pszName, pszDesc, pfnHandler, pUsbIns); */ + NOREF(pVM); /** @todo int rc = DBGFR3InfoRegisterUsb(pVM, pszName, pszDesc, pfnHandler, pUsbIns); */ int rc = VERR_NOT_IMPLEMENTED; AssertFailed(); LogFlow(("pdmR3UsbHlp_DBGFInfoRegister: caller='%s'/%d: returns %Rrc\n", pUsbIns->pReg->szName, pUsbIns->iInstance, rc)); diff --git a/src/VBox/VMM/VMMR3/PGM.cpp b/src/VBox/VMM/VMMR3/PGM.cpp index 2cec7dff040..367e41738e2 100644 --- a/src/VBox/VMM/VMMR3/PGM.cpp +++ b/src/VBox/VMM/VMMR3/PGM.cpp @@ -3295,7 +3295,9 @@ static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE */ VMMR3DECL(int) PGMR3ChangeMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmGuestMode) { +#if HC_ARCH_BITS == 32 bool fIsOldGuestPagingMode64Bits = (pVCpu->pgm.s.enmGuestMode >= PGMMODE_AMD64); +#endif bool fIsNewGuestPagingMode64Bits = (enmGuestMode >= PGMMODE_AMD64); Log(("PGMR3ChangeMode: Guest mode: %s -> %s\n", PGMGetModeName(pVCpu->pgm.s.enmGuestMode), PGMGetModeName(enmGuestMode))); diff --git a/src/VBox/VMM/VMMR3/PGMDbg.cpp b/src/VBox/VMM/VMMR3/PGMDbg.cpp index 0346ca02011..3d296820766 100644 --- a/src/VBox/VMM/VMMR3/PGMDbg.cpp +++ b/src/VBox/VMM/VMMR3/PGMDbg.cpp @@ -203,7 +203,6 @@ VMMR3DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size /* partial read that failed, chop it up in pages. */ *pcbRead = 0; - size_t const cbReq = cb; rc = VINF_SUCCESS; while (cb > 0) { @@ -1465,7 +1464,7 @@ static int pgmR3DumpHierarchyShw32BitPD(PPGMR3DUMPHIERARCHYSTATE pState, RTHCPHY cMaxDepth--; uint32_t iFirst, iLast; - uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast); + pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast); for (uint32_t i = iFirst; i <= iLast; i++) { X86PDE Pde = pPD->a[i]; @@ -2142,7 +2141,7 @@ static int pgmR3DumpHierarchyGst32BitPD(PPGMR3DUMPHIERARCHYSTATE pState, RTHCPHY cMaxDepth--; uint32_t iFirst, iLast; - uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast); + pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast); for (uint32_t i = iFirst; i <= iLast; i++) { X86PDE Pde = pPD->a[i]; diff --git a/src/VBox/VMM/VMMR3/PGMMap.cpp b/src/VBox/VMM/VMMR3/PGMMap.cpp index b6aac2dbfbe..6a7814793da 100644 --- a/src/VBox/VMM/VMMR3/PGMMap.cpp +++ b/src/VBox/VMM/VMMR3/PGMMap.cpp @@ -1016,7 +1016,9 @@ static void pgmR3MapClearPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iOldPDE) static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE) { PPGM pPGM = &pVM->pgm.s; +#ifdef VBOX_STRICT PVMCPU pVCpu = VMMGetCpu(pVM); +#endif pgmLock(pVM); /* to avoid assertions */ Assert(!pgmMapAreMappingsEnabled(pVM) || PGMGetGuestMode(pVCpu) <= PGMMODE_PAE_NX); diff --git a/src/VBox/VMM/VMMR3/PGMPhys.cpp b/src/VBox/VMM/VMMR3/PGMPhys.cpp index 54a44f45afa..1622c5116d9 100644 --- a/src/VBox/VMM/VMMR3/PGMPhys.cpp +++ b/src/VBox/VMM/VMMR3/PGMPhys.cpp @@ -4261,7 +4261,6 @@ VMMR3DECL(int) PGMR3PhysAllocateHandyPages(PVM pVM) VM_FF_CLEAR(pVM, VM_FF_PGM_NO_MEMORY); #ifdef VBOX_STRICT - bool fOk = true; uint32_t i; for (i = iClear; i < pVM->pgm.s.cHandyPages; i++) if ( pVM->pgm.s.aHandyPages[i].idPage == NIL_GMM_PAGEID diff --git a/src/VBox/VMM/VMMR3/PGMPool.cpp b/src/VBox/VMM/VMMR3/PGMPool.cpp index 35537ed7552..1bca34cfc77 100644 --- a/src/VBox/VMM/VMMR3/PGMPool.cpp +++ b/src/VBox/VMM/VMMR3/PGMPool.cpp @@ -852,7 +852,7 @@ DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, vo /* First write protect the page again to catch all write accesses. (before checking for changes -> SMP) */ int rc = PGMHandlerPhysicalReset(pVM, pPage->GCPhys & PAGE_BASE_GC_MASK); - Assert(rc == VINF_SUCCESS); + AssertRCSuccess(rc); pPage->fDirty = false; pPool->aDirtyPages[i].uIdx = NIL_PGMPOOL_IDX; diff --git a/src/VBox/VMM/VMMR3/PGMSavedState.cpp b/src/VBox/VMM/VMMR3/PGMSavedState.cpp index 3e26b4078a1..260760e619f 100644 --- a/src/VBox/VMM/VMMR3/PGMSavedState.cpp +++ b/src/VBox/VMM/VMMR3/PGMSavedState.cpp @@ -3096,8 +3096,7 @@ static int pgmR3LoadFinalLocked(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion) */ static DECLCALLBACK(int) pgmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) { - int rc; - PPGM pPGM = &pVM->pgm.s; + int rc; /* * Validate version. diff --git a/src/VBox/VMM/VMMR3/PGMSharedPage.cpp b/src/VBox/VMM/VMMR3/PGMSharedPage.cpp index e8b53796006..a89be6a5dfb 100644 --- a/src/VBox/VMM/VMMR3/PGMSharedPage.cpp +++ b/src/VBox/VMM/VMMR3/PGMSharedPage.cpp @@ -218,7 +218,7 @@ static DECLCALLBACK(void) pgmR3CheckSharedModulesHelper(PVM pVM, VMCPUID idCpu) { /* We must stall other VCPUs as we'd otherwise have to send IPI flush commands for every single change we make. */ int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONE_BY_ONE, pgmR3SharedModuleRegRendezvous, &idCpu); - Assert(rc == VINF_SUCCESS); + AssertRCSuccess(rc); } #endif diff --git a/src/VBox/VMM/VMMR3/PGMShw.h b/src/VBox/VMM/VMMR3/PGMShw.h index 7e9b0d51c0d..a7bf6a5ec61 100644 --- a/src/VBox/VMM/VMMR3/PGMShw.h +++ b/src/VBox/VMM/VMMR3/PGMShw.h @@ -185,7 +185,6 @@ PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode) # endif PPGMPOOLPAGE pNewShwPageCR3; PVM pVM = pVCpu->pVMR3; - PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging); Assert(pVM->pgm.s.fNestedPaging); diff --git a/src/VBox/VMM/VMMR3/SELM.cpp b/src/VBox/VMM/VMMR3/SELM.cpp index 8a3caf34ab9..7e0256c2d43 100644 --- a/src/VBox/VMM/VMMR3/SELM.cpp +++ b/src/VBox/VMM/VMMR3/SELM.cpp @@ -1839,7 +1839,6 @@ VMMR3DECL(bool) SELMR3CheckTSS(PVM pVM) /* * Figure out the size of what need to monitor. */ - bool fNoRing1Stack = true; /* We're not interested in any 16-bit TSSes. */ uint32_t cbMonitoredTss = cbTss; if ( trHid.Attr.n.u4Type != X86_SEL_TYPE_SYS_386_TSS_AVAIL diff --git a/src/VBox/VMM/VMMR3/TM.cpp b/src/VBox/VMM/VMMR3/TM.cpp index 50ac3014be3..06662173a44 100644 --- a/src/VBox/VMM/VMMR3/TM.cpp +++ b/src/VBox/VMM/VMMR3/TM.cpp @@ -1536,8 +1536,7 @@ VMMR3DECL(int) TMR3TimerDestroy(PTMTIMER pTimer) /* * Change to the DESTROY state. */ - TMTIMERSTATE enmState = pTimer->enmState; - TMTIMERSTATE enmNewState = enmState; + TMTIMERSTATE const enmState = pTimer->enmState; Log2(("TMTimerDestroy: %p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n", pTimer, tmTimerState(enmState), R3STRING(pTimer->pszDesc), cRetries)); switch (enmState) @@ -2127,11 +2126,11 @@ static void tmR3TimerQueueRunVirtualSync(PVM pVM) } /* Check if stopped by expired timer. */ - uint64_t u64Expire = pNext->u64Expire; - if (u64Now >= pNext->u64Expire) + uint64_t const u64Expire = pNext->u64Expire; + if (u64Now >= u64Expire) { STAM_COUNTER_INC(&pVM->tm.s.StatVirtualSyncRunStop); - u64Now = pNext->u64Expire; + u64Now = u64Expire; ASMAtomicWriteU64(&pVM->tm.s.u64VirtualSync, u64Now); ASMAtomicWriteBool(&pVM->tm.s.fVirtualSyncTicking, false); Log4(("TM: %'RU64/-%'8RU64: exp tmr [tmR3TimerQueueRunVirtualSync]\n", u64Now, u64VirtualNow - u64Now - offSyncGivenUp)); diff --git a/src/VBox/VMM/VMMR3/VM.cpp b/src/VBox/VMM/VMMR3/VM.cpp index 5f7f56313d6..92524bcb93a 100644 --- a/src/VBox/VMM/VMMR3/VM.cpp +++ b/src/VBox/VMM/VMMR3/VM.cpp @@ -1766,7 +1766,7 @@ static int vmR3SaveTeleport(PVM pVM, uint32_t cMsMaxDowntime, else { int rc2 = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM); - AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc)); + AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc)); NOREF(rc2); } } else |