VirtualBox

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


Ignore:
Timestamp:
Dec 10, 2019 4:32:55 AM (5 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Move validation of guest-interruptibility state inside hmR0VmxGetGuestIntrState, some const nits.

File:
1 edited

Legend:

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

    r82314 r82531  
    49574957        fIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI;
    49584958
     4959    /*
     4960     * Validate.
     4961     */
     4962#ifdef VBOX_STRICT
     4963    /* We don't support block-by-SMI yet.*/
     4964    Assert(!(fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI));
     4965
     4966    /* Block-by-STI must not be set when interrupts are disabled. */
     4967    if (fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_STI)
     4968    {
     4969        HMVMX_CPUMCTX_ASSERT(pVCpu, CPUMCTX_EXTRN_RFLAGS);
     4970        Assert(pVCpu->cpum.GstCtx.eflags.u & X86_EFL_IF);
     4971    }
     4972#endif
     4973
    49594974    return fIntrState;
    49604975}
     
    85698584    Assert(!TRPMHasTrap(pVCpu));
    85708585
    8571     PCPUMCTX     pCtx = &pVCpu->cpum.GstCtx;
     8586    /*
     8587     * Compute/update guest-interruptibility state related FFs.
     8588     * The FFs will be used below while evaluating events to be injected.
     8589     */
     8590    *pfIntrState = hmR0VmxGetGuestIntrState(pVCpu);
     8591
     8592    /*
     8593     * Evaluate if a new event needs to be injected.
     8594     * An event that's already pending has already performed all necessary checks.
     8595     */
    85728596    PVMXVMCSINFO pVmcsInfo      = pVmxTransient->pVmcsInfo;
    85738597    bool const   fIsNestedGuest = pVmxTransient->fIsNestedGuest;
    8574 
    8575     /*
    8576      * Compute/update guest-interruptibility state related FFs.
    8577      */
    8578     /** @todo r=ramshankar: Move this outside this function to the caller. */
    8579     {
    8580         /* Get the current interruptibility-state of the guest or nested-guest (this updates FFs). */
    8581         uint32_t const fIntrState = hmR0VmxGetGuestIntrState(pVCpu);
    8582 
    8583 #ifdef VBOX_STRICT
    8584         /* Validate. */
    8585         Assert(!(fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI));  /* We don't support block-by-SMI yet.*/
    8586         if (fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_STI)
    8587         {
    8588             /* Block-by-STI must not be set when interrupts are disabled. */
    8589             HMVMX_CPUMCTX_ASSERT(pVCpu, CPUMCTX_EXTRN_RFLAGS);
    8590             Assert(pCtx->eflags.Bits.u1IF);
    8591         }
    8592 #endif
    8593 
    8594         /* Update interruptibility state to the caller. */
    8595         *pfIntrState = fIntrState;
    8596     }
    8597 
    8598     /*
    8599      * Evaluate if a new event needs to be injected.
    8600      * An event that's already pending has already performed all necessary checks.
    8601      */
    86028598    if (   !pVCpu->hm.s.Event.fPending
    86038599        && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS))
     
    86098605         * NMIs take priority over external interrupts.
    86108606         */
     8607        PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx;
    86118608        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI))
    86128609        {
     
    1015310150     * Virtual-APIC page and TPR threshold.
    1015410151     */
    10155     PVMXVMCSINFO pVmcsInfoNstGst = &pVCpu->hm.s.vmx.VmcsInfoNstGst;
    10156     RTHCPHYS     HCPhysVirtApic;
    10157     uint32_t     u32TprThreshold;
     10152    RTHCPHYS HCPhysVirtApic;
     10153    uint32_t u32TprThreshold;
    1015810154    if (u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW)
    1015910155    {
     
    1019710193     * Validate basic assumptions.
    1019810194     */
     10195    PVMXVMCSINFO pVmcsInfoNstGst = &pVCpu->hm.s.vmx.VmcsInfoNstGst;
    1019910196    Assert(pVM->hm.s.vmx.fAllowUnrestricted);
    1020010197    Assert(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS);
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