VirtualBox

Changeset 83485 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Mar 30, 2020 2:37:45 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136728
Message:

SVM: Emulate intercepted IRET to avoid injecting a pending NMI too early (see bugref:6208).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r83477 r83485  
    70607060    HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pSvmTransient);
    70617061
    7062     /* Clear NMI blocking. */
    7063     if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_BLOCK_NMIS))
    7064         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
    7065 
    7066     /* Indicate that we no longer need to #VMEXIT when the guest is ready to receive NMIs, it is now ready. */
     7062    /* Indicate that we no longer need to #VMEXIT when the guest is ready to receive NMIs, it is now (almost) ready. */
    70677063    PSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu);
    70687064    hmR0SvmClearCtrlIntercept(pVCpu, pVmcb, SVM_CTRL_INTERCEPT_IRET);
    70697065
    7070     /* Deliver the pending NMI via hmR0SvmEvaluatePendingEvent() and resume guest execution. */
    7071     return VINF_SUCCESS;
     7066    /* Emulate the IRET. We have to execute the IRET before an NMI, but must potentially
     7067     * deliver a pending NMI right after. If the IRET faults, an NMI can come before the
     7068     * handler executes. Yes, x86 is ugly.
     7069     */
     7070    return VINF_EM_RAW_EMULATE_INSTR;
    70727071}
    70737072
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette