Changeset 108976 in vbox
- Timestamp:
- Apr 15, 2025 12:30:07 PM (5 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168496
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/gic.h
r108946 r108976 728 728 /** GITS LPI Configuration */ 729 729 /** GITS LPI CTE: Enable. */ 730 #define GI TS_BF_LPI_CTE_ENABLE_SHIFT0731 #define GI TS_BF_LPI_CTE_ENABLE_MASKUINT8_C(0x1)730 #define GIC_BF_LPI_CTE_ENABLE_SHIFT 0 731 #define GIC_BF_LPI_CTE_ENABLE_MASK UINT8_C(0x1) 732 732 /** GITS LPI CTE: Reserved (bit 1). */ 733 #define GI TS_BF_LPI_CTE_RSVD_1_SHIFT1734 #define GI TS_BF_LPI_CTE_RSVD_1_MASKUINT8_C(0x2)733 #define GIC_BF_LPI_CTE_RSVD_1_SHIFT 1 734 #define GIC_BF_LPI_CTE_RSVD_1_MASK UINT8_C(0x2) 735 735 /** GITS LPI CTE: Priority. */ 736 #define GI TS_BF_LPI_CTE_PRIORITY_SHIFT2737 #define GI TS_BF_LPI_CTE_PRIORITY_MASKUINT8_C(0xfc)738 RT_BF_ASSERT_COMPILE_CHECKS(GI TS_BF_LPI_CTE_, UINT8_C(0), UINT8_MAX,736 #define GIC_BF_LPI_CTE_PRIORITY_SHIFT 2 737 #define GIC_BF_LPI_CTE_PRIORITY_MASK UINT8_C(0xfc) 738 RT_BF_ASSERT_COMPILE_CHECKS(GIC_BF_LPI_CTE_, UINT8_C(0), UINT8_MAX, 739 739 (ENABLE, RSVD_1, PRIORITY)); 740 741 /** Minimum number of bits required to enable LPIs (i.e. should accomodate 742 * GIC_INTID_RANGE_LPI_START). */ 743 #define GIC_LPI_ID_BITS_MIN 14 744 740 745 /** @} */ 741 746 -
trunk/src/VBox/VMM/VMMAll/GICAll.cpp
r108946 r108976 661 661 662 662 663 static void gicDistReadLpiConfigTableFromMemory(PPDMDEVINS pDevIns, PGICDEV pGicDev) 664 { 665 Assert(pGicDev->fEnableLpis); 666 LogFlowFunc(("\n")); 667 668 /* Check if the guest is disabling LPIs by setting GICR_PROPBASER.IDBits < 13. */ 669 uint8_t const cIdBits = RT_BF_GET(pGicDev->uLpiConfigBaseReg.u, GIC_BF_REDIST_REG_PROPBASER_ID_BITS) + 1; 670 if (cIdBits < GIC_LPI_ID_BITS_MIN) 671 return; 672 673 /* Copy the LPI config table from guest memory to our internal cache. */ 674 Assert(UINT32_C(2) << pGicDev->uMaxLpi <= RT_ELEMENTS(pGicDev->abLpiConfig)); 675 RTGCPHYS const GCPhysLpiConfigTable = pGicDev->uLpiConfigBaseReg.u & GIC_BF_REDIST_REG_PROPBASER_PHYS_ADDR_MASK; 676 uint32_t const cbLpiConfigTable = sizeof(pGicDev->abLpiConfig); 677 678 /** @todo Try releasing and re-acquiring the device critical section here. 679 * Probably safe, but haven't verified this... */ 680 int const rc = PDMDevHlpPhysReadMeta(pDevIns, GCPhysLpiConfigTable, (void *)&pGicDev->abLpiConfig[0], cbLpiConfigTable); 681 AssertRC(rc); 682 } 683 684 663 685 /** 664 686 * Updates the internal IRQ state and sets or clears the appropriate force action … … 2050 2072 | (pGicDev->fMbi ? GIC_DIST_REG_TYPER_MBIS : 0) 2051 2073 | (pGicDev->fRangeSel ? GIC_DIST_REG_TYPER_RSS : 0) 2052 | GIC_DIST_REG_TYPER_IDBITS_SET(1 6) /* We only support 16-bit interrupt IDs. */2074 | GIC_DIST_REG_TYPER_IDBITS_SET(15) /* We only support 16-bit interrupt IDs. */ 2053 2075 | (pGicDev->fAff3Levels ? GIC_DIST_REG_TYPER_A3V : 0); 2054 2076 if (pGicDev->fExtSpi) … … 2461 2483 case GIC_REDIST_REG_CTLR_OFF: 2462 2484 pGicDev->fEnableLpis = RT_BOOL(uValue & GIC_REDIST_REG_CTLR_ENABLE_LPI); 2485 if (pGicDev->fEnableLpis) 2486 gicDistReadLpiConfigTableFromMemory(pDevIns, pGicDev); 2463 2487 break; 2464 2488 case GIC_REDIST_REG_PROPBASER_OFF: -
trunk/src/VBox/VMM/VMMR3/GICR3.cpp
r108971 r108976 342 342 } 343 343 344 /* */ 345 { 346 347 } 348 /** @todo Dump LPI config and LPI pending registers. */ 344 /* LPI CTE (Configuration Table Entries). */ 345 { 346 uint32_t const cLpiCtes = RT_ELEMENTS(pGicDev->abLpiConfig); 347 uint32_t cLpiCtesEn = 0; 348 for (uint32_t i = 0; i < cLpiCtes; i++) 349 if (RT_BF_GET(pGicDev->abLpiConfig[i], GIC_BF_LPI_CTE_ENABLE)) 350 ++cLpiCtesEn; 351 352 pHlp->pfnPrintf(pHlp, " LPI config table (capacity=%u entries, enabled=%u entries)%s\n", cLpiCtes, cLpiCtesEn, 353 cLpiCtesEn > 0 ? ":" : ""); 354 for (uint32_t i = 0; i < cLpiCtesEn; i++) 355 { 356 uint8_t const uLpiCte = pGicDev->abLpiConfig[i]; 357 uint8_t const uPriority = RT_BF_GET(uLpiCte, GIC_BF_LPI_CTE_PRIORITY); 358 pHlp->pfnPrintf(pHlp, " [%4u] = %#x (priority=%u)\n", uLpiCte, uPriority); 359 } 360 } 361 362 /** @todo Dump LPI pending registers. */ 349 363 } 350 364
Note:
See TracChangeset
for help on using the changeset viewer.