VirtualBox

Changeset 87552 in vbox


Ignore:
Timestamp:
Feb 3, 2021 10:41:38 AM (4 years ago)
Author:
vboxsync
Message:

VMM/HMVMX: Use g_uHmVmxHostMsrEfer instead of pVM->hm.s.vmx.u64HostMsrEfer in ring-0. bugref:9217

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

Legend:

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

    r87551 r87552  
    24722472         */
    24732473        if (pHostMsrLoad[i].u32Msr == MSR_K6_EFER)
    2474             pHostMsrLoad[i].u64Value = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer;
     2474            pHostMsrLoad[i].u64Value = g_uHmVmxHostMsrEfer;
    24752475        else
    24762476            pHostMsrLoad[i].u64Value = ASMRdMsr(pHostMsrLoad[i].u32Msr);
     
    27102710    {
    27112711        uint64_t const uHostEferMsr      = ASMRdMsr(MSR_K6_EFER);
    2712         uint64_t const uHostEferMsrCache = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer;
     2712        uint64_t const uHostEferMsrCache = g_uHmVmxHostMsrEfer;
    27132713        uint64_t       uVmcsEferMsrVmcs;
    27142714        int rc = VMXReadVmcs64(VMX_VMCS64_HOST_EFER_FULL, &uVmcsEferMsrVmcs);
     
    27782778                             pHostMsrLoad->u32Msr, pHostMsrLoad->u64Value, u64HostMsr, cMsrs));
    27792779
    2780         /* Verify that cached host EFER MSR matches what's loaded the CPU. */
     2780        /* Verify that cached host EFER MSR matches what's loaded on the CPU. */
    27812781        bool const fIsEferMsr = RT_BOOL(pHostMsrLoad->u32Msr == MSR_K6_EFER);
    2782         if (fIsEferMsr)
    2783         {
    2784             AssertMsgReturnVoid(u64HostMsr == pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer,
    2785                                 ("Cached=%#RX64 ASMRdMsr=%#RX64 cMsrs=%u\n",
    2786                                  pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer, u64HostMsr, cMsrs));
    2787         }
     2782        AssertMsgReturnVoid(!fIsEferMsr || u64HostMsr == g_uHmVmxHostMsrEfer,
     2783                            ("Cached=%#RX64 ASMRdMsr=%#RX64 cMsrs=%u\n", g_uHmVmxHostMsrEfer, u64HostMsr, cMsrs));
    27882784
    27892785        /* Verify that the accesses are as expected in the MSR bitmap for auto-load/store MSRs. */
     
    48854881    if (pVM->hm.s.vmx.fSupportsVmcsEfer)
    48864882    {
    4887         rc = VMXWriteVmcs64(VMX_VMCS64_HOST_EFER_FULL, pVM->hm.s.vmx.u64HostMsrEfer);
     4883        rc = VMXWriteVmcs64(VMX_VMCS64_HOST_EFER_FULL, g_uHmVmxHostMsrEfer);
    48884884        AssertRC(rc);
    48894885    }
     
    49154911    PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx;
    49164912    PVMCC pVM = pVCpu->CTX_SUFF(pVM);
    4917     uint64_t const u64HostEfer  = pVM->hm.s.vmx.u64HostMsrEfer;
     4913    uint64_t const u64HostEfer  = g_uHmVmxHostMsrEfer;
    49184914    uint64_t const u64GuestEfer = pCtx->msrEFER;
    49194915
  • trunk/src/VBox/VMM/include/HMInternal.h

    r87550 r87552  
    511511        uint32_t                    cPleWindowTicks;
    512512
    513         /** Host CR4 value (set by ring-0 VMX init) */
     513        /** Host CR4 value (set by ring-0 VMX init, for logging). */
    514514        uint64_t                    u64HostCr4;
    515         /** Host SMM monitor control (set by ring-0 VMX init) */
     515        /** Host SMM monitor control (set by ring-0 VMX init, for logging). */
    516516        uint64_t                    u64HostSmmMonitorCtl;
    517         /** Host EFER value (set by ring-0 VMX init) */
     517        /** Host EFER value (set by ring-0 VMX init, for logging and guest NX). */
    518518        uint64_t                    u64HostMsrEfer;
    519519        /** Whether the CPU supports VMCS fields for swapping EFER. */
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