VirtualBox

Changeset 86254 in vbox


Ignore:
Timestamp:
Sep 24, 2020 5:56:29 AM (4 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Add some more stat counters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r86214 r86254  
    316316    STAMCOUNTER             StatMsiRemapR3;             /**< Number of MSI remap requests in R3. */
    317317    STAMCOUNTER             StatMsiRemapRZ;             /**< Number of MSI remap requests in RZ. */
     318
     319    STAMCOUNTER             StatMemReadR3;              /**< Number of memory read translation requests in R3. */
     320    STAMCOUNTER             StatMemReadRZ;              /**< Number of memory read translation requests in RZ. */
     321    STAMCOUNTER             StatMemWriteR3;             /**< Number of memory write translation requests in R3. */
     322    STAMCOUNTER             StatMemWriteRZ;             /**< Number of memory write translation requests in RZ. */
    318323
    319324    STAMCOUNTER             StatCmd;                    /**< Number of commands processed. */
     
    20322037    }
    20332038
    2034     /* If a read handler doesn't exist, it's reserved or unknown register. */
     2039    /* If a read handler doesn't exist, it's a reserved or unknown register. */
    20352040    if (pReg->pfnRead)
    20362041    { /* likely */ }
     
    29892994
    29902995        /* If the IOVA is subject to address exclusion, addresses are forwarded without translation. */
    2991         if (   !pThis->ExclRangeBaseAddr.n.u1ExclEnable
     2996        if (   !pThis->ExclRangeBaseAddr.n.u1ExclEnable         /** @todo lock or make atomic read? */
    29922997            || !iommuAmdIsDvaInExclRange(pThis, &Dte, uIova))
    29932998        { /* likely */ }
     
    30693074
    30703075    PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU);
    3071     LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbRead=%u\n", uDevId, uIova, cbRead));
    30723076
    30733077    /* Addresses are forwarded without translation when the IOMMU is disabled. */
     
    30753079    if (Ctrl.n.u1IommuEn)
    30763080    {
     3081        STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMemRead));
     3082        LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbRead=%u\n", uDevId, uIova, cbRead));
     3083
    30773084        /** @todo IOMMU: IOTLB cache lookup. */
    30783085
     
    31073114
    31083115    PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU);
    3109     LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbWrite=%u\n", uDevId, uIova, cbWrite));
    31103116
    31113117    /* Addresses are forwarded without translation when the IOMMU is disabled. */
     
    31133119    if (Ctrl.n.u1IommuEn)
    31143120    {
     3121        STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMemWrite));
     3122        LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbWrite=%u\n", uDevId, uIova, cbWrite));
     3123
    31153124        /** @todo IOMMU: IOTLB cache lookup. */
    31163125
     
    48934902     */
    48944903    rc = PDMDevHlpMmioCreate(pDevIns, IOMMU_MMIO_REGION_SIZE, pPciDev, 0 /* iPciRegion */, iommuAmdMmioWrite, iommuAmdMmioRead,
    4895                              NULL /* pvUser */, IOMMMIO_FLAGS_READ_DWORD_QWORD | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING,
     4904                             NULL /* pvUser */,
     4905                               IOMMMIO_FLAGS_READ_DWORD_QWORD
     4906                             | IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING
     4907                             | IOMMMIO_FLAGS_DBGSTOP_ON_COMPLICATED_READ
     4908                             | IOMMMIO_FLAGS_DBGSTOP_ON_COMPLICATED_WRITE,
    48964909                             "AMD-IOMMU", &pThis->hMmio);
    48974910    AssertLogRelRCReturn(rc, rc);
     
    49194932     * Statistics.
    49204933     */
    4921     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioReadR3,  STAMTYPE_COUNTER, "R3/MmioReadR3",  STAMUNIT_OCCURENCES, "Number of MMIO reads in R3");
    4922     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioReadRZ,  STAMTYPE_COUNTER, "RZ/MmioReadRZ",  STAMUNIT_OCCURENCES, "Number of MMIO reads in RZ.");
    4923 
    4924     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioWriteR3, STAMTYPE_COUNTER, "R3/MmioWriteR3", STAMUNIT_OCCURENCES, "Number of MMIO writes in R3.");
    4925     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioWriteRZ, STAMTYPE_COUNTER, "RZ/MmioWriteRZ", STAMUNIT_OCCURENCES, "Number of MMIO writes in RZ.");
    4926 
    4927     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMsiRemapR3, STAMTYPE_COUNTER, "R3/MsiRemapR3", STAMUNIT_OCCURENCES, "Number of interrupt remap requests in R3.");
    4928     PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMsiRemapRZ, STAMTYPE_COUNTER, "RZ/MsiRemapRZ", STAMUNIT_OCCURENCES, "Number of interrupt remap requests in RZ.");
     4934    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioReadR3,  STAMTYPE_COUNTER, "R3/MmioRead",  STAMUNIT_OCCURENCES, "Number of MMIO reads in R3");
     4935    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioReadRZ,  STAMTYPE_COUNTER, "RZ/MmioRead",  STAMUNIT_OCCURENCES, "Number of MMIO reads in RZ.");
     4936
     4937    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioWriteR3, STAMTYPE_COUNTER, "R3/MmioWrite", STAMUNIT_OCCURENCES, "Number of MMIO writes in R3.");
     4938    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMmioWriteRZ, STAMTYPE_COUNTER, "RZ/MmioWrite", STAMUNIT_OCCURENCES, "Number of MMIO writes in RZ.");
     4939
     4940    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMsiRemapR3, STAMTYPE_COUNTER, "R3/MsiRemap", STAMUNIT_OCCURENCES, "Number of interrupt remap requests in R3.");
     4941    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMsiRemapRZ, STAMTYPE_COUNTER, "RZ/MsiRemap", STAMUNIT_OCCURENCES, "Number of interrupt remap requests in RZ.");
     4942
     4943    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMemReadR3,  STAMTYPE_COUNTER, "R3/MemRead",  STAMUNIT_OCCURENCES, "Number of memory read translation requests in R3.");
     4944    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMemReadRZ,  STAMTYPE_COUNTER, "RZ/MemRead",  STAMUNIT_OCCURENCES, "Number of memory read translation requests in RZ.");
     4945
     4946    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMemWriteR3,  STAMTYPE_COUNTER, "R3/MemWrite",  STAMUNIT_OCCURENCES, "Number of memory write translation requests in R3.");
     4947    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatMemWriteRZ,  STAMTYPE_COUNTER, "RZ/MemWrite",  STAMUNIT_OCCURENCES, "Number of memory write translation requests in RZ.");
    49294948
    49304949    PDMDevHlpSTAMRegister(pDevIns, &pThis->StatCmd, STAMTYPE_COUNTER, "R3/Commands", STAMUNIT_OCCURENCES, "Number of commands processed (total).");
Note: See TracChangeset for help on using the changeset viewer.

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