diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-07-26 21:01:38 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2021-07-26 21:01:38 +0000 |
commit | a3b3d3d11f3f9ccdc41d277636373e0dd927694c (patch) | |
tree | 0b5020aa1ebdd45f34e0318f30d15dc68a7d37c1 /src | |
parent | 1349c936d68945772c531a79ff8a6ea1e8723edd (diff) | |
download | VirtualBox-svn-a3b3d3d11f3f9ccdc41d277636373e0dd927694c.tar.gz |
VMM: Removed the VM pointers from the internal critsect structures. bugref:9218 bugref:10074
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@90348 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src')
-rw-r--r-- | src/VBox/VMM/VMMAll/PDMAllCritSect.cpp | 5 | ||||
-rw-r--r-- | src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp | 16 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp | 1 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/MMHyper.cpp | 2 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDM.cpp | 7 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMCritSect.cpp | 43 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMDevHlp.cpp | 6 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMDriver.cpp | 3 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PDMNetShaper.cpp | 18 | ||||
-rw-r--r-- | src/VBox/VMM/VMMR3/PGM.cpp | 4 | ||||
-rw-r--r-- | src/VBox/VMM/include/PDMInternal.h | 19 |
11 files changed, 27 insertions, 97 deletions
diff --git a/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp b/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp index 36a78d7ca8f..2c55f751050 100644 --- a/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp +++ b/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp @@ -145,7 +145,7 @@ static int pdmR3R0CritSectEnterContended(PVMCC pVM, PPDMCRITSECT pCritSect, RTNA /* * The wait loop. */ - PSUPDRVSESSION pSession = pCritSect->s.CTX_SUFF(pVM)->pSession; + PSUPDRVSESSION pSession = pVM->pSession; SUPSEMEVENT hEvent = (SUPSEMEVENT)pCritSect->s.Core.EventSem; # ifdef IN_RING3 # ifdef PDMCRITSECT_STRICT @@ -247,7 +247,6 @@ DECL_FORCE_INLINE(int) pdmCritSectEnter(PVMCC pVM, PPDMCRITSECT pCritSect, int r else return VINF_SUCCESS; - Assert(pCritSect->s.CTX_SUFF(pVM) == pVM); RT_NOREF(pVM); RTNATIVETHREAD hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect); /* ... not owned ... */ if (ASMAtomicCmpXchgS32(&pCritSect->s.Core.cLockers, 0, -1)) @@ -459,7 +458,6 @@ static int pdmCritSectTryEnter(PVMCC pVM, PPDMCRITSECT pCritSect, PCRTLOCKVALSRC else return VINF_SUCCESS; - Assert(pCritSect->s.CTX_SUFF(pVM) == pVM); RTNATIVETHREAD hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect); /* ... not owned ... */ if (ASMAtomicCmpXchgS32(&pCritSect->s.Core.cLockers, 0, -1)) @@ -595,7 +593,6 @@ VMMDECL(int) PDMCritSectLeave(PVMCC pVM, PPDMCRITSECT pCritSect) /* * Always check that the caller is the owner (screw performance). */ - Assert(pCritSect->s.CTX_SUFF(pVM) == pVM); RT_NOREF(pVM); RTNATIVETHREAD const hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect); AssertReleaseMsgReturn(pCritSect->s.Core.NativeThreadOwner == hNativeSelf, ("%p %s: %p != %p; cLockers=%d cNestings=%d\n", pCritSect, R3STRING(pCritSect->s.pszName), diff --git a/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp b/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp index 29609008482..af132491260 100644 --- a/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp +++ b/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp @@ -126,12 +126,12 @@ VMMDECL(uint32_t) PDMR3CritSectRwSetSubClass(PPDMCRITSECTRW pThis, uint32_t uSub /** * Go back to ring-3 so the kernel can do signals, APCs and other fun things. * - * @param pThis Pointer to the read/write critical section. + * @param pVM The cross context VM structure. */ -static void pdmR0CritSectRwYieldToRing3(PPDMCRITSECTRW pThis) +static void pdmR0CritSectRwYieldToRing3(PVMCC pVM) { - PVMCC pVM = pThis->s.CTX_SUFF(pVM); AssertPtr(pVM); - PVMCPUCC pVCpu = VMMGetCpu(pVM); AssertPtr(pVCpu); + PVMCPUCC pVCpu = VMMGetCpu(pVM); + AssertPtrReturnVoid(pVCpu); int rc = VMMRZCallRing3(pVM, pVCpu, VMMCALLRING3_VM_R0_PREEMPT, NULL); AssertRC(rc); } @@ -157,7 +157,6 @@ static int pdmCritSectRwEnterShared(PVMCC pVM, PPDMCRITSECTRW pThis, int rcBusy, */ AssertPtr(pThis); AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); - Assert(pThis->s.CTX_SUFF(pVM) == pVM); #if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3) NOREF(pSrcPos); @@ -301,7 +300,7 @@ static int pdmCritSectRwEnterShared(PVMCC pVM, PPDMCRITSECTRW pThis, int rcBusy, || pThis->s.Core.u32Magic != RTCRITSECTRW_MAGIC) break; # ifdef IN_RING0 - pdmR0CritSectRwYieldToRing3(pThis); + pdmR0CritSectRwYieldToRing3(pVM); # endif } # ifdef IN_RING3 @@ -566,7 +565,6 @@ static int pdmCritSectRwLeaveSharedWorker(PVMCC pVM, PPDMCRITSECTRW pThis, bool */ AssertPtr(pThis); AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); - Assert(pThis->s.CTX_SUFF(pVM) == pVM); #if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3) NOREF(fNoVal); @@ -720,7 +718,6 @@ static int pdmCritSectRwEnterExcl(PVMCC pVM, PPDMCRITSECTRW pThis, int rcBusy, b */ AssertPtr(pThis); AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); - Assert(pThis->s.CTX_SUFF(pVM) == pVM); #if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3) NOREF(pSrcPos); @@ -872,7 +869,7 @@ static int pdmCritSectRwEnterExcl(PVMCC pVM, PPDMCRITSECTRW pThis, int rcBusy, b || pThis->s.Core.u32Magic != RTCRITSECTRW_MAGIC) break; # ifdef IN_RING0 - pdmR0CritSectRwYieldToRing3(pThis); + pdmR0CritSectRwYieldToRing3(pVM); # endif } # ifdef IN_RING3 @@ -1121,7 +1118,6 @@ static int pdmCritSectRwLeaveExclWorker(PVMCC pVM, PPDMCRITSECTRW pThis, bool fN */ AssertPtr(pThis); AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED); - Assert(pThis->s.CTX_SUFF(pVM) == pVM); #if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3) NOREF(fNoVal); diff --git a/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp b/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp index c8da679ae53..e086bf60291 100644 --- a/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp +++ b/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp @@ -844,7 +844,6 @@ static DECLCALLBACK(int) pdmR0DevHlp_SetDeviceCritSect(PPDMDEVINS pDevIns, PPDMC pDevIns->pReg->szName, pDevIns->iInstance, pCritSect, pCritSect->s.pszName)); AssertReturn(PDMCritSectIsInitialized(pCritSect), VERR_INVALID_PARAMETER); PGVM pGVM = pDevIns->Internal.s.pGVM; - AssertReturn(pCritSect->s.pVMR0 == pGVM, VERR_INVALID_PARAMETER); VM_ASSERT_EMT(pGVM); VM_ASSERT_STATE_RETURN(pGVM, VMSTATE_CREATING, VERR_WRONG_ORDER); diff --git a/src/VBox/VMM/VMMR3/MMHyper.cpp b/src/VBox/VMM/VMMR3/MMHyper.cpp index 8e8251d42f4..205478aa67d 100644 --- a/src/VBox/VMM/VMMR3/MMHyper.cpp +++ b/src/VBox/VMM/VMMR3/MMHyper.cpp @@ -214,7 +214,7 @@ int mmR3HyperInit(PVM pVM) int mmR3HyperTerm(PVM pVM) { if (pVM->mm.s.pHyperHeapR3) - PDMR3CritSectDelete(&pVM->mm.s.pHyperHeapR3->Lock); + PDMR3CritSectDelete(pVM, &pVM->mm.s.pHyperHeapR3->Lock); return VINF_SUCCESS; } diff --git a/src/VBox/VMM/VMMR3/PDM.cpp b/src/VBox/VMM/VMMR3/PDM.cpp index a0387f8c369..81918f3e0e3 100644 --- a/src/VBox/VMM/VMMR3/PDM.cpp +++ b/src/VBox/VMM/VMMR3/PDM.cpp @@ -584,11 +584,6 @@ VMMR3_INT_DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta) pVM->pdm.s.pDevHlpQueueRC = PDMQueueRCPtr(pVM->pdm.s.pDevHlpQueueR3); /* - * Critical sections. - */ - pdmR3CritSectBothRelocate(pVM); - - /* * The registered PIC. */ if (pVM->pdm.s.Pic.pDevInsRC) @@ -893,7 +888,7 @@ VMMR3_INT_DECL(int) PDMR3Term(PVM pVM) /* * Destroy the PDM lock. */ - PDMR3CritSectDelete(&pVM->pdm.s.CritSect); + PDMR3CritSectDelete(pVM, &pVM->pdm.s.CritSect); /* The MiscCritSect is deleted by PDMR3CritSectBothTerm later. */ LogFlow(("PDMR3Term: returns %Rrc\n", VINF_SUCCESS)); diff --git a/src/VBox/VMM/VMMR3/PDMCritSect.cpp b/src/VBox/VMM/VMMR3/PDMCritSect.cpp index 5b8b3d57d92..6ca86837f2c 100644 --- a/src/VBox/VMM/VMMR3/PDMCritSect.cpp +++ b/src/VBox/VMM/VMMR3/PDMCritSect.cpp @@ -61,30 +61,6 @@ int pdmR3CritSectBothInitStats(PVM pVM) /** - * Relocates all the critical sections. - * - * @param pVM The cross context VM structure. - */ -void pdmR3CritSectBothRelocate(PVM pVM) -{ - PUVM pUVM = pVM->pUVM; - RTCritSectEnter(&pUVM->pdm.s.ListCritSect); - - for (PPDMCRITSECTINT pCur = pUVM->pdm.s.pCritSects; - pCur; - pCur = pCur->pNext) - pCur->pVMRC = pVM->pVMRC; - - for (PPDMCRITSECTRWINT pCur = pUVM->pdm.s.pRwCritSects; - pCur; - pCur = pCur->pNext) - pCur->pVMRC = pVM->pVMRC; - - RTCritSectLeave(&pUVM->pdm.s.ListCritSect); -} - - -/** * Deletes all remaining critical sections. * * This is called at the very end of the termination process. It is also called @@ -181,9 +157,6 @@ static int pdmR3CritSectInitOne(PVM pVM, PPDMCRITSECTINT pCritSect, void *pvKey, pCritSect->Core.cNestings = 0; pCritSect->Core.cLockers = -1; pCritSect->Core.NativeThreadOwner = NIL_RTNATIVETHREAD; - pCritSect->pVMR3 = pVM; - pCritSect->pVMR0 = pVM->pVMR0ForCall; - pCritSect->pVMRC = pVM->pVMRC; pCritSect->pvKey = pvKey; pCritSect->fAutomaticDefaultCritsect = false; pCritSect->fUsedByTimerOrSimilar = false; @@ -278,9 +251,6 @@ static int pdmR3CritSectRwInitOne(PVM pVM, PPDMCRITSECTRWINT pCritSect, void *pv #if HC_ARCH_BITS == 32 pCritSect->Core.HCPtrPadding = NIL_RTHCPTR; #endif - pCritSect->pVMR3 = pVM; - pCritSect->pVMR0 = pVM->pVMR0ForCall; - pCritSect->pVMRC = pVM->pVMRC; pCritSect->pvKey = pvKey; pCritSect->pszName = pszName; @@ -533,9 +503,6 @@ static int pdmR3CritSectDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTINT pCritSect, RTLockValidatorRecExclDestroy(&pCritSect->Core.pValidatorRec); pCritSect->pNext = NULL; pCritSect->pvKey = NULL; - pCritSect->pVMR3 = NULL; - pCritSect->pVMR0 = NIL_RTR0PTR; - pCritSect->pVMRC = NIL_RTRCPTR; if (!fFinal) STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSects/%s/*", pCritSect->pszName); RTStrFree((char *)pCritSect->pszName); @@ -604,9 +571,6 @@ static int pdmR3CritSectRwDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTRWINT pCritS pCritSect->pNext = NULL; pCritSect->pvKey = NULL; - pCritSect->pVMR3 = NULL; - pCritSect->pVMR0 = NIL_RTR0PTR; - pCritSect->pVMRC = NIL_RTRCPTR; if (!fFinal) STAMR3DeregisterF(pVM->pUVM, "/PDM/CritSectsRw/%s/*", pCritSect->pszName); RTStrFree((char *)pCritSect->pszName); @@ -730,9 +694,10 @@ int pdmR3CritSectBothDeleteDriver(PVM pVM, PPDMDRVINS pDrvIns) * Deletes the critical section. * * @returns VBox status code. - * @param pCritSect The PDM critical section to destroy. + * @param pVM The cross context VM structure. + * @param pCritSect The PDM critical section to destroy. */ -VMMR3DECL(int) PDMR3CritSectDelete(PPDMCRITSECT pCritSect) +VMMR3DECL(int) PDMR3CritSectDelete(PVM pVM, PPDMCRITSECT pCritSect) { if (!RTCritSectIsInitialized(&pCritSect->s.Core)) return VINF_SUCCESS; @@ -740,7 +705,6 @@ VMMR3DECL(int) PDMR3CritSectDelete(PPDMCRITSECT pCritSect) /* * Find and unlink it. */ - PVM pVM = pCritSect->s.pVMR3; PUVM pUVM = pVM->pUVM; AssertReleaseReturn(pVM, VERR_PDM_CRITSECT_IPE); PPDMCRITSECTINT pPrev = NULL; @@ -780,7 +744,6 @@ VMMR3DECL(int) PDMR3CritSectRwDelete(PVM pVM, PPDMCRITSECTRW pCritSect) /* * Find and unlink it. */ - Assert(pCritSect->s.pVMR3 == pVM); PUVM pUVM = pVM->pUVM; AssertReleaseReturn(pVM, VERR_PDM_CRITSECT_IPE); PPDMCRITSECTRWINT pPrev = NULL; diff --git a/src/VBox/VMM/VMMR3/PDMDevHlp.cpp b/src/VBox/VMM/VMMR3/PDMDevHlp.cpp index 39f24a44c01..ef6811e97ae 100644 --- a/src/VBox/VMM/VMMR3/PDMDevHlp.cpp +++ b/src/VBox/VMM/VMMR3/PDMDevHlp.cpp @@ -2736,7 +2736,6 @@ static DECLCALLBACK(int) pdmR3DevHlp_SetDeviceCritSect(PPDMDEVINS pDevIns, PPDMC pDevIns->pReg->szName, pDevIns->iInstance, pCritSect, pCritSect->s.pszName)); AssertReturn(PDMCritSectIsInitialized(pCritSect), VERR_INVALID_PARAMETER); PVM pVM = pDevIns->Internal.s.pVMR3; - AssertReturn(pCritSect->s.pVMR3 == pVM, VERR_INVALID_PARAMETER); VM_ASSERT_EMT(pVM); VM_ASSERT_STATE_RETURN(pVM, VMSTATE_CREATING, VERR_WRONG_ORDER); @@ -2767,7 +2766,7 @@ static DECLCALLBACK(int) pdmR3DevHlp_SetDeviceCritSect(PPDMDEVINS pDevIns, PPDMC AssertLogRelRCReturn(rc, rc); } - PDMR3CritSectDelete(pOldCritSect); + PDMR3CritSectDelete(pVM, pOldCritSect); Assert((uintptr_t)pOldCritSect - (uintptr_t)pDevIns < pDevIns->cbRing3); LogFlow(("pdmR3DevHlp_SetDeviceCritSect: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, VINF_SUCCESS)); @@ -2871,8 +2870,7 @@ static DECLCALLBACK(int) pdmR3DevHlp_CritSectScheduleExitEvent(PPDMDEVINS pDevIn static DECLCALLBACK(int) pdmR3DevHlp_CritSectDelete(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect) { PDMDEV_ASSERT_DEVINS(pDevIns); - RT_NOREF(pDevIns); - return PDMR3CritSectDelete(pCritSect); + return PDMR3CritSectDelete(pDevIns->Internal.s.pVMR3, pCritSect); } diff --git a/src/VBox/VMM/VMMR3/PDMDriver.cpp b/src/VBox/VMM/VMMR3/PDMDriver.cpp index ac528485bfe..09e40347135 100644 --- a/src/VBox/VMM/VMMR3/PDMDriver.cpp +++ b/src/VBox/VMM/VMMR3/PDMDriver.cpp @@ -1908,8 +1908,7 @@ static DECLCALLBACK(int) pdmR3DrvHlp_CritSectScheduleExitEvent(PPDMDRVINS p static DECLCALLBACK(int) pdmR3DrvHlp_CritSectDelete(PPDMDRVINS pDrvIns, PPDMCRITSECT pCritSect) { PDMDRV_ASSERT_DRVINS(pDrvIns); - RT_NOREF(pDrvIns); - return PDMR3CritSectDelete(pCritSect); + return PDMR3CritSectDelete(pDrvIns->Internal.s.pVMR3, pCritSect); } diff --git a/src/VBox/VMM/VMMR3/PDMNetShaper.cpp b/src/VBox/VMM/VMMR3/PDMNetShaper.cpp index 6f991ebf080..dc46189be1a 100644 --- a/src/VBox/VMM/VMMR3/PDMNetShaper.cpp +++ b/src/VBox/VMM/VMMR3/PDMNetShaper.cpp @@ -152,14 +152,14 @@ static int pdmNsBwGroupCreate(PPDMNETSHAPER pShaper, const char *pszBwGroup, uin PPDMNSBWGROUP pBwGroup = pdmNsBwGroupFindById(pShaper, pszBwGroup); if (!pBwGroup) { - rc = MMHyperAlloc(pShaper->pVM, sizeof(PDMNSBWGROUP), 64, - MM_TAG_PDM_NET_SHAPER, (void **)&pBwGroup); + PVM const pVM = pShaper->pVM; + rc = MMHyperAlloc(pVM, sizeof(PDMNSBWGROUP), 64, MM_TAG_PDM_NET_SHAPER, (void **)&pBwGroup); if (RT_SUCCESS(rc)) { - rc = PDMR3CritSectInit(pShaper->pVM, &pBwGroup->Lock, RT_SRC_POS, "BWGRP-%s", pszBwGroup); + rc = PDMR3CritSectInit(pVM, &pBwGroup->Lock, RT_SRC_POS, "BWGRP-%s", pszBwGroup); if (RT_SUCCESS(rc)) { - pBwGroup->pszNameR3 = MMR3HeapStrDup(pShaper->pVM, MM_TAG_PDM_NET_SHAPER, pszBwGroup); + pBwGroup->pszNameR3 = MMR3HeapStrDup(pVM, MM_TAG_PDM_NET_SHAPER, pszBwGroup); if (pBwGroup->pszNameR3) { pBwGroup->pShaperR3 = pShaper; @@ -175,9 +175,9 @@ static int pdmNsBwGroupCreate(PPDMNETSHAPER pShaper, const char *pszBwGroup, uin pdmNsBwGroupLink(pBwGroup); return VINF_SUCCESS; } - PDMR3CritSectDelete(&pBwGroup->Lock); + PDMR3CritSectDelete(pVM, &pBwGroup->Lock); } - MMHyperFree(pShaper->pVM, pBwGroup); + MMHyperFree(pVM, pBwGroup); } else rc = VERR_NO_MEMORY; @@ -190,11 +190,11 @@ static int pdmNsBwGroupCreate(PPDMNETSHAPER pShaper, const char *pszBwGroup, uin } -static void pdmNsBwGroupTerminate(PPDMNSBWGROUP pBwGroup) +static void pdmNsBwGroupTerminate(PVM pVM, PPDMNSBWGROUP pBwGroup) { Assert(pBwGroup->cRefs == 0); if (PDMCritSectIsInitialized(&pBwGroup->Lock)) - PDMR3CritSectDelete(&pBwGroup->Lock); + PDMR3CritSectDelete(pVM, &pBwGroup->Lock); } @@ -468,7 +468,7 @@ int pdmR3NetShaperTerm(PVM pVM) { PPDMNSBWGROUP pFree = pBwGroup; pBwGroup = pBwGroup->pNextR3; - pdmNsBwGroupTerminate(pFree); + pdmNsBwGroupTerminate(pVM, pFree); MMR3HeapFree(pFree->pszNameR3); MMHyperFree(pVM, pFree); } diff --git a/src/VBox/VMM/VMMR3/PGM.cpp b/src/VBox/VMM/VMMR3/PGM.cpp index aaaf2b51ec4..e658a8090d1 100644 --- a/src/VBox/VMM/VMMR3/PGM.cpp +++ b/src/VBox/VMM/VMMR3/PGM.cpp @@ -1063,7 +1063,7 @@ VMMR3DECL(int) PGMR3Init(PVM pVM) } /* Almost no cleanup necessary, MM frees all memory. */ - PDMR3CritSectDelete(&pVM->pgm.s.CritSectX); + PDMR3CritSectDelete(pVM, &pVM->pgm.s.CritSectX); return rc; } @@ -2138,7 +2138,7 @@ VMMR3DECL(int) PGMR3Term(PVM pVM) pgmUnlock(pVM); PGMDeregisterStringFormatTypes(); - return PDMR3CritSectDelete(&pVM->pgm.s.CritSectX); + return PDMR3CritSectDelete(pVM, &pVM->pgm.s.CritSectX); } diff --git a/src/VBox/VMM/include/PDMInternal.h b/src/VBox/VMM/include/PDMInternal.h index 7ff9ad963b6..d6199169532 100644 --- a/src/VBox/VMM/include/PDMInternal.h +++ b/src/VBox/VMM/include/PDMInternal.h @@ -422,12 +422,6 @@ typedef struct PDMCRITSECTINT * This is pDevIns if the owner is a device. Similarly for a driver or service. * PDMR3CritSectInit() sets this to point to the critsect itself. */ RTR3PTR pvKey; - /** Pointer to the VM - R3Ptr. */ - PVMR3 pVMR3; - /** Pointer to the VM - R0Ptr. */ - R0PTRTYPE(PVMCC) pVMR0; - /** Pointer to the VM - GCPtr. */ - PVMRC pVMRC; /** Set if this critical section is the automatically created default * section of a device. */ bool fAutomaticDefaultCritsect; @@ -435,7 +429,7 @@ typedef struct PDMCRITSECTINT * See PDMR3DevGetCritSect. */ bool fUsedByTimerOrSimilar; /** Alignment padding. */ - bool afPadding[2]; + bool afPadding[2+4]; /** Support driver event semaphore that is scheduled to be signaled upon leaving * the critical section. This is only for Ring-3 and Ring-0. */ SUPSEMEVENT hEventToSignal; @@ -475,16 +469,6 @@ typedef struct PDMCRITSECTRWINT * This is pDevIns if the owner is a device. Similarly for a driver or service. * PDMR3CritSectInit() sets this to point to the critsect itself. */ RTR3PTR pvKey; - /** Pointer to the VM - R3Ptr. */ - PVMR3 pVMR3; - /** Pointer to the VM - R0Ptr. */ - R0PTRTYPE(PVMCC) pVMR0; - /** Pointer to the VM - GCPtr. */ - PVMRC pVMRC; -#if HC_ARCH_BITS == 64 - /** Alignment padding. */ - RTRCPTR RCPtrPadding; -#endif /** The lock name. */ R3PTRTYPE(const char *) pszName; /** R0/RC write lock contention. */ @@ -1614,7 +1598,6 @@ extern const PDMPCIRAWHLPR3 g_pdmR3DevPciRawHlp; bool pdmR3IsValidName(const char *pszName); int pdmR3CritSectBothInitStats(PVM pVM); -void pdmR3CritSectBothRelocate(PVM pVM); int pdmR3CritSectBothDeleteDevice(PVM pVM, PPDMDEVINS pDevIns); int pdmR3CritSectBothDeleteDriver(PVM pVM, PPDMDRVINS pDrvIns); int pdmR3CritSectInitDevice( PVM pVM, PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, RT_SRC_POS_DECL, |