VirtualBox

Changeset 99650 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
May 8, 2023 6:49:25 AM (20 months ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:10318 Clear "NMI unblocked due to IRET" state on VM-exit. Minor optimization while injecting an event. Comments, assertions.

File:
1 edited

Legend:

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

    r99369 r99650  
    25782578        }
    25792579
    2580         /* For exception or NMI VM-exits the VM-exit interruption info. field must be valid. */
     2580        /* For exception or NMI VM-exits, the VM-exit interruption info. field must be valid. */
    25812581        Assert(uExitReason != VMX_EXIT_XCPT_OR_NMI || VMX_EXIT_INT_INFO_IS_VALID(pVmcs->u32RoExitIntInfo));
     2582
     2583        /* For external interrupts that occur while "acknowledge interrupt on exit" VM-exit is set,
     2584           the VM-exit interruption info. field must be valid. */
     2585        Assert(   uExitReason != VMX_EXIT_EXT_INT
     2586               || !(pVmcs->u32ExitCtls & VMX_EXIT_CTLS_ACK_EXT_INT)
     2587               || VMX_EXIT_INT_INFO_IS_VALID(pVmcs->u32RoExitIntInfo));
    25822588
    25832589        /*
     
    26342640    if (pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER)
    26352641        CPUMStopGuestVmxPremptTimer(pVCpu);
     2642
     2643    /*
     2644     * Clear the state of "NMI unblocked due to IRET" as otherwise we risk
     2645     * reporting a stale state on a subsequent VM-exit. This state will be
     2646     * re-established while emulating IRET in VMX non-root mode.
     2647     */
     2648    pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret = false;
    26362649
    26372650    /*
     
    76107623        Log(("%s: Injecting: fault_addr=%RGp\n", pszInstr, GCPtrFaultAddress));
    76117624    }
    7612     else if (   uType == VMX_ENTRY_INT_INFO_TYPE_SW_INT
    7613              || uType == VMX_ENTRY_INT_INFO_TYPE_SW_XCPT
    7614              || uType == VMX_ENTRY_INT_INFO_TYPE_PRIV_SW_XCPT)
    7615     {
    7616         TRPMSetInstrLength(pVCpu, cbInstr);
    7617         Log(("%s: Injecting: instr_len=%u\n", pszInstr, cbInstr));
    7618     }
    7619 
    7620     if (VMX_ENTRY_INT_INFO_TYPE(uEntryIntInfo) == VMX_ENTRY_INT_INFO_TYPE_PRIV_SW_XCPT)
    7621     {
    7622         TRPMSetTrapDueToIcebp(pVCpu);
    7623         Log(("%s: Injecting: icebp\n", pszInstr));
     7625    else
     7626    {
     7627        switch (uType)
     7628        {
     7629            case VMX_ENTRY_INT_INFO_TYPE_PRIV_SW_XCPT:
     7630                TRPMSetTrapDueToIcebp(pVCpu);
     7631                Log(("%s: Injecting: icebp\n", pszInstr));
     7632                RT_FALL_THRU();
     7633            case VMX_ENTRY_INT_INFO_TYPE_SW_INT:
     7634            case VMX_ENTRY_INT_INFO_TYPE_SW_XCPT:
     7635                TRPMSetInstrLength(pVCpu, cbInstr);
     7636                Log(("%s: Injecting: instr_len=%u\n", pszInstr, cbInstr));
     7637                break;
     7638        }
    76247639    }
    76257640
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