VirtualBox

Changeset 87866 in vbox


Ignore:
Timestamp:
Feb 25, 2021 5:06:57 AM (4 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 release build fixes.

File:
1 edited

Legend:

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

    r87848 r87866  
    11591159        Assert(pThisR3->cCachedIotlbes < IOMMU_IOTLBE_MAX);
    11601160        ++pThisR3->cCachedIotlbes;
    1161         STAM_COUNTER_INC(&pThis->StatIotlbeCached);
     1161        STAM_COUNTER_INC(&pThis->StatIotlbeCached); NOREF(pThis);
    11621162    }
    11631163    else
     
    11671167        {
    11681168            pFound->fEvictPending = false;
    1169             STAM_COUNTER_INC(&pThis->StatIotlbeLazyEvictReuse);
     1169            STAM_COUNTER_INC(&pThis->StatIotlbeLazyEvictReuse); NOREF(pThis);
    11701170        }
    11711171        Assert(pFound->PageLookup.cShift == pPageLookup->cShift);
     
    12011201        Assert(pThisR3->cCachedIotlbes > 0);
    12021202        --pThisR3->cCachedIotlbes;
    1203         STAM_COUNTER_DEC(&pThis->StatIotlbeCached);
     1203        STAM_COUNTER_DEC(&pThis->StatIotlbeCached); NOREF(pThis);
    12041204    }
    12051205    return pIotlbe;
     
    38003800    STAM_PROFILE_ADV_START(&pThis->StatProfDteLookup, a);
    38013801    int rc = iommuAmdIoPageTableWalk(pDevIns, uIovaPage, fPerm, pAux->uDeviceId, pAux->pDte, pAux->enmOp, pPageLookup);
    3802     STAM_PROFILE_ADV_STOP(&pThis->StatProfDteLookup, a);
     3802    STAM_PROFILE_ADV_STOP(&pThis->StatProfDteLookup, a); NOREF(pThis);
    38033803    return rc;
    38043804}
     
    39623962                        Assert(cbContiguous > 0 && cbContiguous < cbAccess);
    39633963                        rc = VINF_SUCCESS;
    3964                         STAM_COUNTER_INC(&pThis->StatAccessDteNonContig);
     3964                        STAM_COUNTER_INC(&pThis->StatAccessDteNonContig); NOREF(pThis);
    39653965                    }
    39663966
     
    41964196 * @param   penmOp      Where to store the IOMMU operation.
    41974197 * @param   pfPerm      Where to store the IOMMU I/O permission.
    4198  * @param   pStatRead   The stat counter to increment for a read operation.
    4199  * @param   pStatWrite  The stat counter to increment for a write operation.
    4200  */
    4201 DECLINLINE(void) iommuAmdMemAccessGetPermAndOp(uint32_t fFlags, PIOMMUOP penmOp, uint8_t *pfPerm, PSTAMCOUNTER pStatRead,
    4202                                                PSTAMCOUNTER pStatWrite)
     4198 * @param   fBulk       Whether this is a bulk read or write.
     4199 */
     4200DECLINLINE(void) iommuAmdMemAccessGetPermAndOp(uint32_t fFlags, PIOMMUOP penmOp, uint8_t *pfPerm, bool fBulk)
    42034201{
    42044202    if (fFlags & PDMIOMMU_MEM_F_WRITE)
     
    42064204        *penmOp = IOMMUOP_MEM_WRITE;
    42074205        *pfPerm = IOMMU_IO_PERM_WRITE;
    4208         STAM_COUNTER_INC(pStatWrite);
     4206#ifdef VBOX_WITH_STATISTICS
     4207        if (!fBulk)
     4208            STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemRead));
     4209        else
     4210            STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemBulkRead));
     4211#else
     4212        RT_NOREF(fBulk);
     4213#endif
    42094214    }
    42104215    else
     
    42134218        *penmOp = IOMMUOP_MEM_READ;
    42144219        *pfPerm = IOMMU_IO_PERM_READ;
    4215         STAM_COUNTER_INC(pStatRead);
     4220#ifdef VBOX_WITH_STATISTICS
     4221        if (!fBulk)
     4222            STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemWrite));
     4223        else
     4224            STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemBulkWrite));
     4225#else
     4226        RT_NOREF(fBulk);
     4227#endif
    42164228    }
    42174229}
     
    42484260        IOMMUOP enmOp;
    42494261        uint8_t fPerm;
    4250         iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, &pThis->CTX_SUFF_Z(StatMemRead), &pThis->CTX_SUFF_Z(StatMemWrite));
     4262        iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, false /* fBulk */);
    42514263        LogFlowFunc(("%s: uDevId=%#x uIova=%#RX64 cb=%zu\n", iommuAmdMemAccessGetPermName(fPerm), uDevId, uIova, cbAccess));
     4264        NOREF(pThis);
    42524265
    42534266        int rc;
     
    42574270        if (rc == VINF_SUCCESS)
    42584271        {
    4259             /* Entire access was cached and permissions were valid. */
     4272            /* All pages in the access were found in the cache with sufficient permissions. */
    42604273            Assert(*pcbContiguous == cbAccess);
    42614274            Assert(*pGCPhysSpa != NIL_RTGCPHYS);
     
    42674280        else
    42684281        {
    4269             /* Access stopped when translations resulted in non-contiguous memory, let caller resume access. */
     4282            /* Access stopped since translations resulted in non-contiguous memory, let caller resume access. */
    42704283            Assert(*pcbContiguous > 0 && *pcbContiguous < cbAccess);
    42714284            STAM_COUNTER_INC(&pThis->StatAccessCacheNonContig);
     
    42814294        uIova    += *pcbContiguous;
    42824295        cbAccess -= *pcbContiguous;
    4283         /* FYI: We currently would be also be including permission denied as cache misses too.*/
     4296        /* We currently are including any permission denied pages as cache misses too.*/
    42844297        STAM_COUNTER_INC(&pThis->StatAccessCacheMiss);
    42854298#endif
     
    43354348        IOMMUOP enmOp;
    43364349        uint8_t fPerm;
    4337         iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, &pThis->CTX_SUFF_Z(StatMemBulkRead),
    4338                                       &pThis->CTX_SUFF_Z(StatMemBulkWrite));
     4350        iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, true /* fBulk */);
    43394351        LogFlowFunc(("%s: uDevId=%#x cIovas=%zu\n", iommuAmdMemAccessGetPermName(fPerm), uDevId, cIovas));
    43404352
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