VirtualBox

Changeset 59138 in vbox for trunk/src/VBox/VMM/VMMR3/VMM.cpp


Ignore:
Timestamp:
Dec 15, 2015 4:39:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104712
Message:

VMM,VM: Allow EMT rendezvous from VMREQFLAGS_PRIORITY callbacks as the VM state will prevent really bad stuff from succeeding if we're actually in a async reset or suspend (the origin on the priority EMT requests), while making it stuff work just fine all the time we're not (like when out of memory).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r59132 r59138  
    18751875{
    18761876    Assert(!pVCpu->vmm.s.fInRendezvous);
     1877    Log(("VMMR3EmtRendezvousFF: EMT%#u\n", pVCpu->idCpu));
    18771878    pVCpu->vmm.s.fInRendezvous = true;
    18781879    VBOXSTRICTRC rcStrict = vmmR3EmtRendezvousCommon(pVM, pVCpu, false /* fIsCaller */, pVM->vmm.s.fRendezvousFlags,
    18791880                                                     pVM->vmm.s.pfnRendezvous, pVM->vmm.s.pvRendezvousUser);
    18801881    pVCpu->vmm.s.fInRendezvous = false;
     1882    Log(("VMMR3EmtRendezvousFF: EMT%#u returns %Rrc\n", pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict)));
    18811883    return VBOXSTRICTRC_TODO(rcStrict);
    18821884}
     
    19191921                                                PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser)
    19201922{
     1923    Log(("vmmR3EmtRendezvousRecursive: %#x EMT#%u depth=%d\n", fFlags, pVCpu->idCpu, pVM->vmm.s.cRendezvousRecursions));
    19211924    AssertLogRelReturn(pVM->vmm.s.cRendezvousRecursions < 3, VERR_DEADLOCK);
     1925    Assert(pVCpu->vmm.s.fInRendezvous);
    19221926
    19231927    /*
     
    21022106    ASMAtomicDecU32(&pVM->vmm.s.cRendezvousRecursions);
    21032107
     2108    Log(("vmmR3EmtRendezvousRecursive: %#x EMT#%u depth=%d returns %Rrc\n",
     2109         fFlags, pVCpu->idCpu, pVM->vmm.s.cRendezvousRecursions, VBOXSTRICTRC_VAL(rcStrict)));
    21042110    return rcStrict;
    21052111}
     
    21482154         * Forward the request to an EMT thread.
    21492155         */
     2156    {
     2157        Log(("VMMR3EmtRendezvous: %#x non-EMT\n", fFlags));
    21502158        rcStrict = VMR3ReqCallWait(pVM, VMCPUID_ANY,
    21512159                                   (PFNRT)VMMR3EmtRendezvous, 4, pVM, fFlags, pfnRendezvous, pvUser);
     2160        Log(("VMMR3EmtRendezvous: %#x non-EMT returns %Rrc\n", fFlags, VBOXSTRICTRC_VAL(rcStrict)));
     2161    }
    21522162    else if (pVM->cCpus == 1)
    21532163    {
     
    21572167        if (!pVCpu->vmm.s.fInRendezvous)
    21582168        {
     2169            Log(("VMMR3EmtRendezvous: %#x EMT (uni)\n", fFlags));
    21592170            pVCpu->vmm.s.fInRendezvous  = true;
    21602171            pVM->vmm.s.fRendezvousFlags = fFlags;
     
    21652176        {
    21662177            /* Recursion. Do the same checks as in the SMP case. */
     2178            Log(("VMMR3EmtRendezvous: %#x EMT (uni), recursion depth=%d\n", fFlags, pVM->vmm.s.cRendezvousRecursions));
    21672179            uint32_t fType = pVM->vmm.s.fRendezvousFlags & VMMEMTRENDEZVOUS_FLAGS_TYPE_MASK;
    21682180            AssertLogRelReturn(   !pVCpu->vmm.s.fInRendezvous
     
    21832195            pVM->vmm.s.cRendezvousRecursions--;
    21842196        }
     2197        Log(("VMMR3EmtRendezvous: %#x EMT (uni) returns %Rrc\n", fFlags, VBOXSTRICTRC_VAL(rcStrict)));
    21852198    }
    21862199    else
     
    22062219                                  VERR_DEADLOCK);
    22072220
     2221            Log(("VMMR3EmtRendezvous: %#x EMT#%u, waiting for lock...\n", fFlags, pVCpu->idCpu));
    22082222            while (!ASMAtomicCmpXchgU32(&pVM->vmm.s.u32RendezvousLock, 0x77778888, 0))
    22092223            {
     
    22202234            }
    22212235        }
     2236
     2237        Log(("VMMR3EmtRendezvous: %#x EMT#%u\n", fFlags, pVCpu->idCpu));
    22222238        Assert(!VM_FF_IS_PENDING(pVM, VM_FF_EMT_RENDEZVOUS));
    22232239        Assert(!pVCpu->vmm.s.fInRendezvous);
     
    22912307                 || rcStrict > rcStrict3))
    22922308            rcStrict = rcStrict3;
     2309        Log(("VMMR3EmtRendezvous: %#x EMT#%u returns %Rrc\n", fFlags, pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict)));
    22932310    }
    22942311
     
    22982315                          VERR_IPE_UNEXPECTED_INFO_STATUS);
    22992316    return VBOXSTRICTRC_VAL(rcStrict);
    2300 }
    2301 
    2302 
    2303 /**
    2304  * Disables/enables EMT rendezvous.
    2305  *
    2306  * This is used to make sure EMT rendezvous does not take place while
    2307  * processing a priority request.
    2308  *
    2309  * @returns Old rendezvous-disabled state.
    2310  * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
    2311  * @param   fDisabled       True if disabled, false if enabled.
    2312  */
    2313 VMMR3_INT_DECL(bool) VMMR3EmtRendezvousSetDisabled(PVMCPU pVCpu, bool fDisabled)
    2314 {
    2315     VMCPU_ASSERT_EMT(pVCpu);
    2316     bool fOld = pVCpu->vmm.s.fInRendezvous;
    2317     pVCpu->vmm.s.fInRendezvous = fDisabled;
    2318     return fOld;
    23192317}
    23202318
Note: See TracChangeset for help on using the changeset viewer.

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