summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2011-10-19 11:43:52 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2011-10-19 11:43:52 +0000
commit3e4ca79ecb37900a0492c39522a1833ad58eca8c (patch)
treefb3ef61848a91d5f02a3c63a502d4feb8763e0d5
parent1738f4d71e132cf6881610f10f1c148c862f1be7 (diff)
downloadVirtualBox-svn-3e4ca79ecb37900a0492c39522a1833ad58eca8c.tar.gz
VMM,INTNET: Addressing unused variable warnings.
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@39034 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r--include/VBox/intnet.h10
-rw-r--r--include/VBox/vmm/vm.h6
-rw-r--r--src/VBox/VMM/VMMAll/EMAll.cpp4
-rw-r--r--src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h4
-rw-r--r--src/VBox/VMM/VMMAll/IOMAllMMIO.cpp2
-rw-r--r--src/VBox/VMM/VMMAll/PGMAll.cpp19
-rw-r--r--src/VBox/VMM/VMMAll/PGMAllBth.h23
-rw-r--r--src/VBox/VMM/VMMAll/PGMAllPhys.cpp42
-rw-r--r--src/VBox/VMM/VMMAll/PGMAllPool.cpp9
-rw-r--r--src/VBox/VMM/VMMAll/TMAll.cpp9
-rw-r--r--src/VBox/VMM/VMMR0/GMMR0.cpp12
-rw-r--r--src/VBox/VMM/VMMR0/HWVMXR0.cpp2
-rw-r--r--src/VBox/VMM/VMMR0/VMMR0.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/CPUMDbg.cpp28
-rw-r--r--src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp3
-rw-r--r--src/VBox/VMM/VMMR3/DBGFReg.cpp4
-rw-r--r--src/VBox/VMM/VMMR3/EMHwaccm.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/FTM.cpp6
-rw-r--r--src/VBox/VMM/VMMR3/HWACCM.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PATM.cpp4
-rw-r--r--src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp113
-rw-r--r--src/VBox/VMM/VMMR3/PDMBlkCache.cpp33
-rw-r--r--src/VBox/VMM/VMMR3/PDMUsb.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PGM.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PGMDbg.cpp5
-rw-r--r--src/VBox/VMM/VMMR3/PGMMap.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PGMPhys.cpp1
-rw-r--r--src/VBox/VMM/VMMR3/PGMPool.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PGMSavedState.cpp3
-rw-r--r--src/VBox/VMM/VMMR3/PGMSharedPage.cpp2
-rw-r--r--src/VBox/VMM/VMMR3/PGMShw.h1
-rw-r--r--src/VBox/VMM/VMMR3/SELM.cpp1
-rw-r--r--src/VBox/VMM/VMMR3/TM.cpp9
-rw-r--r--src/VBox/VMM/VMMR3/VM.cpp2
-rw-r--r--src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp2
-rw-r--r--src/VBox/VMM/include/IOMInline.h1
-rw-r--r--src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h5
-rw-r--r--src/VBox/VMM/include/PGMInline.h2
-rw-r--r--src/VBox/VMM/include/PGMInternal.h1
40 files changed, 188 insertions, 196 deletions
diff --git a/include/VBox/intnet.h b/include/VBox/intnet.h
index f369109d5eb..dc439ea56d0 100644
--- a/include/VBox/intnet.h
+++ b/include/VBox/intnet.h
@@ -77,7 +77,8 @@ typedef INTNETRINGBUF *PINTNETRINGBUF;
/**
* Asserts the sanity of the specified INTNETRINGBUF structure.
*/
-#define INTNETRINGBUF_ASSERT_SANITY(pRingBuf) \
+#ifdef VBOX_STRICT
+# define INTNETRINGBUF_ASSERT_SANITY(pRingBuf) \
do \
{ \
AssertPtr(pRingBuf); \
@@ -103,6 +104,9 @@ typedef INTNETRINGBUF *PINTNETRINGBUF;
("W=%#x W'=%#x R=%#x\n", offWriteCom, offWriteInt, offRead)); \
} \
} while (0)
+#else
+# define INTNETRINGBUF_ASSERT_SANITY(pRingBuf) do { } while (0)
+#endif
@@ -247,6 +251,7 @@ AssertCompileSize(PDMNETWORKGSO, 8);
/**
* Asserts the sanity of the specified INTNETHDR.
*/
+#ifdef VBOX_STRICT
#define INTNETHDR_ASSERT_SANITY(pHdr, pRingBuf) \
do \
{ \
@@ -267,6 +272,9 @@ AssertCompileSize(PDMNETWORKGSO, 8);
Assert(offFrame < (pRingBuf)->offEnd); \
} \
} while (0)
+#else
+# define INTNETHDR_ASSERT_SANITY(pHdr, pRingBuf) do { } while (0)
+#endif
/**
diff --git a/include/VBox/vmm/vm.h b/include/VBox/vmm/vm.h
index cbbe7d6679d..f6e288a5958 100644
--- a/include/VBox/vmm/vm.h
+++ b/include/VBox/vmm/vm.h
@@ -239,13 +239,17 @@ typedef struct VMCPU
#define VMCPU_CMPXCHG_STATE(pVCpu, enmNewState, enmOldState) \
ASMAtomicCmpXchgU32((uint32_t volatile *)&(pVCpu)->enmState, (enmNewState), (enmOldState))
/** Checks the VMCPU state. */
-#define VMCPU_ASSERT_STATE(pVCpu, enmExpectedState) \
+#ifdef VBOX_STRICT
+# define VMCPU_ASSERT_STATE(pVCpu, enmExpectedState) \
do { \
VMCPUSTATE enmState = VMCPU_GET_STATE(pVCpu); \
AssertMsg(enmState == (enmExpectedState), \
("enmState=%d enmExpectedState=%d idCpu=%u\n", \
enmState, enmExpectedState, (pVCpu)->idCpu)); \
} while (0)
+#else
+# define VMCPU_ASSERT_STATE(pVCpu, enmExpectedState) do { } while (0)
+#endif
/** Tests if the state means that the CPU is started. */
#define VMCPUSTATE_IS_STARTED(enmState) ( (enmState) > VMCPUSTATE_STOPPED )
/** Tests if the state means that the CPU is stopped. */
diff --git a/src/VBox/VMM/VMMAll/EMAll.cpp b/src/VBox/VMM/VMMAll/EMAll.cpp
index e09f95298f8..6eaf29c2784 100644
--- a/src/VBox/VMM/VMMAll/EMAll.cpp
+++ b/src/VBox/VMM/VMMAll/EMAll.cpp
@@ -117,7 +117,9 @@ DECLCALLBACK(int) EMReadBytes(RTUINTPTR pSrc, uint8_t *pDest, unsigned cb, void
{
PDISCPUSTATE pDis = (PDISCPUSTATE)pvUserdata;
PEMDISSTATE pState = (PEMDISSTATE)pDis->apvUserData[0];
+# ifndef IN_RING0
PVM pVM = pState->pVM;
+# endif
PVMCPU pVCpu = pState->pVCpu;
# ifdef IN_RING0
@@ -3112,7 +3114,7 @@ VMMDECL(void) EMRemLock(PVM pVM)
Assert(!PGMIsLockOwner(pVM));
Assert(!IOMIsLockOwner(pVM));
int rc = PDMCritSectEnter(&pVM->em.s.CritSectREM, VERR_SEM_BUSY);
- AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", rc));
+ AssertRCSuccess(rc);
}
/**
diff --git a/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h b/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
index 32dfd70eb9a..69b63518aae 100644
--- a/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
+++ b/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
@@ -1509,7 +1509,7 @@ IEM_CIMPL_DEF_1(iemCImpl_iret, IEMMODE, enmEffOpSize)
*/
IEM_CIMPL_DEF_2(iemCImpl_LoadSReg, uint8_t, iSegReg, uint16_t, uSel)
{
- PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
+ /*PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);*/
uint16_t *pSel = iemSRegRef(pIemCpu, iSegReg);
PCPUMSELREGHID pHid = iemSRegGetHid(pIemCpu, iSegReg);
@@ -1798,7 +1798,7 @@ IEM_CIMPL_DEF_5(iemCImpl_load_SReg_Greg,
uint8_t, iGReg,
IEMMODE, enmEffOpSize)
{
- PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
+ /*PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);*/
VBOXSTRICTRC rcStrict;
/*
diff --git a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
index d7539271228..3a97c546340 100644
--- a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
+++ b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
@@ -1352,7 +1352,7 @@ VMMDECL(int) IOMMMIOHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore,
*/
VMMDECL(VBOXSTRICTRC) IOMMMIOPhysHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pCtxCore, RTGCPHYS GCPhysFault)
{
- int rc2 = IOM_LOCK(pVM);
+ int rc2 = IOM_LOCK(pVM); NOREF(rc2);
#ifndef IN_RING3
if (rc2 == VERR_SEM_BUSY)
return VINF_IOM_HC_MMIO_READ_WRITE;
diff --git a/src/VBox/VMM/VMMAll/PGMAll.cpp b/src/VBox/VMM/VMMAll/PGMAll.cpp
index d0757245a3f..c722a5a81e9 100644
--- a/src/VBox/VMM/VMMAll/PGMAll.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAll.cpp
@@ -1056,7 +1056,6 @@ DECLINLINE(int) pgmShwGetPaePoolPagePD(PVMCPU pVCpu, RTGCPTR GCPtr, PPGMPOOLPAGE
*/
static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, X86PGPAEUINT uGstPml4e, X86PGPAEUINT uGstPdpe, PX86PDPAE *ppPD)
{
- PPGMCPU pPGM = &pVCpu->pgm.s;
PVM pVM = pVCpu->CTX_SUFF(pVM);
PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
const unsigned iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK;
@@ -1155,11 +1154,10 @@ static int pgmShwSyncLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, X86PGPAEUINT u
*/
DECLINLINE(int) pgmShwGetLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPT *ppPdpt, PX86PDPAE *ppPD)
{
- PPGMCPU pPGM = &pVCpu->pgm.s;
const unsigned iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK;
PCX86PML4E pPml4e = pgmShwGetLongModePML4EPtr(pVCpu, iPml4);
- PGM_LOCK_ASSERT_OWNER(PGMCPU2VM(pPGM));
+ PGM_LOCK_ASSERT_OWNER(pVCpu->CTX_SUFF(pVM));
AssertReturn(pPml4e, VERR_INTERNAL_ERROR);
if (ppPml4e)
@@ -1921,14 +1919,12 @@ VMMDECL(int) PGMFlushTLB(PVMCPU pVCpu, uint64_t cr3, bool fGlobal)
*/
VMMDECL(int) PGMUpdateCR3(PVMCPU pVCpu, uint64_t cr3)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
-
VMCPU_ASSERT_EMT(pVCpu);
LogFlow(("PGMUpdateCR3: cr3=%RX64 OldCr3=%RX64\n", cr3, pVCpu->pgm.s.GCPhysCR3));
/* We assume we're only called in nested paging mode. */
- Assert(pVM->pgm.s.fNestedPaging || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT);
- Assert(pVM->pgm.s.fMappingsDisabled);
+ Assert(pVCpu->CTX_SUFF(pVM)->pgm.s.fNestedPaging || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT);
+ Assert(pVCpu->CTX_SUFF(pVM)->pgm.s.fMappingsDisabled);
Assert(!(pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3));
/*
@@ -1976,7 +1972,6 @@ VMMDECL(int) PGMUpdateCR3(PVMCPU pVCpu, uint64_t cr3)
*/
VMMDECL(int) PGMSyncCR3(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
int rc;
VMCPU_ASSERT_EMT(pVCpu);
@@ -2020,7 +2015,7 @@ VMMDECL(int) PGMSyncCR3(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4,
{
pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MAP_CR3;
- RTGCPHYS GCPhysCR3Old = pVCpu->pgm.s.GCPhysCR3;
+ RTGCPHYS GCPhysCR3Old = pVCpu->pgm.s.GCPhysCR3; NOREF(GCPhysCR3Old);
RTGCPHYS GCPhysCR3;
switch (pVCpu->pgm.s.enmGuestMode)
{
@@ -2088,7 +2083,8 @@ VMMDECL(int) PGMSyncCR3(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4,
if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)
{
pVCpu->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3;
- Assert(!pVM->pgm.s.fMappingsFixed); Assert(!pVM->pgm.s.fMappingsDisabled);
+ Assert(!pVCpu->CTX_SUFF(pVM)->pgm.s.fMappingsFixed);
+ Assert(!pVCpu->CTX_SUFF(pVM)->pgm.s.fMappingsDisabled);
}
}
@@ -2118,7 +2114,6 @@ VMMDECL(int) PGMSyncCR3(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4,
*/
VMMDECL(int) PGMChangeMode(PVMCPU pVCpu, uint64_t cr0, uint64_t cr4, uint64_t efer)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
PGMMODE enmGuestMode;
VMCPU_ASSERT_EMT(pVCpu);
@@ -2163,7 +2158,7 @@ VMMDECL(int) PGMChangeMode(PVMCPU pVCpu, uint64_t cr0, uint64_t cr4, uint64_t ef
PGM_INVL_VCPU_TLBS(pVCpu);
#ifdef IN_RING3
- return PGMR3ChangeMode(pVM, pVCpu, enmGuestMode);
+ return PGMR3ChangeMode(pVCpu->CTX_SUFF(pVM), pVCpu, enmGuestMode);
#else
LogFlow(("PGMChangeMode: returns VINF_PGM_CHANGE_MODE.\n"));
return VINF_PGM_CHANGE_MODE;
diff --git a/src/VBox/VMM/VMMAll/PGMAllBth.h b/src/VBox/VMM/VMMAll/PGMAllBth.h
index da66b2d5e49..0c2f3bec55a 100644
--- a/src/VBox/VMM/VMMAll/PGMAllBth.h
+++ b/src/VBox/VMM/VMMAll/PGMAllBth.h
@@ -441,7 +441,7 @@ static VBOXSTRICTRC PGM_BTH_NAME(Trap0eHandlerDoAccessHandlers)(PVMCPU pVCpu, RT
*/
PGM_BTH_DECL(int, Trap0eHandler)(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PVM pVM = pVCpu->CTX_SUFF(pVM); NOREF(pVM);
*pfLockTaken = false;
@@ -1161,7 +1161,7 @@ PGM_BTH_DECL(int, InvalidatePage)(PVMCPU pVCpu, RTGCPTR GCPtrPage)
# else /* PGM_SHW_TYPE == PGM_TYPE_AMD64 */
/* PML4 */
- const unsigned iPml4 = (GCPtrPage >> X86_PML4_SHIFT) & X86_PML4_MASK;
+ /*const unsigned iPml4 = (GCPtrPage >> X86_PML4_SHIFT) & X86_PML4_MASK;*/
const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK;
PX86PDPAE pPDDst;
@@ -1801,8 +1801,8 @@ static void PGM_BTH_NAME(SyncPageWorker)(PVMCPU pVCpu, PSHWPTE pPteDst, RTGCPHYS
*/
static int PGM_BTH_NAME(SyncPage)(PVMCPU pVCpu, GSTPDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uErr)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
- PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
+ PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); NOREF(pPool);
LogFlow(("SyncPage: GCPtrPage=%RGv cPages=%u uErr=%#x\n", GCPtrPage, cPages, uErr));
PGM_LOCK_ASSERT_OWNER(pVM);
@@ -1950,7 +1950,6 @@ static int PGM_BTH_NAME(SyncPage)(PVMCPU pVCpu, GSTPDE PdeSrc, RTGCPTR GCPtrPage
* deal with locality.
*/
unsigned iPTDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK;
- const unsigned iPTDstPage = iPTDst;
# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT
/* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
const unsigned offPTSrc = ((GCPtrPage >> SHW_PD_SHIFT) & 1) * 512;
@@ -2537,7 +2536,7 @@ static int PGM_BTH_NAME(CheckDirtyPageFault)(PVMCPU pVCpu, uint32_t uErr, PSHWPD
static int PGM_BTH_NAME(SyncPT)(PVMCPU pVCpu, unsigned iPDSrc, PGSTPD pPDSrc, RTGCPTR GCPtrPage)
{
PVM pVM = pVCpu->CTX_SUFF(pVM);
- PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
+ PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); NOREF(pPool);
#if 0 /* rarely useful; leave for debugging. */
STAM_COUNTER_INC(&pVCpu->pgm.s.StatSyncPtPD[iPDSrc]);
@@ -2626,7 +2625,7 @@ static int PGM_BTH_NAME(SyncPT)(PVMCPU pVCpu, unsigned iPDSrc, PGSTPD pPDSrc, RT
# elif PGM_GST_TYPE == PGM_TYPE_PAE
rc = pgmR3SyncPTResolveConflictPAE(pVM, pMapping, GCPtrPage & (GST_PD_MASK << GST_PD_SHIFT));
# else
- AssertFailed(); /* can't happen for amd64 */
+ AssertFailed(); NOREF(pMapping); /* can't happen for amd64 */
# endif
if (RT_FAILURE(rc))
{
@@ -3363,7 +3362,7 @@ PGM_BTH_DECL(int, PrefetchPage)(PVMCPU pVCpu, RTGCPTR GCPtrPage)
*/
PGM_BTH_DECL(int, VerifyAccessSyncPage)(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fPage, unsigned uErr)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PVM pVM = pVCpu->CTX_SUFF(pVM); NOREF(pVM);
LogFlow(("VerifyAccessSyncPage: GCPtrPage=%RGv fPage=%#x uErr=%#x\n", GCPtrPage, fPage, uErr));
@@ -3552,7 +3551,7 @@ PGM_BTH_DECL(int, VerifyAccessSyncPage)(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigne
*/
PGM_BTH_DECL(int, SyncCR3)(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PVM pVM = pVCpu->CTX_SUFF(pVM); NOREF(pVM);
LogFlow(("SyncCR3 fGlobal=%d\n", !!VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3)));
@@ -3647,7 +3646,7 @@ PGM_BTH_DECL(unsigned, AssertCR3)(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGC
#else
unsigned cErrors = 0;
PVM pVM = pVCpu->CTX_SUFF(pVM);
- PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
+ PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); NOREF(pPool);
#if PGM_GST_TYPE == PGM_TYPE_PAE
/** @todo currently broken; crashes below somewhere */
@@ -4401,7 +4400,7 @@ PGM_BTH_DECL(unsigned, AssertCR3)(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGC
*/
PGM_BTH_DECL(int, MapCR3)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)
{
- PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PVM pVM = pVCpu->CTX_SUFF(pVM); NOREF(pVM);
/* Update guest paging info. */
#if PGM_GST_TYPE == PGM_TYPE_32BIT \
@@ -4630,7 +4629,7 @@ PGM_BTH_DECL(int, UnmapCR3)(PVMCPU pVCpu)
LogFlow(("UnmapCR3\n"));
int rc = VINF_SUCCESS;
- PVM pVM = pVCpu->CTX_SUFF(pVM);
+ PVM pVM = pVCpu->CTX_SUFF(pVM); NOREF(pVM);
/*
* Update guest paging info.
diff --git a/src/VBox/VMM/VMMAll/PGMAllPhys.cpp b/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
index 1cafc57e8f7..bc4d24c8060 100644
--- a/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
@@ -1933,6 +1933,46 @@ int pgmPhysGCPhys2R3Ptr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr)
#endif
}
+#if 0 /*defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)*/
+
+/**
+ * Maps and locks a guest CR3 or PD (PAE) page.
+ *
+ * @returns VINF_SUCCESS on success.
+ * @returns VERR_PGM_PHYS_PAGE_RESERVED it it's a valid GC physical
+ * page but has no physical backing.
+ * @returns VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS if it's not a valid
+ * GC physical address.
+ * @returns VERR_PGM_GCPHYS_RANGE_CROSSES_BOUNDARY if the range crosses
+ * a dynamic ram chunk boundary
+ *
+ * @param pVM The VM handle.
+ * @param GCPhys The GC physical address to convert.
+ * @param pR3Ptr Where to store the R3 pointer on success. This may or
+ * may not be valid in ring-0 depending on the
+ * VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 build option.
+ *
+ * @remarks The caller must own the PGM lock.
+ */
+int pgmPhysCr3ToHCPtr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr)
+{
+
+ PPGMRAMRANGE pRam;
+ PPGMPAGE pPage;
+ int rc = pgmPhysGetPageAndRangeEx(pVM, GCPhys, &pPage, &pRam);
+ if (RT_SUCCESS(rc))
+ rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhys, (void **)pR3Ptr);
+ Assert(rc <= VINF_SUCCESS);
+ return rc;
+}
+
+
+int pgmPhysCr3ToHCPtr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr)
+{
+
+}
+
+#endif
/**
* Converts a guest pointer to a GC physical address.
@@ -2047,7 +2087,9 @@ static int pgmPhysReadHandler(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void *pv
/*
* Deal with any physical handlers.
*/
+#ifdef IN_RING3
PPGMPHYSHANDLER pPhys = NULL;
+#endif
if (PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) == PGM_PAGE_HNDL_PHYS_STATE_ALL)
{
#ifdef IN_RING3
diff --git a/src/VBox/VMM/VMMAll/PGMAllPool.cpp b/src/VBox/VMM/VMMAll/PGMAllPool.cpp
index 80bb9bb51c3..be0b7e99d2e 100644
--- a/src/VBox/VMM/VMMAll/PGMAllPool.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllPool.cpp
@@ -2162,9 +2162,6 @@ static bool pgmPoolCacheReusedByKind(PGMPOOLKIND enmKind1, PGMPOOLKIND enmKind2)
*/
static int pgmPoolCacheAlloc(PPGMPOOL pPool, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage)
{
-#ifndef IN_RC
- const PVM pVM = pPool->CTX_SUFF(pVM);
-#endif
/*
* Look up the GCPhys in the hash.
*/
@@ -5094,8 +5091,7 @@ void pgmPoolFree(PVM pVM, RTHCPHYS HCPhys, uint16_t iUser, uint32_t iUserTable)
*/
PPGMPOOLPAGE pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys)
{
- PVM pVM = pPool->CTX_SUFF(pVM);
- PGM_LOCK_ASSERT_OWNER(pVM);
+ PGM_LOCK_ASSERT_OWNER(pPool->CTX_SUFF(pVM));
/*
* Look up the page.
@@ -5116,8 +5112,7 @@ PPGMPOOLPAGE pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys)
*/
PPGMPOOLPAGE pgmPoolQueryPageForDbg(PPGMPOOL pPool, RTHCPHYS HCPhys)
{
- PVM pVM = pPool->CTX_SUFF(pVM);
- PGM_LOCK_ASSERT_OWNER(pVM);
+ PGM_LOCK_ASSERT_OWNER(pPool->CTX_SUFF(pVM));
return (PPGMPOOLPAGE)RTAvloHCPhysGet(&pPool->HCPhysTree, HCPhys & X86_PTE_PAE_PG_MASK);
}
diff --git a/src/VBox/VMM/VMMAll/TMAll.cpp b/src/VBox/VMM/VMMAll/TMAll.cpp
index 88b2d22f16e..227b6a83b84 100644
--- a/src/VBox/VMM/VMMAll/TMAll.cpp
+++ b/src/VBox/VMM/VMMAll/TMAll.cpp
@@ -2102,9 +2102,6 @@ VMMDECL(bool) TMTimerIsActive(PTMTIMER pTimer)
*/
VMMDECL(int) TMTimerSetMillies(PTMTIMER pTimer, uint32_t cMilliesToNext)
{
- PVM pVM = pTimer->CTX_SUFF(pVM);
- PVMCPU pVCpu = &pVM->aCpus[0]; /* just take the first VCPU */
-
switch (pTimer->enmClock)
{
case TMCLOCK_VIRTUAL:
@@ -2135,9 +2132,6 @@ VMMDECL(int) TMTimerSetMillies(PTMTIMER pTimer, uint32_t cMilliesToNext)
*/
VMMDECL(int) TMTimerSetMicro(PTMTIMER pTimer, uint64_t cMicrosToNext)
{
- PVM pVM = pTimer->CTX_SUFF(pVM);
- PVMCPU pVCpu = &pVM->aCpus[0]; /* just take the first VCPU */
-
switch (pTimer->enmClock)
{
case TMCLOCK_VIRTUAL:
@@ -2168,9 +2162,6 @@ VMMDECL(int) TMTimerSetMicro(PTMTIMER pTimer, uint64_t cMicrosToNext)
*/
VMMDECL(int) TMTimerSetNano(PTMTIMER pTimer, uint64_t cNanosToNext)
{
- PVM pVM = pTimer->CTX_SUFF(pVM);
- PVMCPU pVCpu = &pVM->aCpus[0]; /* just take the first VCPU */
-
switch (pTimer->enmClock)
{
case TMCLOCK_VIRTUAL:
diff --git a/src/VBox/VMM/VMMR0/GMMR0.cpp b/src/VBox/VMM/VMMR0/GMMR0.cpp
index e0377484be1..fb475a43702 100644
--- a/src/VBox/VMM/VMMR0/GMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/GMMR0.cpp
@@ -4208,8 +4208,8 @@ GMMR0DECL(int) GMMR0RegisterSharedModule(PVM pVM, VMCPUID idCpu, VBOXOSFAMILY en
pRecVM->aRegions[i].paHCPhysPageID = NULL; /* unused */
}
- bool ret = RTAvlGCPtrInsert(&pGVM->gmm.s.pSharedModuleTree, &pRecVM->Core);
- Assert(ret);
+ bool fInsert = RTAvlGCPtrInsert(&pGVM->gmm.s.pSharedModuleTree, &pRecVM->Core);
+ Assert(fInsert); NOREF(fInsert);
Log(("GMMR0RegisterSharedModule: new local module %s\n", pszModuleName));
fNewModule = true;
@@ -4280,8 +4280,8 @@ GMMR0DECL(int) GMMR0RegisterSharedModule(PVM pVM, VMCPUID idCpu, VBOXOSFAMILY en
pGlobalModule->cUsers++;
rc = VINF_SUCCESS;
- bool ret = RTAvlGCPtrInsert(&pGMM->pGlobalSharedModuleTree, &pGlobalModule->Core);
- Assert(ret);
+ bool fInsert = RTAvlGCPtrInsert(&pGMM->pGlobalSharedModuleTree, &pGlobalModule->Core);
+ Assert(fInsert); NOREF(fInsert);
Log(("GMMR0RegisterSharedModule: new global module %s\n", pszModuleName));
}
@@ -4696,8 +4696,8 @@ end:
*/
static DECLCALLBACK(int) gmmR0CleanupSharedModule(PAVLGCPTRNODECORE pNode, void *pvGVM)
{
- PGVM pGVM = (PGVM)pvGVM;
- PGMMSHAREDMODULEPERVM pRecVM = (PGMMSHAREDMODULEPERVM)pNode;
+ PGMMSHAREDMODULEPERVM pRecVM = (PGMMSHAREDMODULEPERVM)pNode;
+ NOREF(pvGVM);
Assert(pRecVM->pGlobalModule || pRecVM->fCollision);
if (pRecVM->pGlobalModule)
diff --git a/src/VBox/VMM/VMMR0/HWVMXR0.cpp b/src/VBox/VMM/VMMR0/HWVMXR0.cpp
index 11b90e228c4..b7d9c07e1ac 100644
--- a/src/VBox/VMM/VMMR0/HWVMXR0.cpp
+++ b/src/VBox/VMM/VMMR0/HWVMXR0.cpp
@@ -4405,7 +4405,7 @@ static void hmR0VmxFlushVPID(PVM pVM, PVMCPU pVCpu, VMX_FLUSH enmFlush, RTGCPTR
Assert(pVM->hwaccm.s.vmx.fVPID);
descriptor[0] = pVCpu->hwaccm.s.uCurrentASID;
descriptor[1] = GCPtr;
- int rc = VMXR0InvVPID(enmFlush, &descriptor[0]);
+ int rc = VMXR0InvVPID(enmFlush, &descriptor[0]); NOREF(rc);
AssertMsg(rc == VINF_SUCCESS, ("VMXR0InvVPID %x %x %RGv failed with %d\n", enmFlush, pVCpu->hwaccm.s.uCurrentASID, GCPtr, rc));
}
}
diff --git a/src/VBox/VMM/VMMR0/VMMR0.cpp b/src/VBox/VMM/VMMR0/VMMR0.cpp
index 4eebe3028c5..91b2b92f036 100644
--- a/src/VBox/VMM/VMMR0/VMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/VMMR0.cpp
@@ -1436,7 +1436,6 @@ VMMR0DECL(size_t) vmmR0LoggerPrefix(PRTLOGGER pLogger, char *pchBuf, size_t cchB
*/
VMMR0DECL(void) VMMR0LogFlushDisable(PVMCPU pVCpu)
{
- PVM pVM = pVCpu->pVMR0;
if (pVCpu->vmm.s.pR0LoggerR0)
pVCpu->vmm.s.pR0LoggerR0->fFlushingDisabled = true;
}
@@ -1449,7 +1448,6 @@ VMMR0DECL(void) VMMR0LogFlushDisable(PVMCPU pVCpu)
*/
VMMR0DECL(void) VMMR0LogFlushEnable(PVMCPU pVCpu)
{
- PVM pVM = pVCpu->pVMR0;
if (pVCpu->vmm.s.pR0LoggerR0)
pVCpu->vmm.s.pR0LoggerR0->fFlushingDisabled = false;
}
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
diff --git a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
index fdb0d94ece1..d5165267771 100644
--- a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
+++ b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
@@ -1566,8 +1566,6 @@ static int pgmRZDynMapAssertIntegrity(PPGMRZDYNMAP pThis)
if (!pThis->cUsers)
return VERR_INVALID_PARAMETER;
-
- int rc = VINF_SUCCESS;
PGMRZDYNMAP_SPINLOCK_ACQUIRE(pThis);
#define CHECK_RET(expr, a) \
diff --git a/src/VBox/VMM/include/IOMInline.h b/src/VBox/VMM/include/IOMInline.h
index 8e1ddb9c2c7..7d1660a469c 100644
--- a/src/VBox/VMM/include/IOMInline.h
+++ b/src/VBox/VMM/include/IOMInline.h
@@ -85,6 +85,7 @@ DECLINLINE(void) iomMmioRetainRange(PIOMMMIORANGE pRange)
uint32_t cRefs = ASMAtomicIncU32(&pRange->cRefs);
Assert(cRefs > 1);
Assert(cRefs < _1M);
+ NOREF(cRefs);
}
diff --git a/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h b/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
index d8a948ecbeb..965d9dd2b03 100644
--- a/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
+++ b/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
@@ -327,10 +327,7 @@ typedef struct PDMASYNCCOMPLETIONENDPOINTFILE
unsigned fFlags;
/** File handle. */
RTFILE hFile;
- /**
- * Real size of the file. Only updated if
- * data is appended.
- */
+ /** Real size of the file. Only updated if data is appended. */
volatile uint64_t cbFile;
/** List of new tasks. */
R3PTRTYPE(volatile PPDMACTASKFILE) pTasksNewHead;
diff --git a/src/VBox/VMM/include/PGMInline.h b/src/VBox/VMM/include/PGMInline.h
index 527488d3559..8d975131caf 100644
--- a/src/VBox/VMM/include/PGMInline.h
+++ b/src/VBox/VMM/include/PGMInline.h
@@ -678,7 +678,7 @@ DECLINLINE(PX86PDPT) pgmGstGetPaePDPTPtr(PVMCPU pVCpu)
{
PX86PDPT pGuestPdpt;
int rc = pgmGstGetPaePDPTPtrEx(pVCpu, &pGuestPdpt);
- AssertMsg(RT_SUCCESS(rc) || rc == VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS, ("%Rrc\n", rc));
+ AssertMsg(RT_SUCCESS(rc) || rc == VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS, ("%Rrc\n", rc)); NOREF(rc);
return pGuestPdpt;
}
diff --git a/src/VBox/VMM/include/PGMInternal.h b/src/VBox/VMM/include/PGMInternal.h
index bfd9628a3d9..16e05888e1a 100644
--- a/src/VBox/VMM/include/PGMInternal.h
+++ b/src/VBox/VMM/include/PGMInternal.h
@@ -3900,6 +3900,7 @@ int pgmPhysPageMap(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **
int pgmPhysPageMapReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void const **ppv);
int pgmPhysPageMapByPageID(PVM pVM, uint32_t idPage, RTHCPHYS HCPhys, void **ppv);
int pgmPhysGCPhys2R3Ptr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr);
+int pgmPhysCr3ToHCPtr(PVM pVM, RTGCPHYS GCPhys, PRTR3PTR pR3Ptr);
int pgmPhysGCPhys2CCPtrInternalDepr(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv);
int pgmPhysGCPhys2CCPtrInternal(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock);
int pgmPhysGCPhys2CCPtrInternalReadOnly(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, const void **ppv, PPGMPAGEMAPLOCK pLock);