VirtualBox

Changeset 88333 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Mar 31, 2021 4:29:39 PM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 ACPI, BusAssignmentManager and ConsoleImpl2 changes for VT-d PCI device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r88310 r88333  
    209209    SYSTEM_INFO_INDEX_PREF64_MEMORY_MAX = 30,
    210210    SYSTEM_INFO_INDEX_NVME_ADDRESS      = 31, /**< First NVMe controller PCI address, or 0 */
    211     SYSTEM_INFO_INDEX_IOMMU_AMD_ADDRESS = 32, /**< AMD IOMMU PCI address, or 0 */
     211    SYSTEM_INFO_INDEX_IOMMU_ADDRESS     = 32, /**< IOMMU PCI address, or 0 */
    212212    SYSTEM_INFO_INDEX_SB_IOAPIC_ADDRESS = 33, /**< Southbridge I/O APIC (needed by AMD IOMMU) PCI address, or 0 */
    213213    SYSTEM_INFO_INDEX_END               = 34,
     
    402402    /** PCI address of the host bus controller device. */
    403403    uint32_t            u32HbcPciAddress;
    404     /** PCI address of the AMD IOMMU device. */
    405     uint32_t            u32IommuAmdPciAddress;
     404    /** PCI address of the IOMMU device. */
     405    uint32_t            u32IommuPciAddress;
    406406    /** PCI address of the southbridge I/O APIC device. */
    407407    uint32_t            u32SbIoApicPciAddress;
     
    16551655            break;
    16561656
    1657         case SYSTEM_INFO_INDEX_IOMMU_AMD_ADDRESS:
    1658             *pu32 = pThis->u32IommuAmdPciAddress;
     1657        case SYSTEM_INFO_INDEX_IOMMU_ADDRESS:
     1658            *pu32 = pThis->u32IommuPciAddress;
    16591659            break;
    16601660
     
    32203220
    32213221    uint16_t const uIommuBus = 0;
    3222     uint16_t const uIommuDev = RT_HI_U16(pThis->u32IommuAmdPciAddress);
    3223     uint16_t const uIommuFn  = RT_LO_U16(pThis->u32IommuAmdPciAddress);
     3222    uint16_t const uIommuDev = RT_HI_U16(pThis->u32IommuPciAddress);
     3223    uint16_t const uIommuFn  = RT_LO_U16(pThis->u32IommuPciAddress);
    32243224
    32253225    /* IVRS header. */
     
    33873387    VtdTable.Drhd.cbLength     = sizeof(ACPIDRHD) /* + sizeof(VtdTable.DevScope) */;
    33883388    VtdTable.Drhd.fFlags       = ACPI_DRHD_F_INCLUDE_PCI_ALL;
    3389     VtdTable.Drhd.uRegBaseAddr = VTD_MMIO_BASE_ADDR;
     3389    VtdTable.Drhd.uRegBaseAddr = VTD_MMIO_BASE_PHYSADDR;
    33903390
    33913391    /* Finally, compute checksum. */
     
    40744074                                  "|Parallel0Irq"
    40754075                                  "|Parallel1Irq"
     4076                                  "|IommuIntelEnabled"
    40764077                                  "|IommuAmdEnabled"
    4077                                   "|IommuAmdPciAddress"
     4078                                  "|IommuPciAddress"
    40784079                                  "|SbIoApicPciAddress"
    40794080                                  , "");
     
    42424243    {
    42434244        /* Query IOMMU AMD address (IOMA). */
    4244         rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IommuAmdPciAddress", &pThis->u32IommuAmdPciAddress, 0);
     4245        rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0);
    42454246        if (RT_FAILURE(rc))
    4246             return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuAmdAddress\""));
     4247            return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\""));
    42474248
    42484249        /* Query southbridge I/O APIC address (required when an AMD IOMMU is configured). */
     
    42544255        /** @todo We should eventually not assign the IOMMU at this address, see
    42554256         *        @bugref{9654#c53}. */
    4256         if (!pThis->u32IommuAmdPciAddress)
     4257        if (!pThis->u32IommuPciAddress)
    42574258            LogRel(("ACPI: Warning! AMD IOMMU assigned the PCI host bridge address.\n"));
    42584259
     
    42724273    if (RT_FAILURE(rc))
    42734274        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuIntelEnabled\""));
     4275
     4276    if (pThis->fUseIommuIntel)
     4277    {
     4278        /* Query IOMMU Intel address. */
     4279        rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0);
     4280        if (RT_FAILURE(rc))
     4281            return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\""));
     4282    }
    42744283#endif
    42754284
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