Changeset 68707 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Sep 8, 2017 3:46:20 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r68532 r68707 3196 3196 3197 3197 /* Work the sub-leaves. */ 3198 uint32_t cbXSaveMax = sizeof(X86FXSTATE); 3198 uint32_t cbXSaveMaxActual = CPUM_MIN_XSAVE_AREA_SIZE; 3199 uint32_t cbXSaveMaxReport = CPUM_MIN_XSAVE_AREA_SIZE; 3199 3200 for (uSubLeaf = 0; uSubLeaf < 63; uSubLeaf++) 3200 3201 { … … 3212 3213 ("CPUID(0xd/0).EAX missing mandatory X87 or SSE bits: %#RX32", pCurLeaf->uEax), 3213 3214 VERR_CPUM_IPE_1); 3214 cbXSaveMax = pCurLeaf->uEcx;3215 AssertLogRelMsgReturn(cbXSaveMax <= CPUM_MAX_XSAVE_AREA_SIZE && cbXSaveMax>= CPUM_MIN_XSAVE_AREA_SIZE,3216 ("%#x max=%#x\n", cbXSaveMax , CPUM_MAX_XSAVE_AREA_SIZE), VERR_CPUM_IPE_2);3217 AssertLogRelMsgReturn(pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE && pCurLeaf->uEbx <= cbXSaveMax ,3218 ("ebx=%#x cbXSaveMax =%#x\n", pCurLeaf->uEbx, cbXSaveMax),3215 cbXSaveMaxActual = pCurLeaf->uEcx; 3216 AssertLogRelMsgReturn(cbXSaveMaxActual <= CPUM_MAX_XSAVE_AREA_SIZE && cbXSaveMaxActual >= CPUM_MIN_XSAVE_AREA_SIZE, 3217 ("%#x max=%#x\n", cbXSaveMaxActual, CPUM_MAX_XSAVE_AREA_SIZE), VERR_CPUM_IPE_2); 3218 AssertLogRelMsgReturn(pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE && pCurLeaf->uEbx <= cbXSaveMaxActual, 3219 ("ebx=%#x cbXSaveMaxActual=%#x\n", pCurLeaf->uEbx, cbXSaveMaxActual), 3219 3220 VERR_CPUM_IPE_2); 3220 3221 continue; … … 3228 3229 if (fGuestXcr0Mask & RT_BIT_64(uSubLeaf)) 3229 3230 { 3230 AssertLogRelMsgReturn( pCurLeaf->uEax <= cbXSaveMax 3231 AssertLogRelMsgReturn( pCurLeaf->uEax <= cbXSaveMaxActual 3231 3232 && pCurLeaf->uEax > 0 3232 && pCurLeaf->uEbx < cbXSaveMax 3233 && pCurLeaf->uEbx < cbXSaveMaxActual 3233 3234 && pCurLeaf->uEbx >= CPUM_MIN_XSAVE_AREA_SIZE 3234 && pCurLeaf->uEbx + pCurLeaf->uEax <= cbXSaveMax ,3235 && pCurLeaf->uEbx + pCurLeaf->uEax <= cbXSaveMaxActual, 3235 3236 ("%#x: eax=%#x ebx=%#x cbMax=%#x\n", 3236 uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, cbXSaveMax ),3237 uSubLeaf, pCurLeaf->uEax, pCurLeaf->uEbx, cbXSaveMaxActual), 3237 3238 VERR_CPUM_IPE_2); 3238 3239 AssertLogRel(!(pCurLeaf->uEcx & 1)); 3239 3240 pCurLeaf->uEcx = 0; /* Bit 0 should be zero (XCR0), the reset are reserved... */ 3240 3241 pCurLeaf->uEdx = 0; /* it's reserved... */ 3242 if (pCurLeaf->uEbx + pCurLeaf->uEax > cbXSaveMaxReport) 3243 cbXSaveMaxReport = pCurLeaf->uEbx + pCurLeaf->uEax; 3241 3244 continue; 3242 3245 } … … 3250 3253 pCurLeaf->uEcx = 0; 3251 3254 pCurLeaf->uEdx = 0; 3255 } 3256 } 3257 3258 /* Update the max and current feature sizes to shut up annoying Linux kernels. */ 3259 if (cbXSaveMaxReport != cbXSaveMaxActual && fGuestXcr0Mask) 3260 { 3261 pCurLeaf = cpumR3CpuIdGetExactLeaf(pCpum, 13, 0); 3262 if (pCurLeaf) 3263 { 3264 LogRel(("CPUM: Changing leaf 13[0]: EBX=%#RX32 -> %#RX32, ECX=%#RX32 -> %#RX32\n", 3265 pCurLeaf->uEbx, cbXSaveMaxReport, pCurLeaf->uEcx, cbXSaveMaxReport)); 3266 pCurLeaf->uEbx = cbXSaveMaxReport; 3267 pCurLeaf->uEcx = cbXSaveMaxReport; 3252 3268 } 3253 3269 }
Note:
See TracChangeset
for help on using the changeset viewer.