VirtualBox

Changeset 48394 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Sep 9, 2013 3:54:51 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Address possible deadlock situation with the PGM lock. Reenabled thread-context hooks again.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r48370 r48394  
    60876087 *
    60886088 * @returns VBox status code.
    6089  * @param   pVM         Pointer to the VM.
    6090  * @param   pVCpu       Pointer to the VMCPU.
    6091  * @param   pMixedCtx   Pointer to the guest-CPU context. The data may be
    6092  *                      out-of-sync. Make sure to update the required fields
    6093  *                      before using them.
     6089 * @param   pVM                 Pointer to the VM.
     6090 * @param   pVCpu               Pointer to the VMCPU.
     6091 * @param   pMixedCtx           Pointer to the guest-CPU context. The data may
     6092 *                              be out-of-sync. Make sure to update the required
     6093 *                              fields before using them.
     6094 * @param   fSaveGuestState     Whether to save the guest state or not.
    60946095 *
    60956096 * @remarks No-long-jmp zone!!!
    60966097 */
    6097 static int hmR0VmxLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     6098static int hmR0VmxLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, bool fSaveGuestState)
    60986099{
    60996100    Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
     
    61046105
    61056106    /* Save the guest state if necessary. */
    6106     if (pVCpu->hm.s.vmx.fUpdatedGuestState != HMVMX_UPDATED_GUEST_ALL)
     6107    if (   fSaveGuestState
     6108        && pVCpu->hm.s.vmx.fUpdatedGuestState != HMVMX_UPDATED_GUEST_ALL)
    61076109    {
    61086110        int rc = hmR0VmxSaveGuestState(pVCpu, pMixedCtx);
     
    61946196    if (!pVCpu->hm.s.fLeaveDone)
    61956197    {
    6196         int rc2 = hmR0VmxLeave(pVM, pVCpu, pMixedCtx);
     6198        int rc2 = hmR0VmxLeave(pVM, pVCpu, pMixedCtx, true /* fSaveGuestState */);
    61976199        AssertRCReturn(rc2, rc2);
    61986200        pVCpu->hm.s.fLeaveDone = true;
     
    70117013            Log4Func(("Preempting: HostCpuId=%u\n", RTMpCpuId()));
    70127014
    7013             /* Save the guest-state, restore host-state (FPU, debug etc.). */
     7015            /*
     7016             * Restore host-state (FPU, debug etc.)
     7017             */
    70147018            if (!pVCpu->hm.s.fLeaveDone)
    70157019            {
    7016                 hmR0VmxLeave(pVM, pVCpu, pMixedCtx);
     7020                /* Do -not- save guest-state here as we might already be in the middle of saving it (esp. bad if we are
     7021                   holding the PGM lock while saving the guest state (see hmR0VmxSaveGuestControlRegs()). */
     7022                hmR0VmxLeave(pVM, pVCpu, pMixedCtx, false /* fSaveGuestState */);
    70177023                pVCpu->hm.s.fLeaveDone = true;
    70187024            }
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r48391 r48394  
    450450    VMCPU_ASSERT_EMT(pVCpu);
    451451    Assert(pVCpu->vmm.s.hR0ThreadCtx == NIL_RTTHREADCTX);
    452 #if 0  /* Not stable. */
     452#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
    453453    int rc = RTThreadCtxHooksCreate(&pVCpu->vmm.s.hR0ThreadCtx);
    454454    if (   RT_FAILURE(rc)
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