VirtualBox

Changeset 52162 in vbox


Ignore:
Timestamp:
Jul 24, 2014 11:28:58 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95204
Message:

VMM/HMVMXR0: Make hmR0VmxGetGuestIntrState() side-effect free in terms of force-flags.

File:
1 edited

Legend:

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

    r52149 r52162  
    35003500 *
    35013501 * @remarks No-long-jump zone!!!
    3502  * @remarks Has side-effects with VMCPU_FF_INHIBIT_INTERRUPTS force-flag.
    35033502 */
    35043503DECLINLINE(uint32_t) hmR0VmxGetGuestIntrState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
     
    35143513        AssertMsg(HMVMXCPU_GST_IS_SET(pVCpu, HMVMX_UPDATED_GUEST_RIP | HMVMX_UPDATED_GUEST_RFLAGS),
    35153514                  ("%#x\n", HMVMXCPU_GST_VALUE(pVCpu)));
    3516         if (pMixedCtx->rip != EMGetInhibitInterruptsPC(pVCpu))
    3517         {
    3518             /*
    3519              * We can clear the inhibit force flag as even if we go back to the recompiler without executing guest code in
    3520              * VT-x, the flag's condition to be cleared is met and thus the cleared state is correct.
    3521              */
    3522             VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
    3523         }
    3524         else if (pMixedCtx->eflags.Bits.u1IF)
    3525             uIntrState = VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI;
    3526         else
    3527             uIntrState = VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_MOVSS;
     3515        if (pMixedCtx->rip == EMGetInhibitInterruptsPC(pVCpu))
     3516        {
     3517            if (pMixedCtx->eflags.Bits.u1IF)
     3518                uIntrState = VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI;
     3519            else
     3520                uIntrState = VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_MOVSS;
     3521        }
     3522        /* else: Although we can clear the force-flag here, let's keep this side-effects free. */
    35283523    }
    35293524
     
    68876882    else if (enmTrpmEvent == TRPM_HARDWARE_INT)
    68886883    {
    6889         /** @todo r=ramshankar: Make this a strict-build assert after this bug is
    6890          *        fixed. See @bugref{7317}. */
     6884#ifdef VBOX_STRICT
    68916885        uint32_t uEFlags = CPUMGetGuestEFlags(pVCpu);
    68926886        if (!(uEFlags & X86_EFL_IF))
     
    68956889            return VERR_VMX_IPE_5;
    68966890        }
    6897 
     6891#endif
    68986892        u32IntInfo |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_EXT_INT << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT);
    68996893    }
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