VirtualBox

Changeset 107931 in vbox for trunk


Ignore:
Timestamp:
Jan 24, 2025 10:00:36 AM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167166
Message:

VMM/NEM-win: Only export & import IA32_SPEC_CTRL if the host supports it and we're exposing the register to the guest. (AMD regression from r167064.) 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

    r107862 r107931  
    347347            ADD_REG64(WHvX64RegisterMsrMtrrFix4kF0000,  pCtxMsrs->msr.MtrrFix4K_F0000);
    348348            ADD_REG64(WHvX64RegisterMsrMtrrFix4kF8000,  pCtxMsrs->msr.MtrrFix4K_F8000);
    349             if (pVM->nem.s.fSpeculationControl)
     349            if (pVM->nem.s.fDoIa32SpecCtrl)
    350350                ADD_REG64(WHvX64RegisterSpecCtrl, pCtxMsrs->msr.SpecCtrl);
    351351
     
    621621        aenmNames[iReg++] = WHvX64RegisterMsrMtrrFix4kF0000;
    622622        aenmNames[iReg++] = WHvX64RegisterMsrMtrrFix4kF8000;
    623         if (pVM->nem.s.fSpeculationControl)
     623        if (pVM->nem.s.fDoIa32SpecCtrl)
    624624            aenmNames[iReg++] = WHvX64RegisterSpecCtrl;
    625625        /** @todo look for HvX64RegisterIa32MiscEnable and HvX64RegisterIa32FeatureControl? */
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r107863 r107931  
    15391539    AssertReturn(!pVM->nem.s.fCreatedEmts, VERR_WRONG_ORDER);
    15401540    AssertReturn(pVM->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API, VERR_WRONG_ORDER);
     1541
     1542    /*
     1543     * Determine whether we can and should export/import IA32_SPEC_CTRL.
     1544     */
     1545    pVM->nem.s.fDoIa32SpecCtrl = pVM->nem.s.fSpeculationControl
     1546                              && g_CpumHostFeatures.s.fSpecCtrlMsr
     1547                              && pVM->cpum.ro.GuestFeatures.fSpecCtrlMsr;
    15411548
    15421549    /*
  • trunk/src/VBox/VMM/include/NEMInternal.h

    r107862 r107931  
    265265    /** Copy of WHV_CAPABILITY_FEATURES::SpeculationControl. */
    266266    bool                        fSpeculationControl : 1;
     267    /** Whether to export/import IA32_SPEC_CTRL. */
     268    bool                        fDoIa32SpecCtrl : 1;
    267269#  ifdef NEM_WIN_WITH_A20
    268270    /** 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