VirtualBox

Changeset 54749 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 13, 2015 4:40:01 PM (10 years ago)
Author:
vboxsync
Message:

CPUM: Increase the max cpuid leaves a lot. Fixed incorrect sanitizing of leaf 4.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r54737 r54749  
    726726    if (!fHWVirtExEnabled)
    727727    {
    728         Assert(   pVM->cpum.s.aGuestCpuIdPatmStd[4].uEax == 0
     728        Assert(   (pVM->cpum.s.aGuestCpuIdPatmStd[4].uEax & UINT32_C(0x0000ffff)) == 0
    729729               || pVM->cpum.s.aGuestCpuIdPatmStd[0].uEax < 0x4);
    730         pVM->cpum.s.aGuestCpuIdPatmStd[4].uEax = 0;
     730        pVM->cpum.s.aGuestCpuIdPatmStd[4].uEax &= UINT32_C(0x0000ffff);
    731731    }
    732732}
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r54740 r54749  
    25252525    while ((pCurLeaf = cpumR3CpuIdGetExactLeaf(pCpum, 4, uSubLeaf)) != NULL)
    25262526    {
    2527         pCurLeaf->uEax &= UINT32_C(0xffffc000); /* Clear the #maxcores, #threads-sharing-cache (both are #-1).*/
     2527        pCurLeaf->uEax &= UINT32_C(0x00003fff); /* Clear the #maxcores, #threads-sharing-cache (both are #-1).*/
    25282528#ifdef VBOX_WITH_MULTI_CORE
    25292529        if (   pVM->cCpus > 1
     
    31693169    AssertLogRelRCReturn(rc, rc);
    31703170
    3171     /** @cfgm{/CPUM/MaxStdLeaf, uint32_t, 0x00000005}
     3171    /** @cfgm{/CPUM/MaxStdLeaf, uint32_t, 0x00000016}
    31723172     * The last standard leaf to keep.  The actual last value that is stored in EAX
    31733173     * is RT_MAX(CPUID[0].EAX,/CPUM/MaxStdLeaf).  Leaves beyond the max leaf are
    31743174     * removed.  (This works independently of and differently from NT4LeafLimit.)
    3175      */
    3176     rc = CFGMR3QueryU32Def(pCpumCfg, "MaxStdLeaf", &pConfig->uMaxStdLeaf, UINT32_C(0x00000005));
     3175     * The default is usually set to what we're able to reasonably sanitize.
     3176     */
     3177    rc = CFGMR3QueryU32Def(pCpumCfg, "MaxStdLeaf", &pConfig->uMaxStdLeaf, UINT32_C(0x00000016));
    31773178    AssertLogRelRCReturn(rc, rc);
    31783179
    3179     /** @cfgm{/CPUM/MaxExtLeaf, uint32_t, 0x80000008}
     3180    /** @cfgm{/CPUM/MaxExtLeaf, uint32_t, 0x8000001e}
    31803181     * The last extended leaf to keep.  The actual last value that is stored in EAX
    31813182     * is RT_MAX(CPUID[0x80000000].EAX,/CPUM/MaxStdLeaf).  Leaves beyond the max
    3182      * leaf are removed.
    3183      */
    3184     rc = CFGMR3QueryU32Def(pCpumCfg, "MaxExtLeaf", &pConfig->uMaxExtLeaf, UINT32_C(0x80000008));
     3183     * leaf are removed.  The default is set to what we're able to sanitize.
     3184     */
     3185    rc = CFGMR3QueryU32Def(pCpumCfg, "MaxExtLeaf", &pConfig->uMaxExtLeaf, UINT32_C(0x8000001e));
    31853186    AssertLogRelRCReturn(rc, rc);
    31863187
     
    31883189     * The last extended leaf to keep.  The actual last value that is stored in EAX
    31893190     * is RT_MAX(CPUID[0xc0000000].EAX,/CPUM/MaxCentaurLeaf).  Leaves beyond the max
    3190      * leaf are removed.
     3191     * leaf are removed.  The default is set to what we're able to sanitize.
    31913192     */
    31923193    rc = CFGMR3QueryU32Def(pCpumCfg, "MaxCentaurLeaf", &pConfig->uMaxCentaurLeaf, UINT32_C(0xc0000004));
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