VirtualBox

Changeset 78982 in vbox


Ignore:
Timestamp:
Jun 5, 2019 8:58:53 AM (5 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Setup interrupt-window exiting similar to NMI-window exiting. Check for interrupt-window exiting before executing subsequent instructions in iemExecOneInner..

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r78977 r78982  
    1407914079        }
    1408014080
    14081         /* NMI-window VM-exit. */
     14081        /*
     14082         * Check remaining intercepts.
     14083         *
     14084         * NMI-window and Interrupt-window VM-exits.
     14085         * Interrupt shadow (block-by-STI and Mov SS) inhibits interrupts and may also block NMIs.
     14086         * Event injection during VM-entry takes priority over NMI-window and interrupt-window VM-exits.
     14087         *
     14088         * See Intel spec. 26.7.6 "NMI-Window Exiting".
     14089         * See Intel spec. 26.7.5 "Interrupt-Window Exiting and Virtual-Interrupt Delivery".
     14090         */
    1408214091        if (    fCheckRemainingIntercepts
    14083              && pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents     /* Event injection during VM-entry takes priority. */
    14084              && VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW)
    14085              && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
    14086              && !CPUMIsGuestNmiBlocking(pVCpu))
     14092            &&  pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents
     14093            && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS))
    1408714094        {
    14088             rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
    14089             Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
     14095            if (   VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW)
     14096                && CPUMIsGuestVmxVirtNmiBlocking(pVCpu, &pVCpu->cpum.GstCtx))
     14097            {
     14098                rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
     14099                Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
     14100            }
     14101            else if (   VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_INT_WINDOW)
     14102                     && CPUMIsGuestVmxVirtIntrEnabled(pVCpu, &pVCpu->cpum.GstCtx))
     14103            {
     14104                rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
     14105                Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_INT_WINDOW));
     14106            }
    1409014107        }
    1409114108    }
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r78977 r78982  
    72907290
    72917291/**
     7292 * Sets up interrupt-window exiting.
     7293 *
     7294 * @param   pVCpu       The cross context virtual CPU structure.
     7295 * @param   pszInstr    The VMX instruction name (for logging purposes).
     7296 */
     7297IEM_STATIC void iemVmxVmentrySetupIntWindow(PVMCPU pVCpu, const char *pszInstr)
     7298{
     7299    PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
     7300    Assert(pVmcs);
     7301    if (pVmcs->u32ProcCtls & VMX_PROC_CTLS_INT_WINDOW_EXIT)
     7302    {
     7303        VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_INT_WINDOW);
     7304        Log(("%s: Interrupt-window set on VM-entry\n", pszInstr));
     7305    }
     7306    else
     7307        Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_INT_WINDOW));
     7308    NOREF(pszInstr);
     7309}
     7310
     7311
     7312/**
    72927313 * Set up the VMX-preemption timer.
    72937314 *
     
    77107731                                /* Setup NMI-window exiting. */
    77117732                                iemVmxVmentrySetupNmiWindow(pVCpu, pszInstr);
     7733
     7734                                /* Setup interrupt-window exiting. */
     7735                                iemVmxVmentrySetupIntWindow(pVCpu, pszInstr);
    77127736
    77137737                                /* Now that we've switched page tables, we can go ahead and inject any event. */
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