Changeset 108835 in vbox
- Timestamp:
- Apr 3, 2025 10:40:08 AM (6 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168283
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gic-its.h
r108829 r108835 264 264 /** GITS_BASER: ITS Table Descriptors - RW. */ 265 265 #define GITS_CTRL_REG_BASER_OFF_FIRST 0x0100 266 #define GITS_CTRL_REG_BASER_OFF_LAST 0x0138 267 #define GITS_CTRL_REG_BASER_RANGE_SIZE (GITS_CTRL_REG_BASER_OFF_LAST + sizeof(uint64_t) - GITS_CTRL_REG_BASER_OFF_FIRST) 266 268 /** GITS_BASER: Size - Number of pages allocated to the table minus one. */ 267 269 #define GITS_BF_CTRL_REG_BASER_SIZE_SHIFT 0 … … 299 301 VALID)); 300 302 301 #define GITS_CTRL_REG_BASER_OFF_LAST 0x0138302 #define GITS_CTRL_REG_BASER_RANGE_SIZE (GITS_CTRL_REG_BASER_OFF_LAST + sizeof(uint64_t) - GITS_CTRL_REG_BASER_OFF_FIRST)303 304 303 /** GITS_PIDR2: ITS Peripheral ID2 register - RO. */ 305 304 #define GITS_CTRL_REG_PIDR2_OFF 0xffe8 … … 331 330 #define GITS_TRANSLATION_REG_TRANSLATER 0x0040 332 331 332 /** GITS Two-level (indirect) table entry. */ 333 #define GITS_BF_ITE_LVL2_RSVD_11_0_SHIFT 0 334 #define GITS_BF_ITE_LVL2_RSVD_11_0_MASK UINT64_C(0x0000000000000fff) 335 #define GITS_BF_ITE_LVL2_PHYS_ADDR_SHIFT 12 336 #define GITS_BF_ITE_LVL2_PHYS_ADDR_MASK UINT64_C(0x000ffffffffff000) 337 #define GITS_BF_ITE_LVL2_RSVD_62_52_SHIFT 52 338 #define GITS_BF_ITE_LVL2_RSVD_62_52_MASK UINT64_C(0x7ff0000000000000) 339 #define GITS_BF_ITE_LVL2_VALID_SHIFT 63 340 #define GITS_BF_ITE_LVL2_VALID_MASK UINT64_C(0x8000000000000000) 341 RT_BF_ASSERT_COMPILE_CHECKS(GITS_BF_ITE_LVL2_, UINT64_C(0), UINT64_MAX, 342 (RSVD_11_0, PHYS_ADDR, RSVD_62_52, VALID)); 343 333 344 /** 334 345 * Memory shareability attributes. -
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r108827 r108835 47 47 * sources to specific PEs. The ITS is only accessible via its memory mapped I/O 48 48 * region. When the MMIO handle for the its region is NIL_IOMMMIOHANDLE it's 49 * considered to be disabled for the VM. The ITS code lives in GITSAll.cpp.49 * considered to be disabled for the VM. Most of the ITS code lives in GITSAll.cpp. 50 50 * 51 51 * This implementation only targets GICv3. This implementation does not support … … 3371 3371 3372 3372 3373 3374 #ifndef IN_RING33375 /**3376 * @callback_method_impl{PDMDEVREGR0,pfnConstruct}3377 */3378 static DECLCALLBACK(int) gicRZConstruct(PPDMDEVINS pDevIns)3379 {3380 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);3381 AssertReleaseFailed();3382 return VINF_SUCCESS;3383 }3384 #endif /* !IN_RING3 */3385 3386 3387 3373 /** 3388 3374 * GIC device registration structure. … … 3408 3394 /* .pfnConstruct = */ gicR3Construct, 3409 3395 /* .pfnDestruct = */ gicR3Destruct, 3410 /* .pfnRelocate = */ gicR3Relocate,3396 /* .pfnRelocate = */ NULL, 3411 3397 /* .pfnMemSetup = */ NULL, 3412 3398 /* .pfnPowerOn = */ NULL, … … 3430 3416 #elif defined(IN_RING0) 3431 3417 /* .pfnEarlyConstruct = */ NULL, 3432 /* .pfnConstruct = */ gicRZConstruct,3418 /* .pfnConstruct = */ NULL, 3433 3419 /* .pfnDestruct = */ NULL, 3434 3420 /* .pfnFinalDestruct = */ NULL, … … 3443 3429 /* .pfnReserved7 = */ NULL, 3444 3430 #elif defined(IN_RC) 3445 /* .pfnConstruct = */ gicRZConstruct,3431 /* .pfnConstruct = */ NULL, 3446 3432 /* .pfnReserved0 = */ NULL, 3447 3433 /* .pfnReserved1 = */ NULL, -
trunk/src/VBox/VMM/VMMAll/GITSAll.cpp
r108833 r108835 322 322 static const char* const s_apszType[] = { "UnImpl", "Devices", "vPEs", "Intr Collections" }; 323 323 324 uint64_t const uReg = pGitsDev->aItsTableRegs[ 8].u;324 uint64_t const uReg = pGitsDev->aItsTableRegs[i].u; 325 325 uint16_t const uSize = RT_BF_GET(uReg, GITS_BF_CTRL_REG_BASER_SIZE); 326 326 uint16_t const cPages = uSize > 0 ? uSize + 1 : 0; -
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 -
trunk/src/VBox/VMM/include/GICInternal.h
r108833 r108835 283 283 DECLCALLBACK(int) gicR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg); 284 284 DECLCALLBACK(int) gicR3Destruct(PPDMDEVINS pDevIns); 285 DECLCALLBACK(void) gicR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);286 285 DECLCALLBACK(void) gicR3Reset(PPDMDEVINS pDevIns); 287 286
Note:
See TracChangeset
for help on using the changeset viewer.