VirtualBox

Changeset 76003 in vbox for trunk/src


Ignore:
Timestamp:
Dec 6, 2018 8:48:17 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Make sure to perform MTF, VMX-preemption timer (or APIC-write emulation) at the end of the instruction boundary before we proceed to execute the next instruction.

File:
1 edited

Legend:

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

    r75957 r76003  
    1399913999//#endif
    1400014000
     14001#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     14002    /*
     14003     * Perform any VMX nested-guest instruction boundary actions.
     14004     *
     14005     * If any of these causes a VM-exit, we must skip executing the next
     14006     * instruction (so we set fExecuteInhibit to false).
     14007     */
     14008    if (CPUMIsGuestInVmxNonRootMode(IEM_GET_CTX(pVCpu)))
     14009    {
     14010        /* TPR-below threshold/APIC write has the highest priority. */
     14011        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
     14012        {
     14013            rcStrict = iemVmxApicWriteEmulation(pVCpu);
     14014            if (rcStrict != VINF_SUCCESS)
     14015                fExecuteInhibit = false;
     14016            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE));
     14017        }
     14018        /* MTF takes priority over VMX-preemption timer. */
     14019        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
     14020        {
     14021            rcStrict = iemVmxVmexitMtf(pVCpu);
     14022            fExecuteInhibit = false;
     14023            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF));
     14024        }
     14025        /** Finally, check if the VMX preemption timer has expired. */
     14026        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER))
     14027        {
     14028            rcStrict = iemVmxVmexitPreemptTimer(pVCpu);
     14029            if (rcStrict == VINF_VMX_INTERCEPT_NOT_ACTIVE)
     14030                rcStrict = VINF_SUCCESS;
     14031            else
     14032            {
     14033                Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_PREEMPT_TIMER));
     14034                fExecuteInhibit = false;
     14035            }
     14036        }
     14037    }
     14038#endif
     14039
    1400114040    /* Execute the next instruction as well if a cli, pop ss or
    1400214041       mov ss, Gr has just completed successfully. */
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