VirtualBox

Changeset 19682 in vbox for trunk


Ignore:
Timestamp:
May 14, 2009 10:15:44 AM (16 years ago)
Author:
vboxsync
Message:

Try to cleanup after one VCPU goes into guru meditation mode. Release all owned locks so the other VCPUs will be unblocked.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/em.h

    r19611 r19682  
    181181VMMR3DECL(int)      EMR3Interpret(PVM pVM);
    182182
     183VMMR3DECL(void)     EMR3ReleaseOwnedLocks(PVM pVM);
     184
    183185/**
    184186 * Command argument for EMR3RawSetMode().
  • trunk/include/VBox/iom.h

    r18232 r19682  
    264264                                    RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    265265VMMR3DECL(int)  IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange);
     266
     267VMMR3DECL(void) IOMR3ReleaseOwnedLocks(PVM pVM);
     268
    266269/** @} */
    267270#endif /* IN_RING3 */
  • trunk/include/VBox/mm.h

    r19666 r19682  
    253253
    254254VMMR3DECL(int)      MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv);
    255 
     255VMMR3DECL(void)     MMR3ReleaseOwnedLocks(PVM pVM);
    256256
    257257/** @defgroup grp_mm_r3_hyper  Hypervisor Memory Manager (HC R3 Portion)
  • trunk/include/VBox/pdmapi.h

    r19141 r19682  
    115115VMMR3DECL(int)  PDMR3UnregisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys);
    116116
     117VMMR3DECL(void) PDMR3ReleaseOwnedLocks(PVM pVM);
    117118/** @} */
    118119#endif
  • trunk/include/VBox/pgm.h

    r19473 r19682  
    551551VMMR3DECL(int)      PGMR3PhysAllocateHandyPages(PVM pVM);
    552552
     553
     554VMMR3DECL(void)     PGMR3ReleaseOwnedLocks(PVM pVM);
     555
    553556VMMR3DECL(int)      PGMR3CheckIntegrity(PVM pVM);
    554557
  • trunk/src/VBox/VMM/EM.cpp

    r19679 r19682  
    35953595}
    35963596
     3597/**
     3598 * Release the IOM lock if owned by the current VCPU
     3599 *
     3600 * @param   pVM         The VM to operate on.
     3601 */
     3602VMMR3DECL(void) EMR3ReleaseOwnedLocks(PVM pVM)
     3603{
     3604    if (PDMCritSectIsOwner(&pVM->em.s.CritSectREM))
     3605        PDMCritSectLeave(&pVM->em.s.CritSectREM);
     3606}
     3607
    35973608
    35983609/**
  • trunk/src/VBox/VMM/IOM.cpp

    r19470 r19682  
    16411641    iomR3FlushCache(pVM);
    16421642    return VINF_SUCCESS;
     1643}
     1644
     1645
     1646/**
     1647 * Release the IOM lock if owned by the current VCPU
     1648 *
     1649 * @param   pVM         The VM to operate on.
     1650 */
     1651VMMR3DECL(void) IOMR3ReleaseOwnedLocks(PVM pVM)
     1652{
     1653    if (PDMCritSectIsOwner(&pVM->iom.s.EmtLock))
     1654        PDMCritSectLeave(&pVM->iom.s.EmtLock);
    16431655}
    16441656
  • trunk/src/VBox/VMM/MMHyper.cpp

    r19666 r19682  
    10901090}
    10911091
     1092/**
     1093 * Release the MM hypervisor heap lock if owned by the current VCPU
     1094 *
     1095 * @param   pVM         The VM to operate on.
     1096 */
     1097VMMR3DECL(void) MMR3ReleaseOwnedLocks(PVM pVM)
     1098{
     1099    PMMHYPERHEAP pHeap = pVM->mm.s.CTX_SUFF(pHyperHeap);
     1100
     1101    if (PDMCritSectIsOwner(&pHeap->Lock))
     1102        PDMCritSectLeave(&pHeap->Lock);
     1103}
     1104
    10921105
    10931106/**
  • trunk/src/VBox/VMM/PDM.cpp

    r19494 r19682  
    14411441    return VINF_SUCCESS;
    14421442}
     1443
     1444/**
     1445 * Release the PDM lock if owned by the current VCPU
     1446 *
     1447 * @param   pVM         The VM to operate on.
     1448 */
     1449VMMR3DECL(void) PDMR3ReleaseOwnedLocks(PVM pVM)
     1450{
     1451    if (PDMCritSectIsOwner(&pVM->pdm.s.CritSect))
     1452        PDMCritSectLeave(&pVM->pdm.s.CritSect);
     1453}
  • trunk/src/VBox/VMM/PGM.cpp

    r19666 r19682  
    40544054}
    40554055
     4056/**
     4057 * Release the pgm lock if owned by the current VCPU
     4058 *
     4059 * @param   pVM         The VM to operate on.
     4060 */
     4061VMMR3DECL(void) PGMR3ReleaseOwnedLocks(PVM pVM)
     4062{
     4063    if (PDMCritSectIsOwner(&pVM->pgm.s.CritSect))
     4064        PDMCritSectLeave(&pVM->pgm.s.CritSect);
     4065}
    40564066
    40574067/**
  • trunk/src/VBox/VMM/VMEmt.cpp

    r19660 r19682  
    3434#include <VBox/vm.h>
    3535#include <VBox/uvm.h>
     36#include <VBox/mm.h>
     37#include <VBox/pgm.h>
     38#include <VBox/iom.h>
     39#include <VBox/pdm.h>
    3640
    3741#include <VBox/err.h>
     
    224228                if (   EMGetState(pVCpu) == EMSTATE_GURU_MEDITATION
    225229                    && pVM->enmVMState == VMSTATE_RUNNING)
     230                {
     231                    /* Release owned locks to make sure other VCPUs can continue in case they were waiting for one. */
     232                    MMR3ReleaseOwnedLocks(pVM);
     233                    PGMR3ReleaseOwnedLocks(pVM);
     234                    PDMR3ReleaseOwnedLocks(pVM);
     235                    IOMR3ReleaseOwnedLocks(pVM);
     236                    EMR3ReleaseOwnedLocks(pVM);
     237
    226238                    vmR3SetState(pVM, VMSTATE_GURU_MEDITATION);
     239                }
    227240            }
    228241        }
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r19597 r19682  
    218218    PVM pVM = pCritSect->s.CTX_SUFF(pVM);
    219219    Assert(pVM);
     220
     221#ifdef VBOX_STRICT
    220222    PVMCPU pVCpu = VMMGetCpu(pVM);
    221223    Assert(pVCpu);
    222224    AssertMsg(pCritSect->s.Core.NativeThreadOwner == pVCpu->hNativeThread, ("Owner %RX64 emt=%RX64\n", pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread));
     225#endif
    223226
    224227    /*
     
    232235        return;
    233236    }
    234 
     237#ifndef VBOX_STRICT
     238    PVMCPU pVCpu = VMMGetCpu(pVM);
     239#endif
    235240    /*
    236241     * Try leave it.
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r19516 r19682  
    20302030}
    20312031
    2032 
    20332032/**
    20342033 * Check if this VCPU currently owns the PGM lock.
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