VirtualBox

Ignore:
Timestamp:
Apr 8, 2025 10:53:54 AM (5 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168333
Message:

VMM/GIC: bugref:10877 Stats cleanup (drop redundant/implied R3 suffix), add stats for commands, debugging/work-in-progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/GITSAll.cpp

    r108878 r108882  
    137137
    138138
     139#if 0
    139140static const char * gitsGetCommandName(uint8_t uCmdId)
    140141{
     
    166167    }
    167168}
     169#endif
    168170
    169171
     
    420422    pGitsDev->uCmdReadReg        = 0;
    421423    pGitsDev->uCmdWriteReg       = 0;
    422     RT_ZERO(pGitsDev->auCt);
     424    RT_ZERO(pGitsDev->aCtes);
    423425}
    424426
     
    498500                        RT_BF_GET(uReg, GITS_BF_CTRL_REG_CWRITER_RETRY), uReg & GITS_BF_CTRL_REG_CWRITER_OFFSET_MASK);
    499501    }
     502
     503    /* Interrupt Collection Table. */
     504    {
     505        pHlp->pfnPrintf(pHlp, "  Collection Table:\n");
     506        bool fHasValidCtes = false;
     507        for (unsigned i = 0; i < RT_ELEMENTS(pGitsDev->aCtes); i++)
     508        {
     509            if (pGitsDev->aCtes[i].fValid)
     510            {
     511                AssertCompile(sizeof(pGitsDev->aCtes[i].idTargetCpu) == sizeof(uint16_t));
     512                pHlp->pfnPrintf(pHlp, "    aCtes[%u].idTargetCpu = %#RX16\n", i, pGitsDev->aCtes[i].idTargetCpu);
     513                fHasValidCtes = true;
     514            }
     515        }
     516        if (!fHasValidCtes)
     517            pHlp->pfnPrintf(pHlp, "    Empty (no valid entries)\n");
     518    }
    500519}
    501520
     
    513532        if (!fIsEmpty)
    514533        {
    515             uint32_t const cCmdQueuePages = (pGitsDev->uCmdBaseReg.u & GITS_BF_CTRL_REG_CBASER_SIZE_MASK) + 1;
     534            uint32_t const cCmdQueuePages = RT_BF_GET(pGitsDev->uCmdBaseReg.u, GITS_BF_CTRL_REG_CBASER_SIZE) + 1;
    516535            uint32_t const cbCmdQueue     = cCmdQueuePages << GITS_CMD_QUEUE_PAGE_SHIFT;
    517536            AssertRelease(cbCmdQueue <= cbBuf); /** @todo Paranoia; make this a debug assert later. */
     
    538557                /* The write offset has wrapped around, read till end of buffer followed by wrapped-around data. */
    539558                uint32_t const cbForward = cbCmdQueue - offRead;
    540                 uint32_t const cbWrapped = offRead;
     559                uint32_t const cbWrapped = offWrite;
    541560                Assert(cbForward + cbWrapped <= cbBuf);
    542561                rc  = PDMDevHlpPhysReadMeta(pDevIns, GCPhysCmds, pvBuf, cbForward);
     
    575594                            uint32_t const uTargetCpuId      = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_RDBASE);
    576595                            uint16_t const uIntrCollectionId = RT_BF_GET(uDw2, GITS_BF_CMD_MAPC_DW2_IC_ID);
    577                             AssertRelease(uIntrCollectionId < RT_ELEMENTS(pGitsDev->auCt)); /** @todo later figure ideal/correct CT size. */
     596                            AssertRelease(uIntrCollectionId < RT_ELEMENTS(pGitsDev->aCtes)); /** @todo later figure ideal/correct CT size. */
    578597
    579598                            GITS_CRIT_SECT_ENTER(pDevIns);
    580599                            Assert(!RT_BF_GET(pGitsDev->uTypeReg.u, GITS_BF_CTRL_REG_TYPER_PTA));
    581                             pGitsDev->auCt[uIntrCollectionId].fValid      = fValid;
    582                             pGitsDev->auCt[uIntrCollectionId].idTargetCpu = uTargetCpuId;
     600                            pGitsDev->aCtes[uIntrCollectionId].fValid      = fValid;
     601                            pGitsDev->aCtes[uIntrCollectionId].idTargetCpu = uTargetCpuId;
    583602                            GITS_CRIT_SECT_LEAVE(pDevIns);
     603                            STAM_COUNTER_INC(&pGitsDev->StatCmdMapc);
    584604                            break;
    585605                        }
     
    588608                        {
    589609                            /* Nothing to do since all previous commands have committed their changes to device state. */
     610                            STAM_COUNTER_INC(&pGitsDev->StatCmdSync);
    590611                            break;
    591612                        }
     
    594615                        {
    595616                            /* Nothing to do as we currently do not cache interrupt mappings. */
     617                            STAM_COUNTER_INC(&pGitsDev->StatCmdInvall);
    596618                            break;
    597619                        }
    598620
    599621                        default:
    600                             AssertReleaseMsgFailed(("Cmd=%#x (%s)\n", uCmdId, gitsGetCommandName(uCmdId)));
     622                            //AssertReleaseMsgFailed(("Cmd=%#x (%s) idxCmd=%u cCmds=%u cbCmds=%u\n", uCmdId,
     623                            //                        gitsGetCommandName(uCmdId), idxCmd, cCmds, cbCmds));
     624                            //break;
    601625                            break;
    602626                    }
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