VirtualBox

Changeset 87497 in vbox


Ignore:
Timestamp:
Feb 1, 2021 11:39:30 AM (4 years ago)
Author:
vboxsync
Message:

VMM/HMR3ResetCpu: Only touch the vmx fields if we're in vmx mode.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r87488 r87497  
    790790     * extra careful if/when the guest switches back to protected mode.
    791791     */
    792     if (enmGuestMode == PGMMODE_REAL)
     792    if (   enmGuestMode == PGMMODE_REAL
     793        && pVM->hm.s.vmx.fEnabled)
    793794    {
    794795        PVMXVMCSINFOSHARED pVmcsInfoShared = hmGetVmxActiveVmcsInfoShared(pVCpu);
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r87493 r87497  
    20472047    pVCpu->hm.s.fActive                        = false;
    20482048    pVCpu->hm.s.Event.fPending                 = false;
    2049     pVCpu->hm.s.vmx.u64GstMsrApicBase          = 0;
    2050     pVCpu->hm.s.vmx.VmcsInfo.fSwitchedTo64on32Obsolete = false;
    2051     pVCpu->hm.s.vmx.VmcsInfo.fWasInRealMode    = true;
     2049    PVM pVM = pVCpu->CTX_SUFF(pVM);
     2050    if (pVM->hm.s.vmx.fEnabled)
     2051    {
     2052        pVCpu->hm.s.vmx.u64GstMsrApicBase          = 0;
     2053        pVCpu->hm.s.vmx.VmcsInfo.fSwitchedTo64on32Obsolete = false;
     2054        pVCpu->hm.s.vmx.VmcsInfo.fWasInRealMode    = true;
    20522055#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    2053     if (pVCpu->CTX_SUFF(pVM)->cpum.ro.GuestFeatures.fVmx)
    2054     {
    2055         pVCpu->hm.s.vmx.VmcsInfoNstGst.fSwitchedTo64on32Obsolete = false;
    2056         pVCpu->hm.s.vmx.VmcsInfoNstGst.fWasInRealMode    = true;
    2057     }
     2056        if (pVCpu->CTX_SUFF(pVM)->cpum.ro.GuestFeatures.fVmx)
     2057        {
     2058            pVCpu->hm.s.vmx.VmcsInfoNstGst.fSwitchedTo64on32Obsolete = false;
     2059            pVCpu->hm.s.vmx.VmcsInfoNstGst.fWasInRealMode    = true;
     2060        }
    20582061#endif
     2062    }
    20592063}
    20602064
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