VirtualBox

Changeset 47802 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 16, 2013 11:27:27 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
88063
Message:

VMM/HM: Redundant updates of flags is not necessary.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
3 edited

Legend:

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

    r47773 r47802  
    14081408    AssertPtr(pCpu);
    14091409
    1410     pVCpu->hm.s.idEnteredCpu = idCpu;
    1411 
    1412     /* Reload the host context and the guest's CR0 register for the FPU bits. */
    1413     pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0 | HM_CHANGED_HOST_CONTEXT;
    1414 
    14151410    /* Enable VT-x or AMD-V if local init is required, or enable if it's a freshly onlined CPU. */
    14161411    if (   !pCpu->fConfigured
     
    14191414        hmR0EnableCpu(pVCpu->CTX_SUFF(pVM), idCpu);
    14201415    }
     1416
     1417    /* Reload host-context (back from ring-3/migrated CPUs), reload guest CR0 (for FPU bits). */
     1418    pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT | HM_CHANGED_GUEST_CR0;
     1419    pVCpu->hm.s.idEnteredCpu = idCpu;
    14211420}
    14221421
     
    14511450    Assert(pCpu);
    14521451    Assert(pCtx);
     1452    Assert(pVCpu->hm.s.fContextUseFlags & (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_GUEST_CR0));
    14531453
    14541454    int rc  = g_HvmR0.pfnEnterSession(pVM, pVCpu, pCpu);
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r47771 r47802  
    16181618               initializing AMD-V if necessary (onlined CPUs, local init etc.) */
    16191619            HMR0EnterEx(pVCpu);
    1620 
    1621             pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT;
     1620            Assert(pVCpu->hm.s.fContextUseFlags & (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_GUEST_CR0));
    16221621
    16231622            RTThreadPreemptRestore(&PreemptState);
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r47776 r47802  
    68446844               initializing VT-x if necessary (onlined CPUs, local init etc.) */
    68456845            HMR0EnterEx(pVCpu);
     6846            Assert(pVCpu->hm.s.fContextUseFlags & (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_GUEST_CR0));
    68466847
    68476848            /* Load the active VMCS as the current one. */
     
    68516852            pVCpu->hm.s.fResumeVM  = false;
    68526853            pVCpu->hm.s.fLeaveDone = false;
    6853             pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_HOST_CONTEXT;
    68546854
    68556855            /* Restore preemption, migrating to another CPU should be fine now. */
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