VirtualBox

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


Ignore:
Timestamp:
Jan 29, 2018 5:24:06 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120554
Message:

VMM: Nested Hw.virt: Clean up interrupt injection for nested-guests.

File:
1 edited

Legend:

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

    r70732 r70781  
    35053505             * by the physical CPU.
    35063506             */
     3507            /** @todo later explore this for performance reasons. Right now the hardware
     3508             *        takes care of virtual interrupt injection for nested-guest. */
    35073509#if 0
    35083510            if (   VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_INTERRUPT_NESTED_GUEST)
    35093511                && (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VINTR)
    3510                 && CPUMCanSvmNstGstTakeVirtIntr(pCtx))
     3512                && CPUMCanSvmNstGstTakeVirtIntr(pVCpu, pCtx))
    35113513            {
    35123514                Log4(("Intercepting virtual interrupt -> #VMEXIT\n"));
     
    36413643    if (fGif)
    36423644    {
     3645        /*
     3646         * For nested-guests we have no way to determine if we're injecting a physical or virtual
     3647         * interrupt at this point. Hence the partial verification below.
     3648         */
    36433649        if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx))
    3644             fAllowInt = CPUMCanSvmNstGstTakePhysIntr(pVCpu, pCtx);
     3650            fAllowInt = CPUMCanSvmNstGstTakePhysIntr(pVCpu, pCtx) || CPUMCanSvmNstGstTakeVirtIntr(pVCpu, pCtx);
    36453651        else
    36463652            fAllowInt = RT_BOOL(pCtx->eflags.u32 & X86_EFL_IF);
     
    36813687    }
    36823688    else
    3683     {
    3684 #ifdef VBOX_WITH_NESTED_HWVIRT
    3685         /*
    3686          * If IEM emulated VMRUN and injected an event, it would not clear the EVENTINJ::Valid bit
    3687          * as a physical CPU clears it in the VMCB as part of the #VMEXIT (if the AMD spec. is to
    3688          * believed, real behavior might differ). Regardless, IEM does it only on #VMEXIT for now
    3689          * and since we are continuing nested-guest execution using hardware-assisted SVM, we need
    3690          * to clear this field otherwise we will inject the event twice, see @bugref{7243#78}.
    3691          */
    3692         if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx))
    3693             pVmcb->ctrl.EventInject.n.u1Valid = 0;
    3694 #endif
    36953689        Assert(pVmcb->ctrl.EventInject.n.u1Valid == 0);
    3696     }
    36973690
    36983691    /*
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