VirtualBox

Changeset 89538 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 7, 2021 4:07:22 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144896
Message:

Intel IOMMU: bugref:9967 nits.

File:
1 edited

Legend:

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

    r89537 r89538  
    556556    uint8_t             afPadding[5];
    557557    /** The first-level page-table pointer.  */
    558     uint64_t            uFlptPtr;
     558    uint64_t            uFlPtPtr;
    559559    /** The second-level page-table pointer.  */
    560     uint64_t            uSlptPtr;
     560    uint64_t            uSlPtPtr;
    561561} DMARMEMREQAUX;
    562562/** Pointer to a DMA memory request output. */
     
    21102110
    21112111/**
    2112  * Reads a second-level paging entry from guest memory.
     2112 * Reads a second-level page-table pointer from guest memory.
    21132113 *
    21142114 * @returns VBox status code.
    21152115 * @param   pDevIns         The IOMMU device instance.
    2116  * @param   GCPhysSlptPtr   The physical address of the SLPTPTR.
     2116 * @param   GCPhysSlPtPtr   The physical address of the SLPTPTR.
    21172117 * @param   pSlpEntry       Where to store the read SLPTPTR.
    21182118 */
    2119 static int dmarDrReadSlpPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhysSlptPtr, PVTD_SLP_ENTRY_T pSlpEntry)
    2120 {
    2121     /* We don't verify bits 63:HAW of GCPhysSlptPtr is 0 since reading from such an address should fail anyway. */
    2122     return PDMDevHlpPhysReadMeta(pDevIns, GCPhysSlptPtr, pSlpEntry, sizeof(*pSlpEntry));
     2119static int dmarDrReadSecondLevelPtPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhysSlPtPtr, PVTD_SLP_ENTRY_T pSlpEntry)
     2120{
     2121    /* We don't verify bits 63:HAW of GCPhysSlPtPtr is 0 since reading from such an address should fail anyway. */
     2122    return PDMDevHlpPhysReadMeta(pDevIns, GCPhysSlPtPtr, pSlpEntry, sizeof(*pSlpEntry));
    21232123}
    21242124
     
    22032203     * Unlike AMD IOMMU paging, here there is no feature for "skipping" levels.
    22042204     */
    2205     uint64_t uPtEntity   = pMemReqAux->uSlptPtr;
     2205    uint64_t uPtEntity   = pMemReqAux->uSlPtPtr;
    22062206    int8_t   iLevel      = pMemReqAux->cPagingLevel - 1;
    22072207    uint8_t  cLevelShift = X86_PAGE_4K_SHIFT + (iLevel * 9);
     
    24802480                                        {
    24812481                                            /* Read the SLPTPTR from guest memory. */
    2482                                             VTD_SLP_ENTRY_T SlptPtr;
    2483                                             RTGCPHYS const GCPhysSlptPtr = uCtxEntryQword0 & VTD_BF_0_CONTEXT_ENTRY_SLPTPTR_MASK;
    2484                                             rc = dmarDrReadSlpPtr(pDevIns, GCPhysSlptPtr, &SlptPtr);
     2482                                            VTD_SLP_ENTRY_T SlPtPtr;
     2483                                            RTGCPHYS const GCPhysSlPtPtr = uCtxEntryQword0 & VTD_BF_0_CONTEXT_ENTRY_SLPTPTR_MASK;
     2484                                            rc = dmarDrReadSecondLevelPtPtr(pDevIns, GCPhysSlPtPtr, &SlPtPtr);
    24852485                                            if (RT_SUCCESS(rc))
    24862486                                            {
    24872487                                                /* Finally... perform second-level translation. */
    2488                                                 pMemReqAux->uSlptPtr     = SlptPtr;
     2488                                                pMemReqAux->uSlPtPtr     = SlPtPtr;
    24892489                                                pMemReqAux->cPagingLevel = cPagingLevel;
    24902490                                                return dmarDrMemRangeLookup(pDevIns, dmarDrSecondLevelTranslate, pMemReqRemap);
     
    31233123    /*
    31243124     * The below check is redundant since we check both TTM and DW for each
    3125      * descriptor type we process. However, the order errors reported by hardware
     3125     * descriptor type we process. However, the order of errors reported by hardware
    31263126     * may differ hence this is kept commented out but not removed if we need to
    31273127     * change this in the future.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette