VirtualBox

Changeset 90348 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jul 26, 2021 9:01:38 PM (4 years ago)
Author:
vboxsync
Message:

VMM: Removed the VM pointers from the internal critsect structures. bugref:9218 bugref:10074

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r90346 r90348  
    146146     * The wait loop.
    147147     */
    148     PSUPDRVSESSION  pSession    = pCritSect->s.CTX_SUFF(pVM)->pSession;
     148    PSUPDRVSESSION  pSession    = pVM->pSession;
    149149    SUPSEMEVENT     hEvent      = (SUPSEMEVENT)pCritSect->s.Core.EventSem;
    150150# ifdef IN_RING3
     
    248248        return VINF_SUCCESS;
    249249
    250     Assert(pCritSect->s.CTX_SUFF(pVM) == pVM); RT_NOREF(pVM);
    251250    RTNATIVETHREAD hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect);
    252251    /* ... not owned ... */
     
    460459        return VINF_SUCCESS;
    461460
    462     Assert(pCritSect->s.CTX_SUFF(pVM) == pVM);
    463461    RTNATIVETHREAD hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect);
    464462    /* ... not owned ... */
     
    596594     * Always check that the caller is the owner (screw performance).
    597595     */
    598     Assert(pCritSect->s.CTX_SUFF(pVM) == pVM); RT_NOREF(pVM);
    599596    RTNATIVETHREAD const hNativeSelf = pdmCritSectGetNativeSelf(pVM, pCritSect);
    600597    AssertReleaseMsgReturn(pCritSect->s.Core.NativeThreadOwner == hNativeSelf,
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp

    r90347 r90348  
    127127 * Go back to ring-3 so the kernel can do signals, APCs and other fun things.
    128128 *
    129  * @param   pThis       Pointer to the read/write critical section.
    130  */
    131 static void pdmR0CritSectRwYieldToRing3(PPDMCRITSECTRW pThis)
    132 {
    133     PVMCC     pVM   = pThis->s.CTX_SUFF(pVM);     AssertPtr(pVM);
    134     PVMCPUCC  pVCpu = VMMGetCpu(pVM);             AssertPtr(pVCpu);
     129 * @param   pVM         The cross context VM structure.
     130 */
     131static void pdmR0CritSectRwYieldToRing3(PVMCC pVM)
     132{
     133    PVMCPUCC pVCpu = VMMGetCpu(pVM);
     134    AssertPtrReturnVoid(pVCpu);
    135135    int rc = VMMRZCallRing3(pVM, pVCpu, VMMCALLRING3_VM_R0_PREEMPT, NULL);
    136136    AssertRC(rc);
     
    158158    AssertPtr(pThis);
    159159    AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED);
    160     Assert(pThis->s.CTX_SUFF(pVM) == pVM);
    161160
    162161#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
     
    302301                                    break;
    303302# ifdef IN_RING0
    304                                 pdmR0CritSectRwYieldToRing3(pThis);
     303                                pdmR0CritSectRwYieldToRing3(pVM);
    305304# endif
    306305                            }
     
    567566    AssertPtr(pThis);
    568567    AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED);
    569     Assert(pThis->s.CTX_SUFF(pVM) == pVM);
    570568
    571569#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
     
    721719    AssertPtr(pThis);
    722720    AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED);
    723     Assert(pThis->s.CTX_SUFF(pVM) == pVM);
    724721
    725722#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
     
    873870                            break;
    874871# ifdef IN_RING0
    875                         pdmR0CritSectRwYieldToRing3(pThis);
     872                        pdmR0CritSectRwYieldToRing3(pVM);
    876873# endif
    877874                    }
     
    11221119    AssertPtr(pThis);
    11231120    AssertReturn(pThis->s.Core.u32Magic == RTCRITSECTRW_MAGIC, VERR_SEM_DESTROYED);
    1124     Assert(pThis->s.CTX_SUFF(pVM) == pVM);
    11251121
    11261122#if !defined(PDMCRITSECTRW_STRICT) || !defined(IN_RING3)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette