VirtualBox

Changeset 55740 in vbox


Ignore:
Timestamp:
May 7, 2015 10:20:48 PM (9 years ago)
Author:
vboxsync
Message:

leaf 0xd fixes

File:
1 edited

Legend:

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

    r55733 r55740  
    4040/** For sanity and avoid wasting hyper heap on buggy config / saved state. */
    4141#define CPUM_CPUID_MAX_LEAVES       2048
     42/* Max size we accept for the XSAVE area. */
     43#define CPUM_MAX_XSAVE_AREA_SIZE    10240
     44/* Min size we accept for the XSAVE area. */
     45#define CPUM_MIN_XSAVE_AREA_SIZE    0x240
    4246
    4347
     
    16551659            {
    16561660                if (   pXStateLeaf0->uEcx >= sizeof(X86FXSTATE)
    1657                     && pXStateLeaf0->uEcx <= _8K
     1661                    && pXStateLeaf0->uEcx <= CPUM_MAX_XSAVE_AREA_SIZE
    16581662                    && RT_ALIGN_32(pXStateLeaf0->uEcx, 8) == pXStateLeaf0->uEcx
    16591663                    && pXStateLeaf0->uEbx >= sizeof(X86FXSTATE)
     
    16621666                {
    16631667                    pFeatures->cbMaxExtendedState = pXStateLeaf0->uEcx;
     1668
     1669                    PCCPUMCPUIDLEAF const pXStateLeaf1 = cpumR3CpuIdFindLeafEx(paLeaves, cLeaves, 13, 1);
     1670                    if (   pXStateLeaf1
     1671                        && pXStateLeaf1->uEbx > pFeatures->cbMaxExtendedState
     1672                        && pXStateLeaf1->uEbx <= CPUM_MAX_XSAVE_AREA_SIZE
     1673                        && (pXStateLeaf1->uEcx || pXStateLeaf1->uEdx) )
     1674                        pFeatures->cbMaxExtendedState = pXStateLeaf0->uEbx;
    16641675                }
    16651676                else
     
    21102121            AssertLogRelMsgReturn(pSubLeaf->fSubLeafMask >= iComponent, ("iComponent=%#x\n"), VERR_CPUM_IPE_1);
    21112122            AssertLogRelMsgReturn(   pSubLeaf->uEax > 0
     2123                                  && pSubLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE
    21122124                                  && pSubLeaf->uEax <= pCpum->GuestFeatures.cbMaxExtendedState
    2113                                   && pSubLeaf->uEbx >= 0x240
    2114                                   && pSubLeaf->uEbx <  pCpum->GuestFeatures.cbMaxExtendedState
    2115                                   && pSubLeaf->uEbx + pSubLeaf->uEax < pCpum->GuestFeatures.cbMaxExtendedState,
     2125                                  && pSubLeaf->uEbx <= pCpum->GuestFeatures.cbMaxExtendedState
     2126                                  && pSubLeaf->uEbx + pSubLeaf->uEax <= pCpum->GuestFeatures.cbMaxExtendedState,
    21162127                                  ("iComponent=%#x eax=%#x ebx=%#x cbMax=%#x\n", iComponent, pSubLeaf->uEax, pSubLeaf->uEbx,
    21172128                                   pCpum->GuestFeatures.cbMaxExtendedState),
     
    30843095                        pCurLeaf->uEdx &= RT_HI_U32(fGuestXcr0Mask);
    30853096                        cbXSaveMax = pCurLeaf->uEcx;
    3086                         AssertLogRelMsgReturn(cbXSaveMax <= 8192 && cbXSaveMax >= 0x240, ("%#x\n", cbXSaveMax), VERR_CPUM_IPE_2);
    3087                         AssertLogRelMsgReturn(pCurLeaf->uEbx >= 0x240 && pCurLeaf->uEbx <= cbXSaveMax,
     3097                        AssertLogRelMsgReturn(cbXSaveMax <= CPUM_MAX_XSAVE_AREA_SIZE && cbXSaveMax >= CPUM_MIN_XSAVE_AREA_SIZE,
     3098                                              ("%#x max=%#x\n", cbXSaveMax, CPUM_MAX_XSAVE_AREA_SIZE), VERR_CPUM_IPE_2);
     3099                        AssertLogRelMsgReturn(pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE && pCurLeaf->uEbx <= cbXSaveMax,
    30883100                                              ("ebx=%#x cbXSaveMax=%#x\n", pCurLeaf->uEbx, cbXSaveMax),
    30893101                                              VERR_CPUM_IPE_2);
     
    31013113                                                  && pCurLeaf->uEax >  0
    31023114                                                  && pCurLeaf->uEbx < cbXSaveMax
    3103                                                   && pCurLeaf->uEbx >= 0x240
     3115                                                  && pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE
    31043116                                                  && pCurLeaf->uEbx + pCurLeaf->uEax <= cbXSaveMax,
    31053117                                                  ("%#x: eax=%#x ebx=%#x cbMax=%#x\n", pCurLeaf->uEax, pCurLeaf->uEbx, cbXSaveMax),
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