VirtualBox

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


Ignore:
Timestamp:
Jun 8, 2021 5:42:46 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Use uint16_t since the page table entity index is at most 11 bits (for all levels).

File:
1 edited

Legend:

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

    r89552 r89553  
    21622162    Assert(   pMemReqAux->fTtm == VTD_TTM_LEGACY_MODE
    21632163           || pMemReqAux->fTtm == VTD_TTM_SCALABLE_MODE);
     2164    Assert(!(pMemReqAux->GCPhysSlPt & X86_PAGE_4K_OFFSET_MASK));
    21642165
    21652166    /* Mask of valid paging entry bits. */
     
    21962197        uint8_t const cLevelShift = X86_PAGE_4K_SHIFT + (idxLevel * 9);
    21972198        {
    2198             uint64_t const idxPte         = (uAddrIn >> cLevelShift) & UINT64_C(0x1ff);
    2199             uint64_t const offPte         = idxPte << 3;
    2200             RTGCPHYS const GCPhysPtEntity = (uPtEntity & X86_PAGE_BASE_MASK) | offPte;
     2199            uint16_t const idxPte         = (uAddrIn >> cLevelShift) & UINT64_C(0x1ff);
     2200            uint16_t const offPte         = idxPte << 3;
     2201            RTGCPHYS const GCPhysPtEntity = (uPtEntity & X86_PAGE_4K_BASE_MASK) | offPte;
    22012202            int const rc = PDMDevHlpPhysReadMeta(pDevIns, GCPhysPtEntity, &uPtEntity, sizeof(uPtEntity));
    22022203            if (RT_SUCCESS(rc))
     
    24662467                                            pMemReqAux->cPagingLevel = cPagingLevel;
    24672468                                            pMemReqAux->GCPhysSlPt   = uCtxEntryQword0 & VTD_BF_0_CONTEXT_ENTRY_SLPTPTR_MASK;
    2468                                             Assert(!(pMemReqAux->GCPhysSlPt & X86_PAGE_OFFSET_MASK));
    24692469                                            return dmarDrMemRangeLookup(pDevIns, dmarDrSecondLevelTranslate, pMemReqRemap);
    24702470                                        }
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