VirtualBox

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


Ignore:
Timestamp:
Apr 30, 2021 12:32:28 PM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Queued Invalidation WIP. Enable ESIRTPS.

File:
1 edited

Legend:

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

    r88791 r88796  
    11971197        && (uGcmdReg & VTD_BF_GCMD_REG_SIRTP_MASK))
    11981198    {
     1199        /** @todo Perform global invalidation of all interrupt-entry cache when ESIRTPS is
     1200         *        supported. */
    11991201        pThis->uIrtaReg = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_IRTA_REG);
    12001202        dmarRegChangeRaw32(pThis, VTD_MMIO_OFF_GSTS_REG, UINT32_MAX /* fAndMask */, VTD_BF_GSTS_REG_IRTPS_MASK /* fOrMask */);
     
    12061208    if (uGcmdReg & VTD_BF_GCMD_REG_SRTP_MASK)
    12071209    {
    1208         /** @todo Perform global invalidation of all remapping translation caches. */
    1209 #if 0
    1210         if (pThis->fCapReg & VTD_BF_CAP_REG_ESRTPS_MASK)
    1211         {
    1212         }
    1213 #endif
     1210        /** @todo Perform global invalidation of all remapping translation caches when
     1211         *        ESRTPS is supported. */
    12141212        pThis->uRtaddrReg = dmarRegReadRaw64(pThis, VTD_MMIO_OFF_RTADDR_REG);
    12151213    }
     
    21112109        PDMDevHlpCpuGetGuestAddrWidths(pDevIns, &cGstPhysAddrBits, &cGstLinearAddrBits);
    21122110
    2113         uint8_t const fFl1gp  = 1;                              /* First-Level 1GB pages support. */
    2114         uint8_t const fFl5lp  = 1;                              /* First-level 5-level paging support (PML5E). */
    2115         uint8_t const fSl2mp  = fSlts & 1;                      /* Second-Level 2MB pages support. */
    2116         uint8_t const fSl2gp  = fSlts & 1;                      /* Second-Level 1GB pages support. */
    2117         uint8_t const fSllps  = fSl2mp                          /* Second-Level large page Support. */
    2118                               | ((fSl2mp & fFl1gp) & RT_BIT(1));
    2119         uint8_t const fMamv   = (fSl2gp ?                       /* Maximum address mask value (for second-level invalidations). */
    2120                                 X86_PAGE_1G_SHIFT : X86_PAGE_2M_SHIFT) - X86_PAGE_4K_SHIFT;
    2121         uint8_t const fNd     = 2;                              /* Number of domains (0=16, 1=64, 2=256, 3=1K, 4=4K, 5=16K, 6=64K,
    2122                                                                    7=Reserved). */
    2123         uint8_t const fPsi    = 1;                              /* Page selective invalidation. */
    2124         uint8_t const uMgaw   = cGstPhysAddrBits - 1;           /* Maximum guest address width. */
    2125         uint8_t const uSagaw  = vtdCapRegGetSagaw(uMgaw);       /* Supported adjust guest address width. */
    2126         uint16_t const offFro = DMAR_MMIO_OFF_FRCD_LO_REG >> 4; /* MMIO offset of FRCD registers. */
    2127         uint8_t const fEsrtps = 1;                              /* Enhanced SRTPS (flush all caches on SRTP flow). */
     2111        uint8_t const fFl1gp   = 1;                                /* First-Level 1GB pages support. */
     2112        uint8_t const fFl5lp   = 1;                                /* First-level 5-level paging support (PML5E). */
     2113        uint8_t const fSl2mp   = fSlts & 1;                        /* Second-Level 2MB pages support. */
     2114        uint8_t const fSl2gp   = fSlts & 1;                        /* Second-Level 1GB pages support. */
     2115        uint8_t const fSllps   = fSl2mp                            /* Second-Level large page Support. */
     2116                               | ((fSl2mp & fFl1gp) & RT_BIT(1));
     2117        uint8_t const fMamv    = (fSl2gp ? X86_PAGE_1G_SHIFT       /* Maximum address mask value (for 2nd-level invalidations). */
     2118                                         : X86_PAGE_2M_SHIFT)
     2119                               - X86_PAGE_4K_SHIFT;
     2120        uint8_t const fNd      = 2;                                /* Number of domains supported (0=16, 1=64, 2=256, 3=1K, 4=4K,
     2121                                                                      5=16K, 6=64K, 7=Reserved). */
     2122        uint8_t const fPsi     = 1;                                /* Page selective invalidation. */
     2123        uint8_t const uMgaw    = cGstPhysAddrBits - 1;             /* Maximum guest address width. */
     2124        uint8_t const uSagaw   = vtdCapRegGetSagaw(uMgaw);         /* Supported adjust guest address width. */
     2125        uint16_t const offFro  = DMAR_MMIO_OFF_FRCD_LO_REG >> 4;   /* MMIO offset of FRCD registers. */
     2126        uint8_t const fEsrtps  = 1;                                /* Enhanced SRTPS (auto invalidate cache on SRTP). */
     2127        uint8_t const fEsirtps = 1;                                /* Enhanced SIRTPS (auto invalidate cache on SIRTP). */
    21282128
    21292129        pThis->fCapReg = RT_BF_MAKE(VTD_BF_CAP_REG_ND,      fNd)
     
    21462146                       | RT_BF_MAKE(VTD_BF_CAP_REG_PI,      0)     /* Posted Interrupts not supported. */
    21472147                       | RT_BF_MAKE(VTD_BF_CAP_REG_FL5LP,   fFlts & fFl5lp)
    2148                        | RT_BF_MAKE(VTD_BF_CAP_REG_ESIRTPS, 0)     /* If we invalidate interrupt cache on SIRTP flow. */
     2148                       | RT_BF_MAKE(VTD_BF_CAP_REG_ESIRTPS, fEsirtps)
    21492149                       | RT_BF_MAKE(VTD_BF_CAP_REG_ESRTPS,  fEsrtps);
    21502150        dmarRegWriteRaw64(pThis, VTD_MMIO_OFF_CAP_REG, pThis->fCapReg);
     
    21532153    /* ECAP_REG */
    21542154    {
    2155         uint8_t const  fQi    = 1;                              /* Queued-invalidations. */
    2156         uint8_t const  fIr    = !!(DMAR_ACPI_DMAR_FLAGS & ACPI_DMAR_F_INTR_REMAP);  /* Interrupt remapping support. */
    2157         uint8_t const  fMhmv  = 0xf;                            /* Maximum handle mask value. */
    2158         uint16_t const offIro = DMAR_MMIO_OFF_IVA_REG >> 4;     /* MMIO offset of IOTLB registers. */
    2159         uint8_t const  fSrs   = 1;                              /* Supervisor request support. */
    2160         uint8_t const  fEim   = 1;                              /* Extended interrupt mode.*/
    2161         uint8_t const  fAdms  = 1;                              /* Abort DMA mode support. */
     2155        uint8_t const  fQi    = 1;                                 /* Queued-invalidations. */
     2156        uint8_t const  fIr    = !!(DMAR_ACPI_DMAR_FLAGS & ACPI_DMAR_F_INTR_REMAP);      /* Interrupt remapping support. */
     2157        uint8_t const  fMhmv  = 0xf;                               /* Maximum handle mask value. */
     2158        uint16_t const offIro = DMAR_MMIO_OFF_IVA_REG >> 4;        /* MMIO offset of IOTLB registers. */
     2159        uint8_t const  fSrs   = 1;                                 /* Supervisor request support. */
     2160        uint8_t const  fEim   = 1;                                 /* Extended interrupt mode.*/
     2161        uint8_t const  fAdms  = 1;                                 /* Abort DMA mode support. */
    21622162
    21632163        pThis->fExtCapReg = RT_BF_MAKE(VTD_BF_ECAP_REG_C,      0)  /* Accesses don't snoop CPU cache. */
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