VirtualBox

Changeset 107862 in vbox for trunk


Ignore:
Timestamp:
Jan 20, 2025 8:15:00 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167064
Message:

VMM/NEM-win: Export & import IA32_SPEC_CTRL state. jiraref:VBP-947 bugref:10738

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h

    r107113 r107862  
    347347            ADD_REG64(WHvX64RegisterMsrMtrrFix4kF0000,  pCtxMsrs->msr.MtrrFix4K_F0000);
    348348            ADD_REG64(WHvX64RegisterMsrMtrrFix4kF8000,  pCtxMsrs->msr.MtrrFix4K_F8000);
     349            if (pVM->nem.s.fSpeculationControl)
     350                ADD_REG64(WHvX64RegisterSpecCtrl, pCtxMsrs->msr.SpecCtrl);
     351
    349352#if 0 /** @todo these registers aren't available? Might explain something.. .*/
    350353            const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pVM);
     
    618621        aenmNames[iReg++] = WHvX64RegisterMsrMtrrFix4kF0000;
    619622        aenmNames[iReg++] = WHvX64RegisterMsrMtrrFix4kF8000;
     623        if (pVM->nem.s.fSpeculationControl)
     624            aenmNames[iReg++] = WHvX64RegisterSpecCtrl;
    620625        /** @todo look for HvX64RegisterIa32MiscEnable and HvX64RegisterIa32FeatureControl? */
    621626//#ifdef LOG_ENABLED
     
    976981            GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_F0000,  WHvX64RegisterMsrMtrrFix4kF0000,  "MSR MTRR_FIX_4K_F0000");
    977982            GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_F8000,  WHvX64RegisterMsrMtrrFix4kF8000,  "MSR MTRR_FIX_4K_F8000");
     983            if (pVM->nem.s.fSpeculationControl)
     984                GET_REG64_LOG7(pCtxMsrs->msr.SpecCtrl,     WHvX64RegisterSpecCtrl,           "MSR IA32_SPEC_CTRL");
    978985            /** @todo look for HvX64RegisterIa32MiscEnable and HvX64RegisterIa32FeatureControl? */
    979986        }
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r107194 r107862  
    653653                             "WHvGetCapability/WHvCapabilityCodeFeatures failed: %Rhrc (Last=%#x/%u)",
    654654                             hrc, RTNtLastStatusValue(), RTNtLastErrorValue());
    655     if (Caps.Features.AsUINT64 & ~(uint64_t)0)
    656         LogRel(("NEM: Warning! Unknown feature definitions: %#RX64\n", Caps.Features.AsUINT64));
     655    NEM_LOG_REL_CAP_EX("WHvCapabilityCodeFeatures", "%'#018RX64", Caps.Features.AsUINT64);
     656    pVM->nem.s.fSpeculationControl = RT_BOOL(Caps.Features.SpeculationControl);
     657    const uint64_t fKnownFeatures = RT_BIT_64(10) - 1U;
     658    if (Caps.Features.AsUINT64 & ~fKnownFeatures)
     659        LogRel(("NEM: Warning! Unknown feature definitions: %#RX64\n", Caps.Features.AsUINT64 & ~fKnownFeatures));
    657660    /** @todo RECHECK: WHV_CAPABILITY_FEATURES typedef. */
    658661
  • trunk/src/VBox/VMM/include/NEMInternal.h

    r107802 r107862  
    263263    /** WHvRunVpExitReasonException is supported. */
    264264    bool                        fExtendedXcptExit : 1;
     265    /** Copy of WHV_CAPABILITY_FEATURES::SpeculationControl. */
     266    bool                        fSpeculationControl : 1;
    265267#  ifdef NEM_WIN_WITH_A20
    266268    /** Set if we've started more than one CPU and cannot mess with A20. */
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