Changeset 51344 in vbox
- Timestamp:
- May 22, 2014 11:04:58 AM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r51334 r51344 567 567 static PCPUMCPUIDLEAF cpumR3CpuIdEnsureSpace(PVM pVM, PCPUMCPUIDLEAF *ppaLeaves, uint32_t cLeaves) 568 568 { 569 uint32_t cAllocated = RT_ALIGN(cLeaves, 16); 569 uint32_t cAllocated; 570 if (!pVM) 571 cAllocated = RT_ALIGN(cLeaves, 16); 572 else 573 { 574 /* 575 * We're using the hyper heap now, but when the arrays were copied over to it from 576 * the host-context heap, we only copy the exact size and not the ensured size. 577 * See @bugref{7270}. 578 */ 579 cAllocated = cLeaves; 580 } 581 570 582 if (cLeaves + 1 > cAllocated) 571 583 { … … 585 597 pVM->cpum.s.GuestInfo.paCpuIdLeavesR0 = NIL_RTR0PTR; 586 598 pVM->cpum.s.GuestInfo.paCpuIdLeavesRC = NIL_RTRCPTR; 599 LogRel(("CPUM: cpumR3CpuIdEnsureSpace: MMR3HyperRealloc failed. rc=%Rrc\n", rc)); 587 600 return NULL; 588 601 } 589 590 /* Update the R0 and RC pointers. */ 591 pVM->cpum.s.GuestInfo.paCpuIdLeavesR0 = MMHyperR3ToR0(pVM, *ppaLeaves); 592 pVM->cpum.s.GuestInfo.paCpuIdLeavesRC = MMHyperR3ToRC(pVM, *ppaLeaves); 602 *ppaLeaves = (PCPUMCPUIDLEAF)pvNew; 593 603 } 594 604 else … … 602 612 return NULL; 603 613 } 604 } 605 *ppaLeaves = (PCPUMCPUIDLEAF)pvNew; 606 } 614 *ppaLeaves = (PCPUMCPUIDLEAF)pvNew; 615 } 616 } 617 618 #ifndef IN_VBOX_CPU_REPORT 619 /* Update the R0 and RC pointers. */ 620 if (pVM) 621 { 622 Assert(ppaLeaves == &pVM->cpum.s.GuestInfo.paCpuIdLeavesR3); 623 pVM->cpum.s.GuestInfo.paCpuIdLeavesR0 = MMHyperR3ToR0(pVM, *ppaLeaves); 624 pVM->cpum.s.GuestInfo.paCpuIdLeavesRC = MMHyperR3ToRC(pVM, *ppaLeaves); 625 } 626 #endif 627 607 628 return *ppaLeaves; 608 629 } -
trunk/src/VBox/VMM/VMMR3/CPUMR3Db.cpp
r51334 r51344 307 307 static PCPUMMSRRANGE cpumR3MsrRangesEnsureSpace(PVM pVM, PCPUMMSRRANGE *ppaMsrRanges, uint32_t cMsrRanges, uint32_t cNewRanges) 308 308 { 309 uint32_t cMsrRangesAllocated = RT_ALIGN_32(cMsrRanges, 16); 309 uint32_t cMsrRangesAllocated; 310 if (!pVM) 311 cMsrRangesAllocated = RT_ALIGN_32(cMsrRanges, 16); 312 else 313 { 314 /* 315 * We're using the hyper heap now, but when the range array was copied over to it from 316 * the host-context heap, we only copy the exact size and not the ensured size. 317 * See @bugref{7270}. 318 */ 319 cMsrRangesAllocated = cMsrRanges; 320 } 310 321 if (cMsrRangesAllocated < cMsrRanges + cNewRanges) 311 322 { … … 325 336 pVM->cpum.s.GuestInfo.paMsrRangesR0 = NIL_RTR0PTR; 326 337 pVM->cpum.s.GuestInfo.paMsrRangesRC = NIL_RTRCPTR; 338 LogRel(("CPUM: cpumR3MsrRangesEnsureSpace: MMR3HyperRealloc failed. rc=%Rrc\n", rc)); 327 339 return NULL; 328 340 } 329 330 pVM->cpum.s.GuestInfo.paMsrRangesR0 = MMHyperR3ToR0(pVM, *ppaMsrRanges); 331 pVM->cpum.s.GuestInfo.paMsrRangesR0 = MMHyperR3ToRC(pVM, *ppaMsrRanges); 332 /** @todo Update R0 and RC pointers here? */ 341 *ppaMsrRanges = (PCPUMMSRRANGE)pvNew; 333 342 } 334 343 else … … 344 353 *ppaMsrRanges = (PCPUMMSRRANGE)pvNew; 345 354 } 355 356 if (pVM) 357 { 358 /* Update R0 and RC pointers. */ 359 Assert(ppaMsrRanges == &pVM->cpum.s.GuestInfo.paMsrRangesR3); 360 pVM->cpum.s.GuestInfo.paMsrRangesR0 = MMHyperR3ToR0(pVM, *ppaMsrRanges); 361 pVM->cpum.s.GuestInfo.paMsrRangesRC = MMHyperR3ToRC(pVM, *ppaMsrRanges); 362 } 363 346 364 return *ppaMsrRanges; 347 365 }
Note:
See TracChangeset
for help on using the changeset viewer.