VirtualBox

Ignore:
Timestamp:
Mar 21, 2025 9:38:38 AM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168096
Message:

VMM/GIC: bugref:10877 GITS scafolding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/GICR3.cpp

    r108531 r108682  
    8282 * @param   pszArgs     Arguments, ignored.
    8383 */
    84 static DECLCALLBACK(void) gicR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     84static DECLCALLBACK(void) gicR3DbgInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
    8585{
    8686    RT_NOREF(pszArgs);
     
    112112 * @param   pszArgs     Arguments, ignored.
    113113 */
    114 static DECLCALLBACK(void) gicR3InfoDist(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     114static DECLCALLBACK(void) gicR3DbgInfoDist(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
    115115{
    116116    RT_NOREF(pszArgs);
     
    191191 * @param   pszArgs     Arguments, ignored.
    192192 */
    193 static DECLCALLBACK(void) gicR3InfoReDist(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     193static DECLCALLBACK(void) gicR3DbgInfoReDist(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
    194194{
    195195    NOREF(pszArgs);
     
    273273
    274274/**
     275 * Dumps the GIC ITS information.
     276 *
     277 * @param   pVM         The cross context VM structure.
     278 * @param   pHlp        The info helpers.
     279 * @param   pszArgs     Arguments, ignored.
     280 */
     281static DECLCALLBACK(void) gicR3DbgInfoIts(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     282{
     283    PGIC pGic = VM_TO_GIC(pVM);
     284    PPDMDEVINS pDevIns  = pGic->CTX_SUFF(pDevIns);
     285    PCGICDEV   pGicDev  = PDMDEVINS_2_DATA(pDevIns, PCGICDEV);
     286    if (pGicDev->hMmioGits != NIL_IOMMMIOHANDLE)
     287    {
     288        PCGITSDEV  pGitsDev = &pGicDev->Gits;
     289        gitsR3DbgInfo(pGitsDev, pHlp, pszArgs);
     290    }
     291    else
     292        pHlp->pfnPrintf(pHlp, "GIC ITS is not mapped/configured for the VM\n");
     293}
     294
     295
     296/**
    275297 * @copydoc FNSSMDEVSAVEEXEC
    276298 */
     
    660682     * Register the MMIO ranges.
    661683     */
    662     RTGCPHYS GCPhysMmioBase = 0;
    663     rc = pHlp->pfnCFGMQueryU64(pCfg, "DistributorMmioBase", &GCPhysMmioBase);
    664     if (RT_FAILURE(rc))
    665         return PDMDEV_SET_ERROR(pDevIns, rc,
    666                                 N_("Configuration error: Failed to get the \"DistributorMmioBase\" value"));
    667 
    668     rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, GIC_DIST_REG_FRAME_SIZE, gicDistMmioWrite, gicDistMmioRead,
    669                                    IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GIC_Dist", &pGicDev->hMmioDist);
    670     AssertRCReturn(rc, rc);
    671 
    672     rc = pHlp->pfnCFGMQueryU64(pCfg, "RedistributorMmioBase", &GCPhysMmioBase);
    673     if (RT_FAILURE(rc))
    674         return PDMDEV_SET_ERROR(pDevIns, rc,
    675                                 N_("Configuration error: Failed to get the \"RedistributorMmioBase\" value"));
    676 
    677     RTGCPHYS const cbRegion = (RTGCPHYS)pVM->cCpus
    678                             * (GIC_REDIST_REG_FRAME_SIZE + GIC_REDIST_SGI_PPI_REG_FRAME_SIZE); /* Adjacent and per vCPU. */
    679     rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, cbRegion, gicReDistMmioWrite, gicReDistMmioRead,
    680                                    IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GIC_ReDist", &pGicDev->hMmioReDist);
    681     AssertRCReturn(rc, rc);
     684    /* Distributor. */
     685    {
     686        RTGCPHYS GCPhysMmioBase = 0;
     687        rc = pHlp->pfnCFGMQueryU64(pCfg, "DistributorMmioBase", &GCPhysMmioBase);
     688        if (RT_FAILURE(rc))
     689            return PDMDEV_SET_ERROR(pDevIns, rc,
     690                                    N_("Configuration error: Failed to get the \"DistributorMmioBase\" value"));
     691
     692        rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, GIC_DIST_REG_FRAME_SIZE, gicDistMmioWrite, gicDistMmioRead,
     693                                       IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GIC Distributor",
     694                                       &pGicDev->hMmioDist);
     695        AssertRCReturn(rc, rc);
     696    }
     697
     698    /* Redistributor. */
     699    {
     700        RTGCPHYS GCPhysMmioBase = 0;
     701        rc = pHlp->pfnCFGMQueryU64(pCfg, "RedistributorMmioBase", &GCPhysMmioBase);
     702        if (RT_FAILURE(rc))
     703            return PDMDEV_SET_ERROR(pDevIns, rc,
     704                                    N_("Configuration error: Failed to get the \"RedistributorMmioBase\" value"));
     705
     706        RTGCPHYS const cbRegion = (RTGCPHYS)pVM->cCpus
     707                                * (GIC_REDIST_REG_FRAME_SIZE + GIC_REDIST_SGI_PPI_REG_FRAME_SIZE); /* Adjacent and per vCPU. */
     708        rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, cbRegion, gicReDistMmioWrite, gicReDistMmioRead,
     709                                       IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GIC Redistributor",
     710                                       &pGicDev->hMmioReDist);
     711        AssertRCReturn(rc, rc);
     712    }
     713
     714    /* ITS. */
     715    {
     716        RTGCPHYS GCPhysMmioBase = 0;
     717        rc = pHlp->pfnCFGMQueryU64(pCfg, "ItsMmioBase", &GCPhysMmioBase);
     718        if (RT_SUCCESS(rc))
     719        {
     720            RTGCPHYS const cbRegion = 2 * GITS_REG_FRAME_SIZE;  /* 2 frames for GICv3. */
     721            rc = PDMDevHlpMmioCreateAndMap(pDevIns, GCPhysMmioBase, cbRegion, gicItsMmioWrite, gicItsMmioRead,
     722                                           IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_DWORD_ZEROED, "GIC ITS",
     723                                           &pGicDev->hMmioGits);
     724            AssertRCReturn(rc, rc);
     725        }
     726        else
     727            pGicDev->hMmioGits = NIL_IOMMMIOHANDLE;
     728    }
    682729
    683730    /*
     
    694741     * not just used during live debugging via the VM debugger.
    695742     */
    696     DBGFR3InfoRegisterInternalEx(pVM, "gic",       "Dumps GIC basic information.",         gicR3Info,       DBGFINFO_FLAGS_ALL_EMTS);
    697     DBGFR3InfoRegisterInternalEx(pVM, "gicdist",   "Dumps GIC distributor information.",   gicR3InfoDist,   DBGFINFO_FLAGS_ALL_EMTS);
    698     DBGFR3InfoRegisterInternalEx(pVM, "gicredist", "Dumps GIC redistributor information.", gicR3InfoReDist, DBGFINFO_FLAGS_ALL_EMTS);
     743    DBGFR3InfoRegisterInternalEx(pVM, "gic",       "Dumps GIC basic information.",         gicR3DbgInfo,       DBGFINFO_FLAGS_ALL_EMTS);
     744    DBGFR3InfoRegisterInternalEx(pVM, "gicdist",   "Dumps GIC distributor information.",   gicR3DbgInfoDist,   DBGFINFO_FLAGS_ALL_EMTS);
     745    DBGFR3InfoRegisterInternalEx(pVM, "gicredist", "Dumps GIC redistributor information.", gicR3DbgInfoReDist, DBGFINFO_FLAGS_ALL_EMTS);
     746    DBGFR3InfoRegisterInternalEx(pVM, "gicits",    "Dumps GIC ITS information.",           gicR3DbgInfoIts,    DBGFINFO_FLAGS_ALL_EMTS);
    699747
    700748    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette