VirtualBox

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


Ignore:
Timestamp:
Jun 3, 2021 9:17:34 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Address translation, WIP.

File:
1 edited

Legend:

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

    r89476 r89477  
    22422242
    22432243/**
    2244  * Checks whether two consecutive I/O page results of a DMA memory request form a
    2245  * physically contiguous region.
     2244 * Checks whether two consecutive I/O page results of a DMA memory request
     2245 * translates to a physically contiguous region.
    22462246 *
    22472247 * @returns @c true if the I/O pages are contiguous, @c false otherwise.
     
    22572257    RTGCPHYS const GCPhysPrev  = pIoPagePrev->GCPhysBase;
    22582258    RTGCPHYS const GCPhys      = pIoPage->GCPhysBase;
    2259     uint64_t const offMaskPrev = X86_GET_PAGE_OFFSET_MASK(pIoPagePrev->cShift);
    2260     uint64_t const offMask     = X86_GET_PAGE_OFFSET_MASK(pIoPage->cShift);
    2261 
     2259#ifdef RT_STRICT
    22622260    /* Paranoia: Ensure offset bits are 0. */
    2263     Assert(!(GCPhysPrev & offMaskPrev));
    2264     Assert(!(GCPhys     & offMask));
    2265 
    2266     if ((GCPhysPrev & ~offMaskPrev) + cbPrev == (GCPhys & ~offMask))
    2267         return true;
    2268     return false;
     2261    {
     2262        uint64_t const fOffMaskPrev = X86_GET_PAGE_OFFSET_MASK(pIoPagePrev->cShift);
     2263        uint64_t const fOffMask     = X86_GET_PAGE_OFFSET_MASK(pIoPage->cShift);
     2264        Assert(!(GCPhysPrev & fOffMaskPrev));
     2265        Assert(!(GCPhys     & fOffMask));
     2266    }
     2267#endif
     2268    return GCPhysPrev + cbPrev == GCPhys;
    22692269}
    22702270
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