VirtualBox

Changeset 89496 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 4, 2021 7:38:36 AM (4 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Assert rather than zero out bits that are already supposed to be zero.

File:
1 edited

Legend:

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

    r89067 r89496  
    810810    RTGCPHYS const GCPhysPrev  = pPageLookupPrev->GCPhysSpa;
    811811    RTGCPHYS const GCPhys      = pPageLookup->GCPhysSpa;
    812     uint64_t const offMaskPrev = IOMMU_GET_PAGE_OFF_MASK(pPageLookupPrev->cShift);
    813     uint64_t const offMask     = IOMMU_GET_PAGE_OFF_MASK(pPageLookup->cShift);
    814 
     812#ifdef RT_STRICT
    815813    /* Paranoia: Ensure offset bits are 0. */
    816     Assert(!(GCPhysPrev & offMaskPrev));
    817     Assert(!(GCPhys     & offMask));
    818 
    819     if ((GCPhysPrev & ~offMaskPrev) + cbPrev == (GCPhys & ~offMask))
    820         return true;
    821     return false;
     814    {
     815        uint64_t const fOffMaskPrev = IOMMU_GET_PAGE_OFF_MASK(pPageLookupPrev->cShift);
     816        uint64_t const fOffMask     = IOMMU_GET_PAGE_OFF_MASK(pPageLookup->cShift);
     817        Assert(!(GCPhysPrev & fOffMaskPrev));
     818        Assert(!(GCPhys     & fOffMask));
     819    }
     820#endif
     821    return GCPhysPrev + cbPrev == GCPhys;
    822822}
    823823
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