VirtualBox

Changeset 88521 in vbox for trunk/src/VBox/Devices/Bus


Ignore:
Timestamp:
Apr 15, 2021 10:56:57 AM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Updates to adjust for changes in Oct 2020 and Apr 2021 Intel VT-d specs.

File:
1 edited

Legend:

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

    r88515 r88521  
    868868    uint8_t const fSlts  = 1;                    /* Second-Level translation support. */
    869869    uint8_t const fPt    = 1;                    /* Pass-Through support. */
     870    uint8_t const fSmts  = fFlts & fSlts & fPt;  /* Scalable mode translation support.*/
    870871    uint8_t const fNest  = 0;                    /* Nested translation support. */
    871     uint8_t const fSmts  = fFlts & fSlts & fPt;  /* Scalable mode translation support.*/
    872872
    873873    /* CAP_REG */
     
    886886                                X86_PAGE_1G_SHIFT : X86_PAGE_2M_SHIFT) - X86_PAGE_4K_SHIFT;
    887887        uint8_t const fNd     = 2;                              /* Number of domains (0=16, 1=64, 2=256, 3=1K, 4=4K, 5=16K, 6=64K,
    888                                                                   7=Reserved). */
     888                                                                   7=Reserved). */
    889889        uint8_t const fPsi    = 1;                              /* Page selective invalidation. */
    890890        uint8_t const uMgaw   = cGstPhysAddrBits - 1;           /* Maximum guest address width. */
     
    892892        uint16_t const offFro = DMAR_MMIO_OFF_FRCD_LO_REG >> 4; /* MMIO offset of FRCD registers. */
    893893
    894         pThis->fCap = RT_BF_MAKE(VTD_BF_CAP_REG_ND,     fNd)
    895                     | RT_BF_MAKE(VTD_BF_CAP_REG_AFL,    0)      /* Advanced fault logging not supported. */
    896                     | RT_BF_MAKE(VTD_BF_CAP_REG_RWBF,   0)      /* Software need not flush write-buffers. */
    897                     | RT_BF_MAKE(VTD_BF_CAP_REG_PLMR,   0)      /* Protected Low-Memory Region not supported. */
    898                     | RT_BF_MAKE(VTD_BF_CAP_REG_PHMR,   0)      /* Protected High-Memory Region not supported. */
    899                     | RT_BF_MAKE(VTD_BF_CAP_REG_CM,     1)      /** @todo Figure out if required when we impl. caching. */
    900                     | RT_BF_MAKE(VTD_BF_CAP_REG_SAGAW,  fSlts & uSagaw)
    901                     | RT_BF_MAKE(VTD_BF_CAP_REG_MGAW,   uMgaw)
    902                     | RT_BF_MAKE(VTD_BF_CAP_REG_ZLR,    1)      /** @todo Figure out if/how to support zero-length reads. */
    903                     | RT_BF_MAKE(VTD_BF_CAP_REG_FRO,    offFro)
    904                     | RT_BF_MAKE(VTD_BF_CAP_REG_SLLPS,  fSlts & fSllps)
    905                     | RT_BF_MAKE(VTD_BF_CAP_REG_PSI,    fPsi)
    906                     | RT_BF_MAKE(VTD_BF_CAP_REG_NFR,    DMAR_FRCD_REG_COUNT - 1)
    907                     | RT_BF_MAKE(VTD_BF_CAP_REG_MAMV,   fPsi & fMamv)
    908                     | RT_BF_MAKE(VTD_BF_CAP_REG_DWD,    1)
    909                     | RT_BF_MAKE(VTD_BF_CAP_REG_FL1GP,  fFlts & fFl1gp)
    910                     | RT_BF_MAKE(VTD_BF_CAP_REG_PI,     0)      /* Posted Interrupts not supported. */
    911                     | RT_BF_MAKE(VTD_BF_CAP_REG_FL5LP,  fFlts & fFl5lp);
     894        pThis->fCap = RT_BF_MAKE(VTD_BF_CAP_REG_ND,      fNd)
     895                    | RT_BF_MAKE(VTD_BF_CAP_REG_AFL,     0)     /* Advanced fault logging not supported. */
     896                    | RT_BF_MAKE(VTD_BF_CAP_REG_RWBF,    0)     /* Software need not flush write-buffers. */
     897                    | RT_BF_MAKE(VTD_BF_CAP_REG_PLMR,    0)     /* Protected Low-Memory Region not supported. */
     898                    | RT_BF_MAKE(VTD_BF_CAP_REG_PHMR,    0)     /* Protected High-Memory Region not supported. */
     899                    | RT_BF_MAKE(VTD_BF_CAP_REG_CM,      1)     /** @todo Figure out if required when we impl. caching. */
     900                    | RT_BF_MAKE(VTD_BF_CAP_REG_SAGAW,   fSlts & uSagaw)
     901                    | RT_BF_MAKE(VTD_BF_CAP_REG_MGAW,    uMgaw)
     902                    | RT_BF_MAKE(VTD_BF_CAP_REG_ZLR,     1)     /** @todo Figure out if/how to support zero-length reads. */
     903                    | RT_BF_MAKE(VTD_BF_CAP_REG_FRO,     offFro)
     904                    | RT_BF_MAKE(VTD_BF_CAP_REG_SLLPS,   fSlts & fSllps)
     905                    | RT_BF_MAKE(VTD_BF_CAP_REG_PSI,     fPsi)
     906                    | RT_BF_MAKE(VTD_BF_CAP_REG_NFR,     DMAR_FRCD_REG_COUNT - 1)
     907                    | RT_BF_MAKE(VTD_BF_CAP_REG_MAMV,    fPsi & fMamv)
     908                    | RT_BF_MAKE(VTD_BF_CAP_REG_DWD,     1)
     909                    | RT_BF_MAKE(VTD_BF_CAP_REG_FL1GP,   fFlts & fFl1gp)
     910                    | RT_BF_MAKE(VTD_BF_CAP_REG_PI,      0)     /* Posted Interrupts not supported. */
     911                    | RT_BF_MAKE(VTD_BF_CAP_REG_FL5LP,   fFlts & fFl5lp)
     912                    | RT_BF_MAKE(VTD_BF_CAP_REG_ESIRTPS, 0)     /* Whether we invalidate interrupt cache on SIRTP flow. */
     913                    | RT_BF_MAKE(VTD_BF_CAP_REG_ESRTPS,  0);    /* Whether we invalidate translation cache on SRTP flow. */
    912914        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_CAP_REG, pThis->fCap);
    913915    }
     
    921923        uint8_t const  fSrs   = 1;                              /* Supervisor request support. */
    922924        uint8_t const  fEim   = 1;                              /* Extended interrupt mode.*/
     925        uint8_t const  fAdms  = 1;                              /* Abort DMA mode support. */
    923926
    924927        pThis->fExtCap = RT_BF_MAKE(VTD_BF_ECAP_REG_C,      0)  /* Accesses don't snoop CPU cache. */
     
    937940                       | RT_BF_MAKE(VTD_BF_ECAP_REG_SRS,    fSmts & fSrs)
    938941                       | RT_BF_MAKE(VTD_BF_ECAP_REG_NWFS,   0)  /* 0 as DT not supported. */
    939                        | RT_BF_MAKE(VTD_BF_ECAP_REG_EAFS,   0)  /* 0 as PASID not supported. */
     942                       | RT_BF_MAKE(VTD_BF_ECAP_REG_EAFS,   0)  /** @todo figure out if EAFS is required? */
    940943                       | RT_BF_MAKE(VTD_BF_ECAP_REG_PSS,    0)  /* 0 as PASID not supported. */
    941944                       | RT_BF_MAKE(VTD_BF_ECAP_REG_PASID,  0)  /* PASID support. */
     
    948951                       | RT_BF_MAKE(VTD_BF_ECAP_REG_FLTS,   fFlts)
    949952                       | RT_BF_MAKE(VTD_BF_ECAP_REG_SMPWCS, 0)  /* 0 as PASID not supported. */
    950                        | RT_BF_MAKE(VTD_BF_ECAP_REG_RPS,    0); /* 0 as PASID not supported. */
     953                       | RT_BF_MAKE(VTD_BF_ECAP_REG_RPS,    0)  /* We don't support RID_PASID field in SM context entry. */
     954                       | RT_BF_MAKE(VTD_BF_ECAP_REG_ADMS,   fAdms)
     955                       | RT_BF_MAKE(VTD_BF_ECAP_REG_RPRIVS, 0); /** @todo figure out if we should/can support this? */
    951956        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_ECAP_REG, pThis->fExtCap);
    952957    }
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