VirtualBox

Changeset 84677 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jun 4, 2020 1:12:06 PM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Add I/O APIC PDM helper for talking to the IOMMU for remapping MSIs and related bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r84459 r84677  
    15581558
    15591559
     1560/** @interface_method_impl{PDMIOAPICHLP,pfnIommuMsiRemap} */
     1561static DECLCALLBACK(int) pdmR0IoApicHlp_IommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDevId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)
     1562{
     1563    PDMDEV_ASSERT_DEVINS(pDevIns);
     1564    LogFlow(("pdmR0IoApicHlp_IommuMsiRemap: caller='%s'/%d: pMsiIn=(%#RX64, %#RU32)\n", pDevIns->pReg->szName,
     1565             pDevIns->iInstance, pMsiIn->Addr.u64, pMsiIn->Data.u32));
     1566
     1567#ifdef VBOX_WITH_IOMMU_AMD
     1568    /** @todo IOMMU: Optimize/re-organize things here later. */
     1569    PGVM        pGVM         = pDevIns->Internal.s.pGVM;
     1570    PPDMIOMMUR0 pIommu       = &pGVM->pdmr0.s.aIommus[0];
     1571    PPDMDEVINS  pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
     1572    if (   pDevInsIommu
     1573        && pDevInsIommu != pDevIns)
     1574    {
     1575        int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDevId, pMsiIn, pMsiOut);
     1576        if (RT_FAILURE(rc))
     1577        {
     1578            Log(("pdmR0IoApicHlp_IommuMsiRemap: IOMMU MSI remap failed. uDevId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n",
     1579                 uDevId, pMsiIn->Addr.u64, pMsiIn->Data.u32, rc));
     1580            return rc;
     1581        }
     1582    }
     1583#else
     1584    *pMsiOut = *pMsiIn;
     1585#endif
     1586    return VINF_SUCCESS;
     1587}
     1588
     1589
    15601590/**
    15611591 * The Ring-0 I/O APIC Helper Callbacks.
     
    15671597    pdmR0IoApicHlp_Lock,
    15681598    pdmR0IoApicHlp_Unlock,
     1599    pdmR0IoApicHlp_IommuMsiRemap,
    15691600    PDM_IOAPICHLP_VERSION
    15701601};
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