VirtualBox

Changeset 78919 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 3, 2019 6:52:00 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Signal NMI-window FF not just when an IRET finishes executing. Set it up during nested-guest VM-entry.

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

Legend:

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

    r78888 r78919  
    38663866        if (IEM_VMX_IS_PINCTLS_SET(pVCpu, VMX_PIN_CTLS_NMI_EXIT))
    38673867            fBlockingNmi = false;
    3868 
    3869         /* Signal a pending NMI-window VM-exit before executing the next instruction. */
    3870         if (   IEM_VMX_IS_PROCCTLS_SET(pVCpu, VMX_PROC_CTLS_NMI_WINDOW_EXIT)
    3871             && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
    3872         {
    3873             Assert(IEM_VMX_IS_PINCTLS_SET(pVCpu, VMX_PIN_CTLS_VIRT_NMI));
    3874             VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW);
    3875         }
    38763868
    38773869        /* Clear virtual-NMI blocking, if any, before causing any further exceptions. */
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r78889 r78919  
    27722772    Assert(pVmcs->u64RoIoRip.u == 0);
    27732773
     2774    /* We should not cause an NMI-window/interrupt-window VM-exit when injecting events as part of VM-entry. */
     2775    if (!pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents)
     2776    {
     2777        Assert(uExitReason != VMX_EXIT_NMI_WINDOW);
     2778        Assert(uExitReason != VMX_EXIT_INT_WINDOW);
     2779    }
     2780
    27742781    /*
    27752782     * Save the guest state back into the VMCS.
     
    39403947
    39413948    /*
    3942      * If the event is being injected as part of VM-entry, it isn't subject to event
     3949     * If the event is being injected as part of VM-entry, it is -not- subject to event
    39433950     * intercepts in the nested-guest. However, secondary exceptions that occur during
    39443951     * injection of any event -are- subject to event interception.
     
    72467253
    72477254/**
     7255 * Sets up NMI-window exiting.
     7256 *
     7257 * @param   pVCpu       The cross context virtual CPU structure.
     7258 * @param   pszInstr    The VMX instruction name (for logging purposes).
     7259 */
     7260IEM_STATIC void iemVmxVmentrySetupNmiWindow(PVMCPU pVCpu, const char *pszInstr)
     7261{
     7262    PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
     7263    Assert(pVmcs);
     7264    if (pVmcs->u32ProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT)
     7265    {
     7266        Assert(pVmcs->u32PinCtls & VMX_PIN_CTLS_VIRT_NMI);
     7267        VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW);
     7268        Log(("%s: NMI-window set on VM-entry\n", pszInstr));
     7269    }
     7270    else
     7271        Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
     7272    NOREF(pszInstr);
     7273}
     7274
     7275
     7276/**
    72487277 * Set up the VMX-preemption timer.
    72497278 *
     
    76637692                                /* Setup monitor-trap flag. */
    76647693                                iemVmxVmentrySetupMtf(pVCpu, pszInstr);
     7694
     7695                                /* Setup NMI-window exiting. */
     7696                                iemVmxVmentrySetupNmiWindow(pVCpu, pszInstr);
    76657697
    76667698                                /* 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