Changeset 55740 in vbox
- Timestamp:
- May 7, 2015 10:20:48 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r55733 r55740 40 40 /** For sanity and avoid wasting hyper heap on buggy config / saved state. */ 41 41 #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 42 46 43 47 … … 1655 1659 { 1656 1660 if ( pXStateLeaf0->uEcx >= sizeof(X86FXSTATE) 1657 && pXStateLeaf0->uEcx <= _8K1661 && pXStateLeaf0->uEcx <= CPUM_MAX_XSAVE_AREA_SIZE 1658 1662 && RT_ALIGN_32(pXStateLeaf0->uEcx, 8) == pXStateLeaf0->uEcx 1659 1663 && pXStateLeaf0->uEbx >= sizeof(X86FXSTATE) … … 1662 1666 { 1663 1667 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; 1664 1675 } 1665 1676 else … … 2110 2121 AssertLogRelMsgReturn(pSubLeaf->fSubLeafMask >= iComponent, ("iComponent=%#x\n"), VERR_CPUM_IPE_1); 2111 2122 AssertLogRelMsgReturn( pSubLeaf->uEax > 0 2123 && pSubLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE 2112 2124 && 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, 2116 2127 ("iComponent=%#x eax=%#x ebx=%#x cbMax=%#x\n", iComponent, pSubLeaf->uEax, pSubLeaf->uEbx, 2117 2128 pCpum->GuestFeatures.cbMaxExtendedState), … … 3084 3095 pCurLeaf->uEdx &= RT_HI_U32(fGuestXcr0Mask); 3085 3096 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, 3088 3100 ("ebx=%#x cbXSaveMax=%#x\n", pCurLeaf->uEbx, cbXSaveMax), 3089 3101 VERR_CPUM_IPE_2); … … 3101 3113 && pCurLeaf->uEax > 0 3102 3114 && pCurLeaf->uEbx < cbXSaveMax 3103 && pCurLeaf->uEbx >= 0x2403115 && pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE 3104 3116 && pCurLeaf->uEbx + pCurLeaf->uEax <= cbXSaveMax, 3105 3117 ("%#x: eax=%#x ebx=%#x cbMax=%#x\n", pCurLeaf->uEax, pCurLeaf->uEbx, cbXSaveMax),
Note:
See TracChangeset
for help on using the changeset viewer.

