VirtualBox

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


Ignore:
Timestamp:
Aug 5, 2014 2:13:40 PM (10 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Renaming nits.

File:
1 edited

Legend:

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

    r52192 r52279  
    14391439     * Note: If you're adding MSRs here, make sure to update the MSR-bitmap permissions in hmR0VmxSetupProcCtls().
    14401440     */
    1441     if (!(pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_LOADED_GUEST))
     1441    if (!(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST))
    14421442    {
    14431443        pVCpu->hm.s.vmx.u64HostLStarMsr        = ASMRdMsr(MSR_K8_LSTAR);
     
    14451445        pVCpu->hm.s.vmx.u64HostSFMaskMsr       = ASMRdMsr(MSR_K8_SF_MASK);
    14461446        pVCpu->hm.s.vmx.u64HostKernelGSBaseMsr = ASMRdMsr(MSR_K8_KERNEL_GS_BASE);
    1447         pVCpu->hm.s.vmx.fRestoreHostMsrs |= VMX_RESTORE_HOST_MSR_SAVED_HOST;
     1447        pVCpu->hm.s.vmx.fLazyMsrs |= VMX_LAZY_MSRS_SAVED_HOST;
    14481448    }
    14491449}
     
    14741474
    14751475/**
    1476  * Saves a set of guests MSRs back into the guest-CPU context.
     1476 * Saves a set of guest MSRs back into the guest-CPU context.
    14771477 *
    14781478 * @param   pVCpu       Pointer to the VMCPU.
     
    14881488    Assert(!VMMRZCallRing3IsEnabled(pVCpu));
    14891489
    1490     if (pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_LOADED_GUEST)
    1491     {
    1492         Assert(pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_SAVED_HOST);
     1490    if (pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST)
     1491    {
     1492        Assert(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST);
    14931493        pMixedCtx->msrLSTAR        = ASMRdMsr(MSR_K8_LSTAR);
    14941494        pMixedCtx->msrSTAR         = ASMRdMsr(MSR_K6_STAR);
     
    15191519    Assert(!VMMRZCallRing3IsEnabled(pVCpu));
    15201520
    1521     Assert(pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_SAVED_HOST);
    1522     if (!(pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_LOADED_GUEST))
    1523     {
    15241521#define VMXLOCAL_LAZY_LOAD_GUEST_MSR(uMsr, a_GuestMsr, a_HostMsr) \
    15251522    do { \
     
    15301527    } while (0)
    15311528
     1529    Assert(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST);
     1530    if (!(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST))
     1531    {
    15321532        VMXLOCAL_LAZY_LOAD_GUEST_MSR(MSR_K8_LSTAR, LSTAR, LStar);
    15331533        VMXLOCAL_LAZY_LOAD_GUEST_MSR(MSR_K6_STAR, STAR, Star);
    15341534        VMXLOCAL_LAZY_LOAD_GUEST_MSR(MSR_K8_SF_MASK, SFMASK, SFMask);
    15351535        VMXLOCAL_LAZY_LOAD_GUEST_MSR(MSR_K8_KERNEL_GS_BASE, KERNELGSBASE, KernelGSBase);
    1536 #undef VMXLOCAL_LAZY_LOAD_GUEST_MSR
     1536        pVCpu->hm.s.vmx.fLazyMsrs |= VMX_LAZY_MSRS_LOADED_GUEST;
    15371537    }
    15381538    else
     
    15431543        ASMWrMsr(MSR_K8_KERNEL_GS_BASE, pMixedCtx->msrKERNELGSBASE);
    15441544    }
    1545     pVCpu->hm.s.vmx.fRestoreHostMsrs |= VMX_RESTORE_HOST_MSR_LOADED_GUEST;
     1545
     1546#undef VMXLOCAL_LAZY_LOAD_GUEST_MSR
    15461547}
    15471548
     
    15621563    Assert(!VMMRZCallRing3IsEnabled(pVCpu));
    15631564
    1564     if (pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_LOADED_GUEST)
    1565     {
    1566         Assert(pVCpu->hm.s.vmx.fRestoreHostMsrs & VMX_RESTORE_HOST_MSR_SAVED_HOST);
     1565    if (pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST)
     1566    {
     1567        Assert(pVCpu->hm.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST);
    15671568        ASMWrMsr(MSR_K8_LSTAR,          pVCpu->hm.s.vmx.u64HostLStarMsr);
    15681569        ASMWrMsr(MSR_K6_STAR,           pVCpu->hm.s.vmx.u64HostStarMsr);
     
    15701571        ASMWrMsr(MSR_K8_KERNEL_GS_BASE, pVCpu->hm.s.vmx.u64HostKernelGSBaseMsr);
    15711572    }
    1572     pVCpu->hm.s.vmx.fRestoreHostMsrs &= ~(VMX_RESTORE_HOST_MSR_LOADED_GUEST | VMX_RESTORE_HOST_MSR_SAVED_HOST);
     1573    pVCpu->hm.s.vmx.fLazyMsrs &= ~(VMX_LAZY_MSRS_LOADED_GUEST | VMX_LAZY_MSRS_SAVED_HOST);
    15731574}
    15741575#endif  /* HC_ARCH_BITS == 64 */
     
    70297030
    70307031#if HC_ARCH_BITS == 64
    7031     /* Restore the host MSRs as we're leaving VT-x context. */
     7032    /* Restore the lazy host MSRs as we're leaving VT-x context. */
    70327033    if (   pVM->hm.s.fAllow64BitGuests
    7033         && pVCpu->hm.s.vmx.fRestoreHostMsrs)
     7034        && pVCpu->hm.s.vmx.fLazyMsrs)
    70347035    {
    70357036        /* We shouldn't reload the guest MSRs without saving it first. */
     
    70417042        Assert(HMVMXCPU_GST_IS_UPDATED(pVCpu, HMVMX_UPDATED_GUEST_LAZY_MSRS));
    70427043        hmR0VmxLazyRestoreHostMsrs(pVCpu);
    7043         Assert(!pVCpu->hm.s.vmx.fRestoreHostMsrs);
     7044        Assert(!pVCpu->hm.s.vmx.fLazyMsrs);
    70447045    }
    70457046#endif
     
    72627263        pVCpu->hm.s.vmx.fRestoreHostFlags = 0;
    72637264
    7264         /* Restore the host MSRs as we're leaving VT-x context. */
     7265        /* Restore the lazy host MSRs as we're leaving VT-x context. */
    72657266        if (   pVM->hm.s.fAllow64BitGuests
    7266             && pVCpu->hm.s.vmx.fRestoreHostMsrs)
     7267            && pVCpu->hm.s.vmx.fLazyMsrs)
    72677268        {
    72687269            hmR0VmxLazyRestoreHostMsrs(pVCpu);
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