VirtualBox

Ignore:
Timestamp:
Jul 15, 2021 5:06:04 AM (3 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Removed superfluous assertion, nits.

File:
1 edited

Legend:

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

    r90113 r90205  
    23082308    AssertPtr(pfnLookup);
    23092309
    2310     RTGCPHYS       GCPhysAddr  = NIL_RTGCPHYS;
    2311     DMARMEMREQIN   MemReqIn    = pMemReqRemap->In;
    2312     uint64_t const uAddrIn     = MemReqIn.AddrRange.uAddr;
    2313     size_t const   cbAddrIn    = MemReqIn.AddrRange.cb;
    2314     uint64_t       uAddrInBase = MemReqIn.AddrRange.uAddr & X86_PAGE_4K_BASE_MASK;
    2315     uint64_t       offAddrIn   = MemReqIn.AddrRange.uAddr & X86_PAGE_4K_OFFSET_MASK;
    2316     size_t         cbRemaining = cbAddrIn;
    2317     size_t const   cbPage      = X86_PAGE_4K_SIZE;
     2310    RTGCPHYS       GCPhysAddrOut = NIL_RTGCPHYS;
     2311    DMARMEMREQIN   MemReqIn      = pMemReqRemap->In;
     2312    uint64_t const uAddrIn       = MemReqIn.AddrRange.uAddr;
     2313    size_t const   cbAddrIn      = MemReqIn.AddrRange.cb;
     2314    uint64_t       uAddrInBase   = MemReqIn.AddrRange.uAddr & X86_PAGE_4K_BASE_MASK;
     2315    uint64_t       offAddrIn     = MemReqIn.AddrRange.uAddr & X86_PAGE_4K_OFFSET_MASK;
     2316    size_t         cbRemaining   = cbAddrIn;
     2317    size_t const   cbPage        = X86_PAGE_4K_SIZE;
    23182318
    23192319    int rc;
     
    23262326        MemReqIn.AddrRange.cb    = cbRemaining;  /* Not currently accessed by pfnLookup, but keep things consistent. */
    23272327
    2328         /* Lookup the physical page corresponding to the I/O virtual address. */
     2328        /* Lookup the physical page corresponding to the DMA virtual address. */
    23292329        DMARIOPAGE IoPage;
    23302330        rc = pfnLookup(pDevIns, &MemReqIn, &pMemReqRemap->Aux, &IoPage);
     
    23362336            Assert((IoPage.fPerm & MemReqIn.AddrRange.fPerm) == MemReqIn.AddrRange.fPerm);
    23372337
    2338             /* Store the translated address before continuing to access more pages. */
     2338            /* Store the translated address and permissions before continuing to access more pages. */
    23392339            if (cbRemaining == cbAddrIn)
    23402340            {
    2341                 uint64_t const fOffMask   = X86_GET_PAGE_OFFSET_MASK(IoPage.cShift);
    2342                 uint64_t const offAddrOut = uAddrIn & fOffMask;
    2343                 Assert(!(IoPage.GCPhysBase & fOffMask));
    2344                 GCPhysAddr = IoPage.GCPhysBase | offAddrOut;
     2341                uint64_t const offAddrOut = uAddrIn & X86_GET_PAGE_OFFSET_MASK(IoPage.cShift);
     2342                GCPhysAddrOut = IoPage.GCPhysBase | offAddrOut;
    23452343            }
    23462344            /* Check if addresses translated so far result in a physically contiguous region. */
     
    23612359            if (cbRemaining > cbPage - offAddrIn)
    23622360            {
    2363                 cbRemaining -= (cbPage - offAddrIn); /* Calculate how much more we need to access. */
    2364                 uAddrInBase += cbPage;               /* Update address of the next access. */
    2365                 offAddrIn    = 0;                    /* After first page, all pages are accessed from offset 0. */
     2361                cbRemaining -= (cbPage - offAddrIn);  /* Calculate how much more we need to access. */
     2362                uAddrInBase += cbPage;                /* Update address of the next access. */
     2363                offAddrIn    = 0;                     /* After the first page, remaining pages are accessed from offset 0. */
    23662364            }
    23672365            else
     
    23762374    }
    23772375
    2378     pMemReqRemap->Out.AddrRange.uAddr = GCPhysAddr;
     2376    pMemReqRemap->Out.AddrRange.uAddr = GCPhysAddrOut;
    23792377    pMemReqRemap->Out.AddrRange.cb    = cbAddrIn - cbRemaining;
    23802378    pMemReqRemap->Out.AddrRange.fPerm = IoPagePrev.fPerm;
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