VirtualBox

Changeset 78370 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 3, 2019 4:42:22 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Check cached EFER with the CPU EFER value in hmR0VmxCheckAutoLoadStoreMsrs. Comments.

File:
1 edited

Legend:

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

    r78349 r78370  
    21952195                             pHostMsrLoad->u32Msr, pHostMsrLoad->u64Value, u64Msr, cMsrs));
    21962196
     2197        /* Verify that cached host EFER MSR matches what's loaded the CPU. */
     2198        bool const fIsEferMsr = RT_BOOL(pHostMsrLoad->u32Msr == MSR_K6_EFER);
     2199        if (fIsEferMsr)
     2200        {
     2201            AssertMsgReturnVoid(u64Msr == pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer,
     2202                                ("Cached=%#RX64 ASMRdMsr=%#RX64 cMsrs=%u\n",
     2203                                 pVCpu->CTX_SUFF(pVM)->hm.s.vmx.u64HostMsrEfer, u64Msr, cMsrs));
     2204        }
     2205
    21972206        /* Verify that the accesses are as expected in the MSR bitmap for auto-load/store MSRs. */
    21982207        if (pVmcsInfo->u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS)
    21992208        {
    22002209            uint32_t const fMsrpm = HMGetVmxMsrPermission(pVmcsInfo->pvMsrBitmap, pGuestMsrLoad->u32Msr);
    2201             if (pGuestMsrLoad->u32Msr == MSR_K6_EFER)
     2210            if (fIsEferMsr)
    22022211            {
    22032212                AssertMsgReturnVoid((fMsrpm & VMXMSRPM_EXIT_RD), ("Passthru read for EFER MSR!?\n"));
     
    73337342     *
    73347343     *       Committing this temporarily as it prevents BSOD.
     7344     *
     7345     * Update: This is very likely a compiler optimization bug, see @bugref{9180}.
    73357346     */
    73367347#ifdef RT_OS_WINDOWS
     
    1056010571            hmR0VmxImportGuestState(pVCpu, pVmcsInfo, CPUMCTX_EXTRN_TSC_AUX);
    1056110572            /* NB: Because we call hmR0VmxAddAutoLoadStoreMsr with fUpdateHostMsr=true,
    10562              * it's safe even after hmR0VmxUpdateAutoLoadHostMsrs has already been done.
    10563              */
     10573               it's safe even after hmR0VmxUpdateAutoLoadHostMsrs has already been done. */
    1056410574            int rc = hmR0VmxAddAutoLoadStoreMsr(pVCpu, pVmxTransient, MSR_K8_TSC_AUX, CPUMGetGuestTscAux(pVCpu),
    1056510575                                                true /* fSetReadWrite */, true /* fUpdateHostMsr */);
     
    1057110581
    1057210582#ifdef VBOX_STRICT
     10583    Assert(pVCpu->hm.s.vmx.fUpdatedHostAutoMsrs);
    1057310584    hmR0VmxCheckAutoLoadStoreMsrs(pVCpu, pVmcsInfo);
    1057410585    hmR0VmxCheckHostEferMsr(pVCpu, pVmcsInfo);
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