VirtualBox

Changeset 61753 in vbox


Ignore:
Timestamp:
Jun 17, 2016 3:35:46 PM (9 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Fix host-state re-saving as a result of recent FPU changes requesting host-state re-saving.
Fix assertion with lazy saving host MSRs (to ensure guest MSRs aren't loaded at that point).

File:
1 edited

Legend:

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

    r61743 r61753  
    14731473     * Note: If you're adding MSRs here, make sure to update the MSR-bitmap permissions in hmR0VmxSetupProcCtls().
    14741474     */
    1475     Assert(!(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST));
    14761475    if (!(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST))
    14771476    {
     1477        Assert(!(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST));  /* Guest MSRs better not be loaded now. */
    14781478#if HC_ARCH_BITS == 64
    14791479        if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     
    29092909     * If we've executed guest code using VT-x, the host-state bits will be messed up. We
    29102910     * should -not- save the messed up state without restoring the original host-state. See @bugref{7240}.
     2911     *
     2912     * This apparently can happen (most likely the FPU changes), deal with it rather than asserting.
    29112913     */
    2912     AssertMsgReturn(!(pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_REQUIRED),
    2913                     ("Re-saving host-state after executing guest code without leaving VT-x!\n"), VERR_WRONG_ORDER);
     2914    if (   (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_REQUIRED)
     2915        && (pVCpu->hm.s.vmx.fRestoreHostFlags & ~VMX_RESTORE_HOST_REQUIRED))
     2916    {
     2917        Log4Func(("Restoring Host State: fRestoreHostFlags=%#RX32 HostCpuId=%u\n", pVCpu->hm.s.vmx.fRestoreHostFlags,
     2918                  pVCpu->idCpu));
     2919        VMXRestoreHostState(pVCpu->hm.s.vmx.fRestoreHostFlags, &pVCpu->hm.s.vmx.RestoreHost);
     2920    }
     2921    pVCpu->hm.s.vmx.fRestoreHostFlags = 0;
    29142922#endif
    29152923
     
    29282936    RTSEL uSelGS = 0;
    29292937#endif
    2930 
    2931     /* Recalculate which host-state bits need to be manually restored. */
    2932     pVCpu->hm.s.vmx.fRestoreHostFlags = 0;
    29332938
    29342939    /*
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