Changeset 108835 in vbox for trunk/src/VBox/VMM/VMMR3/GICR3.cpp
- Timestamp:
- Apr 3, 2025 10:40:08 AM (3 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168283
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GICR3.cpp
r108834 r108835 42 42 43 43 #include <iprt/armv8.h> 44 #include <iprt/mem.h> 44 45 45 46 … … 290 291 PCGICDEV pGicDev = PDMDEVINS_2_DATA(pDevIns, PCGICDEV); 291 292 if (pGicDev->hMmioGits != NIL_IOMMMIOHANDLE) 292 { 293 PCGITSDEV pGitsDev = &pGicDev->Gits; 294 gitsR3DbgInfo(pGitsDev, pHlp, pszArgs); 295 } 293 gitsR3DbgInfo(&pGicDev->Gits, pHlp, pszArgs); 296 294 else 297 295 pHlp->pfnPrintf(pHlp, "GIC ITS is not mapped/configured for the VM\n"); … … 314 312 AssertPtrReturn(pGicDev, VERR_INVALID_PARAMETER); 315 313 LogFlowFunc(("Command-queue thread spawned and initialized\n")); 314 315 /* 316 * Pre-allocate the maximum size of the command queue allowed by the spec. 317 * This prevents trashing the heap as well as deal with out-of-memory situations 318 * up-front while starting the VM. It also simplifies the code from having to 319 * dynamically grow/shrink the allocation based on how software sizes the queue. 320 * Guests normally don't alter the queue size all the time, but that's not an 321 * assumption we can make. 322 */ 323 uint16_t const cMaxPages = GITS_BF_CTRL_REG_CBASER_SIZE_MASK + 1; 324 size_t const cbCmdQueue = cMaxPages << GUEST_PAGE_SHIFT; 325 void *pvCommands = RTMemAllocZ(cbCmdQueue); 326 AssertLogRelMsgReturn(pvCommands, ("Failed to alloc %.Rhcb (%zu bytes) for GITS command queue\n", cbCmdQueue, cbCmdQueue), 327 VERR_NO_MEMORY); 316 328 317 329 while (pThread->enmState == PDMTHREADSTATE_RUNNING) … … 322 334 { 323 335 int const rc = PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pGicDev->hEvtCmdQueue, RT_INDEFINITE_WAIT); 324 AssertLogRelMsgReturn (RT_SUCCESS(rc) || rc == VERR_INTERRUPTED, ("%Rrc\n", rc), rc);336 AssertLogRelMsgReturnStmt(RT_SUCCESS(rc) || rc == VERR_INTERRUPTED, ("%Rrc\n", rc), RTMemFree(pvCommands), rc); 325 337 if (pThread->enmState != PDMTHREADSTATE_RUNNING) 326 338 break; … … 330 342 PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->pCritSectRoR3, rcLock); 331 343 332 /** @todo Process commands. 344 /** @todo Process commands. */ 333 345 334 346 PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3); 335 347 } 348 349 RTMemFree(pvCommands); 336 350 337 351 LogFlowFunc(("Command-queue thread terminating\n")); … … 613 627 gicResetCpu(pDevIns, pVCpuDest); 614 628 } 615 }616 617 618 /**619 * @interface_method_impl{PDMDEVREG,pfnRelocate}620 */621 DECLCALLBACK(void) gicR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)622 {623 RT_NOREF(pDevIns, offDelta);624 629 } 625 630
Note:
See TracChangeset
for help on using the changeset viewer.