VirtualBox

Changeset 68532 in vbox for trunk


Ignore:
Timestamp:
Aug 25, 2017 3:34:32 PM (7 years ago)
Author:
vboxsync
Message:

CPUM: Use a valid value for initializing PkgCStateCfgCtrl on Core 2 CPUs.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r68226 r68532  
    125125
    126126    kCpumMicroarch_Intel_Core2_First,
    127     kCpumMicroarch_Intel_Core2_Merom = kCpumMicroarch_Intel_Core2_First,
    128     kCpumMicroarch_Intel_Core2_Penryn,
     127    kCpumMicroarch_Intel_Core2_Merom = kCpumMicroarch_Intel_Core2_First,    /**< 65nm, Merom/Conroe/Kentsfield/Tigerton */
     128    kCpumMicroarch_Intel_Core2_Penryn,      /**< 45nm, Penryn/Wolfdale/Yorkfield/Harpertown */
     129    kCpumMicroarch_Intel_Core2_End,
    129130
    130131    kCpumMicroarch_Intel_Core7_First,
     
    257258#define CPUMMICROARCH_IS_INTEL_CORE7(a_enmMicroarch) \
    258259    ((a_enmMicroarch) >= kCpumMicroarch_Intel_Core7_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core7_End)
     260
     261/** Predicate macro for catching Core 2 CPUs. */
     262#define CPUMMICROARCH_IS_INTEL_CORE2(a_enmMicroarch) \
     263    ((a_enmMicroarch) >= kCpumMicroarch_Intel_Core2_First && (a_enmMicroarch) <= kCpumMicroarch_Intel_Core2_End)
    259264
    260265/** Predicate macro for catching Atom CPUs, Silvermont and upwards. */
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r68403 r68532  
    12701270    /* C-state control. Guesses. */
    12711271    pVCpu->cpum.s.GuestMsrs.msr.PkgCStateCfgCtrl = 1 /*C1*/ | RT_BIT_32(25) | RT_BIT_32(26) | RT_BIT_32(27) | RT_BIT_32(28);
     1272    /* For Nehalem+ and Atoms, the 0xE2 MSR (MSR_PKG_CST_CONFIG_CONTROL) is documented. For Core 2,
     1273     * it's undocumented but exists as MSR_PMG_CST_CONFIG_CONTROL and has similar but not identical
     1274     * functionality. The default value must be different due to incompatible write mask.
     1275     */
     1276    if (CPUMMICROARCH_IS_INTEL_CORE2(pVM->cpum.s.GuestFeatures.enmMicroarch))
     1277        pVCpu->cpum.s.GuestMsrs.msr.PkgCStateCfgCtrl = 0x202a01;    /* From Mac Pro Harpertown, unlocked. */
    12721278
    12731279    /*
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r67836 r68532  
    529529        case kCpumMicroarch_Invalid:
    530530        case kCpumMicroarch_Intel_End:
     531        case kCpumMicroarch_Intel_Core2_End:
    531532        case kCpumMicroarch_Intel_Core7_End:
    532533        case kCpumMicroarch_Intel_Atom_End:
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