VirtualBox

Changeset 77610 in vbox


Ignore:
Timestamp:
Mar 8, 2019 10:31:35 AM (6 years ago)
Author:
vboxsync
Message:

VMM/EM, VMM/IEM: Nested VMX: bugref:9180 Implemented NMI-exiting, NMI-window and virtual-NMI support. Moved VMCPU_FF_VMX_APIC_WRITE to high-priority post mask. Fixed calling iemMemRollback in IEMExecDecodedXXX for VMX instructions. Clear all VMX force-flags in common VM-exit handler rather than in the specific handler, esp since multiple of them may be active at the time of VM-exit.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/iem.h

    r77569 r77610  
    338338VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitInitIpi(PVMCPU pVCpu);
    339339VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitIntWindow(PVMCPU pVCpu);
     340VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitNmiWindow(PVMCPU pVCpu);
    340341VMM_INT_DECL(VBOXSTRICTRC)  IEMExecVmxVmexitMtf(PVMCPU pVCpu);
    341342VMM_INT_DECL(VBOXSTRICTRC)  IEMExecDecodedVmread(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo);
  • trunk/include/VBox/vmm/vm.h

    r76585 r77610  
    369369 *
    370370 * Available VMCPU bits:
    371  *      14, 15, 34 to 63
     371 *      14, 15, 36 to 63
    372372 *
    373373 * @todo If we run low on VMCPU, we may consider merging the SELM bits
     
    556556#define VMCPU_FF_VMX_APIC_WRITE             RT_BIT_64(VMCPU_FF_VMX_APIC_WRITE_BIT)
    557557#define VMCPU_FF_VMX_APIC_WRITE_BIT         33
     558/** VMX interrupt-window event pending. */
     559#define VMCPU_FF_VMX_INT_WINDOW             RT_BIT_64(VMCPU_FF_VMX_INT_WINDOW_BIT)
     560#define VMCPU_FF_VMX_INT_WINDOW_BIT         34
     561/** VMX NMI-window event pending. */
     562#define VMCPU_FF_VMX_NMI_WINDOW             RT_BIT_64(VMCPU_FF_VMX_NMI_WINDOW_BIT)
     563#define VMCPU_FF_VMX_NMI_WINDOW_BIT         35
    558564
    559565
     
    580586                                                 | VMCPU_FF_UPDATE_APIC  | VMCPU_FF_INHIBIT_INTERRUPTS | VMCPU_FF_DBGF \
    581587                                                 | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL \
    582                                                  | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF \
     588                                                 | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF  | VMCPU_FF_VMX_APIC_WRITE \
     589                                                 | VMCPU_FF_VMX_PREEMPT_TIMER | VMCPU_FF_VMX_NMI_WINDOW | VMCPU_FF_VMX_INT_WINDOW \
    583590                                                 | VM_WHEN_RAW_MODE(  VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT \
    584591                                                                    | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0 ) )
     
    597604#define VMCPU_FF_HIGH_PRIORITY_POST_MASK        (  VMCPU_FF_PDM_CRITSECT   | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) \
    598605                                                 | VMCPU_FF_HM_UPDATE_CR3  | VMCPU_FF_HM_UPDATE_PAE_PDPES \
    599                                                  | VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_IEM | VMCPU_FF_IOM )
     606                                                 | VMCPU_FF_IEM | VMCPU_FF_IOM )
    600607
    601608/** Normal priority VM post-execution actions. */
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r77576 r77610  
    987987IEM_STATIC VBOXSTRICTRC     iemVmxVmexitInitIpi(PVMCPU pVCpu);
    988988IEM_STATIC VBOXSTRICTRC     iemVmxVmexitIntWindow(PVMCPU pVCpu);
     989IEM_STATIC VBOXSTRICTRC     iemVmxVmexitNmiWindow(PVMCPU pVCpu);
    989990IEM_STATIC VBOXSTRICTRC     iemVmxVmexitMtf(PVMCPU pVCpu);
    990991IEM_STATIC VBOXSTRICTRC     iemVmxVirtApicAccessMem(PVMCPU pVCpu, uint16_t offAccess, size_t cbAccess, void *pvData, uint32_t fAccess);
     
    55375538#endif
    55385539
     5540    /*
     5541     * Evaluate whether NMI blocking should be in effect.
     5542     * Normally, NMI blocking is in effect whenever we inject an NMI.
     5543     */
     5544    bool fBlockNmi;
     5545    if (   u8Vector == X86_XCPT_NMI
     5546        && (fFlags & IEM_XCPT_FLAGS_T_CPU_XCPT))
     5547        fBlockNmi = true;
     5548
    55395549#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    55405550    if (IEM_VMX_IS_NON_ROOT_MODE(pVCpu))
     
    55435553        if (rcStrict0 != VINF_VMX_INTERCEPT_NOT_ACTIVE)
    55445554            return rcStrict0;
     5555
     5556        /* If virtual-NMI blocking is in effect for the nested-guest, guest NMIs are not blocked. */
     5557        if (pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking)
     5558        {
     5559            Assert(CPUMIsGuestVmxPinCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, VMX_PIN_CTLS_VIRT_NMI));
     5560            fBlockNmi = false;
     5561        }
    55455562    }
    55465563#endif
     
    55695586    }
    55705587#endif
     5588
     5589    /*
     5590     * Set NMI blocking if necessary.
     5591     */
     5592    if (   fBlockNmi
     5593        && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
     5594        VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
    55715595
    55725596    /*
     
    1403814062            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF));
    1403914063        }
    14040         /** Finally, check if the VMX preemption timer has expired. */
     14064        /* VMX preemption timer takes priority over NMI-window exits. */
    1404114065        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER))
    1404214066        {
     
    1404914073                Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER));
    1405014074            }
     14075        }
     14076        /* NMI-window VM-exit. */
     14077        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
     14078        {
     14079            rcStrict = iemVmxVmexitNmiWindow(pVCpu);
     14080            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
    1405114081        }
    1405214082    }
     
    1474114771                    fFlags |= IEM_XCPT_FLAGS_ERR;
    1474214772                    break;
    14743 
    14744                 case X86_XCPT_NMI:
    14745                     VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
    14746                     break;
    1474714773            }
    1474814774            break;
     
    1589515921
    1589615922/**
     15923 * Interface for HM and EM to emulate VM-exits for NMI-windows.
     15924 *
     15925 * @returns Strict VBox status code.
     15926 * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
     15927 * @thread  EMT(pVCpu)
     15928 */
     15929VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitNmiWindow(PVMCPU pVCpu)
     15930{
     15931    VBOXSTRICTRC rcStrict = iemVmxVmexitNmiWindow(pVCpu);
     15932    if (pVCpu->iem.s.cActiveMappings)
     15933        iemMemRollback(pVCpu);
     15934    return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     15935}
     15936
     15937
     15938/**
    1589715939 * Interface for HM and EM to emulate VM-exits Monitor-Trap Flag (MTF).
    1589815940 *
     
    1594915991        rcStrict = iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrDst, uFieldEnc, pExitInfo);
    1595015992    }
    15951     if (pVCpu->iem.s.cActiveMappings)
    15952         iemMemRollback(pVCpu);
    15953     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     15993    Assert(!pVCpu->iem.s.cActiveMappings);
     15994    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1595415995}
    1595515996
     
    1598916030    uint32_t const uFieldEnc = iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2);
    1599016031    VBOXSTRICTRC rcStrict = iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, u64Val, uFieldEnc, pExitInfo);
    15991     if (pVCpu->iem.s.cActiveMappings)
    15992         iemMemRollback(pVCpu);
    15993     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16032    Assert(!pVCpu->iem.s.cActiveMappings);
     16033    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1599416034}
    1599516035
     
    1601516055    RTGCPTR const GCPtrVmcs = pExitInfo->GCPtrEffAddr;
    1601616056    VBOXSTRICTRC rcStrict = iemVmxVmptrld(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo);
    16017     if (pVCpu->iem.s.cActiveMappings)
    16018         iemMemRollback(pVCpu);
    16019     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16057    Assert(!pVCpu->iem.s.cActiveMappings);
     16058    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1602016059}
    1602116060
     
    1604116080    RTGCPTR const GCPtrVmcs = pExitInfo->GCPtrEffAddr;
    1604216081    VBOXSTRICTRC rcStrict = iemVmxVmptrst(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo);
    16043     if (pVCpu->iem.s.cActiveMappings)
    16044         iemMemRollback(pVCpu);
    16045     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16082    Assert(!pVCpu->iem.s.cActiveMappings);
     16083    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1604616084}
    1604716085
     
    1606716105    RTGCPTR const GCPtrVmcs = pExitInfo->GCPtrEffAddr;
    1606816106    VBOXSTRICTRC rcStrict = iemVmxVmclear(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo);
    16069     if (pVCpu->iem.s.cActiveMappings)
    16070         iemMemRollback(pVCpu);
    16071     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16107    Assert(!pVCpu->iem.s.cActiveMappings);
     16108    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1607216109}
    1607316110
     
    1609016127    iemInitExec(pVCpu, false /*fBypassHandlers*/);
    1609116128    VBOXSTRICTRC rcStrict = iemVmxVmlaunchVmresume(pVCpu, cbInstr, uInstrId);
    16092     if (pVCpu->iem.s.cActiveMappings)
    16093         iemMemRollback(pVCpu);
    16094     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16129    Assert(!pVCpu->iem.s.cActiveMappings);
     16130    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1609516131}
    1609616132
     
    1611616152    RTGCPTR const GCPtrVmxon = pExitInfo->GCPtrEffAddr;
    1611716153    VBOXSTRICTRC rcStrict = iemVmxVmxon(pVCpu, cbInstr, iEffSeg, GCPtrVmxon, pExitInfo);
    16118     if (pVCpu->iem.s.cActiveMappings)
    16119         iemMemRollback(pVCpu);
    16120     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
     16154    Assert(!pVCpu->iem.s.cActiveMappings);
     16155    return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict);
    1612116156}
    1612216157
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r77094 r77610  
    38433843IEM_CIMPL_DEF_1(iemCImpl_iret, IEMMODE, enmEffOpSize)
    38443844{
    3845     bool const fBlockingNmi = VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
     3845    bool fBlockingNmi = VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
    38463846
    38473847#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    3848     /*
    3849      * Record whether NMIs (or virtual-NMIs) were unblocked by execution of this
    3850      * IRET instruction. We need to provide this information as part of some VM-exits.
    3851      *
    3852      * See Intel spec. 27.2.2 "Information for VM Exits Due to Vectored Events".
    3853      */
    38543848    if (IEM_VMX_IS_NON_ROOT_MODE(pVCpu))
    3855         pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret = fBlockingNmi;
     3849    {
     3850        /*
     3851         * Record whether NMI (or virtual-NMI) blocking is in effect during the execution
     3852         * of this IRET instruction. We need to provide this information as part of some
     3853         * VM-exits.
     3854         *
     3855         * See Intel spec. 27.2.2 "Information for VM Exits Due to Vectored Events".
     3856         */
     3857        if (IEM_VMX_IS_PINCTLS_SET(pVCpu, VMX_PIN_CTLS_VIRT_NMI))
     3858            pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret = pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking;
     3859        else
     3860            pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret = fBlockingNmi;
     3861
     3862        /*
     3863         * If "NMI exiting" is set, IRET does not affect blocking of NMIs.
     3864         * See Intel Spec. 25.3 "Changes To Instruction Behavior In VMX Non-root Operation".
     3865         */
     3866        if (IEM_VMX_IS_PINCTLS_SET(pVCpu, VMX_PIN_CTLS_NMI_EXIT))
     3867        {
     3868            fBlockingNmi = false;
     3869
     3870            /* Signal a pending NMI-window VM-exit before executing the next instruction. */
     3871            if (!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
     3872                VMCPU_FF_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW);
     3873        }
     3874
     3875        /* Clear virtual-NMI blocking, if any, before causing any further exceptions. */
     3876        pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking = false;
     3877    }
    38563878#endif
    38573879
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r77569 r77610  
    18061806    /** @todo NSTVMX: Does triple-fault VM-exit reflect a shutdown activity state or
    18071807     *        not? */
    1808     EMSTATE enmActivityState = EMGetState(pVCpu);
     1808    EMSTATE const enmActivityState = EMGetState(pVCpu);
    18091809    switch (enmActivityState)
    18101810    {
     
    18131813    }
    18141814
    1815     /* Interruptibility-state. */
     1815    /*
     1816     * Interruptibility-state.
     1817     */
     1818    /* NMI. */
    18161819    pVmcs->u32GuestIntrState = 0;
    1817     if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
    1818         pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI;
    1819 
     1820    if (pVmcs->u32PinCtls & VMX_PIN_CTLS_VIRT_NMI)
     1821    {
     1822        if (pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking)
     1823            pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI;
     1824    }
     1825    else
     1826    {
     1827        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
     1828            pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI;
     1829    }
     1830
     1831    /* Blocking-by-STI. */
    18201832    if (   VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
    18211833        && pVCpu->cpum.GstCtx.rip == EMGetInhibitInterruptsPC(pVCpu))
     
    18241836         *        currently. */
    18251837        pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_STI;
    1826         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
    18271838    }
    18281839    /* Nothing to do for SMI/enclave. We don't support enclaves or SMM yet. */
     
    28642875    }
    28652876
     2877    /*
     2878     * Clear any pending VMX nested-guest force-flags.
     2879     * These force-flags have no effect on guest execution and will
     2880     * be re-evaluated and setup on the next nested-guest VM-entry.
     2881     */
     2882    VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER
     2883                             | VMCPU_FF_VMX_MTF
     2884                             | VMCPU_FF_VMX_APIC_WRITE
     2885                             | VMCPU_FF_VMX_INT_WINDOW
     2886                             | VMCPU_FF_VMX_NMI_WINDOW);
     2887
    28662888    /* Restore the host (outer guest) state. */
    28672889    VBOXSTRICTRC rcStrict = iemVmxVmexitLoadHostState(pVCpu, uExitReason);
     
    30823104     * The MTF VM-exit can occur even when the MTF VM-execution control is
    30833105     * not set (e.g. when VM-entry injects an MTF pending event), so do not
    3084      * check for it here.
    3085      */
    3086 
    3087     /* Clear the force-flag indicating that monitor-trap flag is no longer active. */
    3088     VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_VMX_MTF);
    3089 
    3090     /* Cause the MTF VM-exit. The VM-exit qualification MBZ. */
     3106     * check for the intercept here.
     3107     */
    30913108    return iemVmxVmexit(pVCpu, VMX_EXIT_MTF);
    30923109}
     
    38173834                pVmcs->u32PreemptTimer = 0;
    38183835
    3819             /* Clear the force-flag indicating the VMX-preemption timer no longer active. */
    3820             VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER);
    3821 
    38223836            /* Cause the VMX-preemption timer VM-exit. The VM-exit qualification MBZ. */
    38233837            return iemVmxVmexit(pVCpu, VMX_EXIT_PREEMPT_TIMER);
     
    39343948{
    39353949    return iemVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
     3950}
     3951
     3952
     3953/**
     3954 * VMX VM-exit handler for NMI-window VM-exits.
     3955 *
     3956 * @returns VBox strict status code.
     3957 * @param   pVCpu           The cross context virtual CPU structure.
     3958 */
     3959IEM_STATIC VBOXSTRICTRC iemVmxVmexitNmiWindow(PVMCPU pVCpu)
     3960{
     3961    return iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
    39363962}
    39373963
     
    40184044        iemVmxVmcsSetIdtVectoringInfo(pVCpu, uIdtVectoringInfo);
    40194045        iemVmxVmcsSetIdtVectoringErrCode(pVCpu, uErrCode);
     4046
     4047        /*
     4048         * If the event is a virtual-NMI (which is an NMI being inject during VM-entry)
     4049         * virtual-NMI blocking must be set in effect rather than physical NMI blocking.
     4050         *
     4051         * See Intel spec. 24.6.1 "Pin-Based VM-Execution Controls".
     4052         */
     4053        if (   uVector == X86_XCPT_NMI
     4054            && (fFlags & IEM_XCPT_FLAGS_T_CPU_XCPT)
     4055            && (pVmcs->u32PinCtls & VMX_PIN_CTLS_VIRT_NMI))
     4056            pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking = true;
     4057        else
     4058            Assert(!pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking);
    40204059
    40214060        pVCpu->cpum.GstCtx.hwvirt.vmx.fInterceptEvents = true;
     
    70757114
    70767115    /* NMI blocking. */
    7077     if (   (pVmcs->u32GuestIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI)
    7078         && !VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
    7079         VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
     7116    if (pVmcs->u32GuestIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI)
     7117    {
     7118        if (pVmcs->u32PinCtls & VMX_PIN_CTLS_VIRT_NMI)
     7119            pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking = true;
     7120        else
     7121        {
     7122            pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking = false;
     7123            if (!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
     7124                VMCPU_FF_SET(pVCpu, VMCPU_FF_BLOCK_NMIS);
     7125        }
     7126    }
     7127    else
     7128        pVCpu->cpum.GstCtx.hwvirt.vmx.fVirtNmiBlocking = false;
    70807129
    70817130    /* SMI blocking is irrelevant. We don't support SMIs yet. */
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r77575 r77610  
    16971697    }
    16981698
    1699 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    1700         /*
    1701          * VMX Nested-guest APIC-write pending (can cause VM-exits).
    1702          * Takes priority over even SMI and INIT signals.
    1703          * See Intel spec. 29.4.3.2 "APIC-Write Emulation".
    1704          */
    1705         if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
    1706         {
    1707             rc = VBOXSTRICTRC_VAL(IEMExecVmxVmexitApicWrite(pVCpu));
    1708             Assert(rc != VINF_VMX_INTERCEPT_NOT_ACTIVE);
    1709         }
    1710 #endif
    1711 
    17121699#ifdef VBOX_WITH_RAW_MODE
    17131700    if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION))
     
    21522139#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    21532140        /*
     2141         * VMX Nested-guest APIC-write pending (can cause VM-exits).
     2142         * Takes priority over even SMI and INIT signals.
     2143         * See Intel spec. 29.4.3.2 "APIC-Write Emulation".
     2144         */
     2145        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
     2146        {
     2147            rc = VBOXSTRICTRC_VAL(IEMExecVmxVmexitApicWrite(pVCpu));
     2148            Assert(rc != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     2149        }
     2150
     2151        /*
    21542152         * VMX Nested-guest monitor-trap flag (MTF) VM-exit.
    21552153         * Takes priority over "Traps on the previous instruction".
     
    21652163        /*
    21662164         * VMX Nested-guest preemption timer VM-exit.
    2167          * Takes priority over non-maskable interrupts (NMIs).
     2165         * Takes priority over NMI-window VM-exits.
    21682166         */
    21692167        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER))
     
    21722170            if (rc2 == VINF_VMX_INTERCEPT_NOT_ACTIVE)
    21732171                rc2 = VINF_SUCCESS;
     2172            UPDATE_RC();
     2173        }
     2174
     2175        /*
     2176         * VMX NMI-window VM-exit.
     2177         * Takes priority over non-maskable interrupts (NMIs).
     2178         */
     2179        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
     2180        {
     2181            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitNmiWindow(pVCpu));
     2182            Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
    21742183            UPDATE_RC();
    21752184        }
     
    23972406        /* check that we got them all  */
    23982407        AssertCompile(VM_FF_HIGH_PRIORITY_PRE_MASK == (VM_FF_TM_VIRTUAL_SYNC | VM_FF_DBGF | VM_FF_CHECK_VM_STATE | VM_FF_DEBUG_SUSPEND | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY | VM_FF_EMT_RENDEZVOUS));
    2399         AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_INHIBIT_INTERRUPTS | VMCPU_FF_DBGF | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF | VM_WHEN_RAW_MODE(VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0)));
     2408        AssertCompile(VMCPU_FF_HIGH_PRIORITY_PRE_MASK == (VMCPU_FF_TIMER | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_INHIBIT_INTERRUPTS | VMCPU_FF_DBGF | VMCPU_FF_INTERRUPT_NESTED_GUEST | VMCPU_FF_VMX_MTF | VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_VMX_PREEMPT_TIMER | VMCPU_FF_VMX_INT_WINDOW | VMCPU_FF_VMX_NMI_WINDOW | VM_WHEN_RAW_MODE(VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT, 0)));
    24002409    }
    24012410
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