VirtualBox

Changeset 88535 in vbox


Ignore:
Timestamp:
Apr 15, 2021 12:18:52 PM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 WIP.

File:
1 edited

Legend:

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

    r88521 r88535  
    6060 *  minimum number of registers (which is 1).
    6161 *
    62  *  See Intel VT-d spec. 10.4.2 "Capability Register" (CAP_REG::NFR). */
     62 *  See Intel VT-d spec. 10.4.2 "Capability Register" (CAP_REG.NFR). */
    6363#define DMAR_FRCD_REG_COUNT                         UINT32_C(1)
    6464
     
    9090#define DMAR_MMIO_GROUP_1_SIZE                      (DMAR_MMIO_GROUP_1_OFF_END - DMAR_MMIO_GROUP_1_OFF_FIRST)
    9191
     92/** DMAR implementation's major version number (exposed to software).
     93 *  We report 6 as the major version since we support queued invalidations as
     94 *  software may make assumptions based on that.
     95 *
     96 *  See Intel VT-d spec. 10.4.7 "Context Command Register" (CCMD_REG.CAIG). */
     97#define DMAR_VER_MAJOR                              6
    9298/** DMAR implementation's minor version number (exposed to software). */
    9399#define DMAR_VER_MINOR                              0
    94 /** DMAR implementation's major version number (exposed to software). */
    95 #define DMAR_VER_MAJOR                              1
    96100/** @} */
    97101
     
    125129    /** @name Register copies for a tiny bit faster and more convenient access.
    126130     *  @{ */
     131    /** Copy of VER_REG. */
     132    uint8_t                     uVerReg;
     133    /** Alignment. */
     134    uint8_t                     abPadding[7];
    127135    /** Copy of CAP_REG. */
    128136    uint64_t                    fCap;
     
    860868    /* VER_REG */
    861869    {
    862         uint8_t const uVer = RT_BF_MAKE(VTD_BF_VER_REG_MIN, DMAR_VER_MINOR)
    863                            | RT_BF_MAKE(VTD_BF_VER_REG_MAX, DMAR_VER_MAJOR);
    864         dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_VER_REG, uVer);
     870        pThis->uVerReg = RT_BF_MAKE(VTD_BF_VER_REG_MIN, DMAR_VER_MINOR)
     871                       | RT_BF_MAKE(VTD_BF_VER_REG_MAX, DMAR_VER_MAJOR);
     872        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_VER_REG, pThis->uVerReg);
    865873    }
    866874
     
    907915                    | RT_BF_MAKE(VTD_BF_CAP_REG_MAMV,    fPsi & fMamv)
    908916                    | RT_BF_MAKE(VTD_BF_CAP_REG_DWD,     1)
     917                    | RT_BF_MAKE(VTD_BF_CAP_REG_DRD,     1)
    909918                    | RT_BF_MAKE(VTD_BF_CAP_REG_FL1GP,   fFlts & fFl1gp)
    910919                    | RT_BF_MAKE(VTD_BF_CAP_REG_PI,      0)     /* Posted Interrupts not supported. */
     
    11221131     * Log some of the features exposed to software.
    11231132     */
    1124     uint32_t const uVerReg         = dmarRegRead32(pThis, VTD_MMIO_OFF_VER_REG);
     1133    uint32_t const uVerReg         = pThis->uVerReg;
    11251134    uint8_t const  cMaxGstAddrBits = RT_BF_GET(pThis->fCap, VTD_BF_CAP_REG_MGAW) + 1;
    11261135    uint8_t const  cSupGstAddrBits = vtdCapRegGetSagawBits(RT_BF_GET(pThis->fCap, VTD_BF_CAP_REG_SAGAW));
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