VirtualBox

Changeset 88580 in vbox


Ignore:
Timestamp:
Apr 19, 2021 3:52:45 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143878
Message:

Intel IOMMU: bugref:9967 PDM: Interface for sending MSI directly from the IOMMU device.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r88567 r88580  
    15181518    DECLR0CALLBACKMEMBER(bool,  pfnLockIsOwner,(PPDMDEVINS pDevIns));
    15191519
     1520    /**
     1521     * Send an MSI (when generated by the IOMMU device itself).
     1522     *
     1523     * @param   pDevIns         PCI device instance.
     1524     * @param   pMsi            The MSI to send.
     1525     * @param   uTagSrc         The IRQ tag and source (for tracing).
     1526     */
     1527    DECLR0CALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
     1528
    15201529    /** Just a safety precaution. */
    15211530    uint32_t                u32TheEnd;
     
    15271536
    15281537/** Current PDMIOMMUHLPR0 version number. */
    1529 #define PDM_IOMMUHLPR0_VERSION                      PDM_VERSION_MAKE(0xff13, 3, 0)
     1538#define PDM_IOMMUHLPR0_VERSION                      PDM_VERSION_MAKE(0xff13, 4, 0)
    15301539
    15311540
     
    15621571     */
    15631572    DECLRCCALLBACKMEMBER(bool,  pfnLockIsOwner,(PPDMDEVINS pDevIns));
     1573
     1574    /**
     1575     * Send an MSI (when generated by the IOMMU device itself).
     1576     *
     1577     * @param   pDevIns         PCI device instance.
     1578     * @param   pMsi            The MSI to send.
     1579     * @param   uTagSrc         The IRQ tag and source (for tracing).
     1580     */
     1581    DECLRCCALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
    15641582
    15651583    /** Just a safety precaution. */
     
    15721590
    15731591/** Current PDMIOMMUHLPRC version number. */
    1574 #define PDM_IOMMUHLPRC_VERSION                      PDM_VERSION_MAKE(0xff14, 3, 0)
     1592#define PDM_IOMMUHLPRC_VERSION                      PDM_VERSION_MAKE(0xff14, 4, 0)
    15751593
    15761594
     
    16071625     */
    16081626    DECLR3CALLBACKMEMBER(bool,  pfnLockIsOwner,(PPDMDEVINS pDevIns));
     1627
     1628    /**
     1629     * Send an MSI (when generated by the IOMMU device itself).
     1630     *
     1631     * @param   pDevIns         PCI device instance.
     1632     * @param   pMsi            The MSI to send.
     1633     * @param   uTagSrc         The IRQ tag and source (for tracing).
     1634     */
     1635    DECLR3CALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
    16091636
    16101637    /** Just a safety precaution. */
     
    16171644
    16181645/** Current PDMIOMMUHLPR3 version number. */
    1619 #define PDM_IOMMUHLPR3_VERSION                      PDM_VERSION_MAKE(0xff15, 3, 0)
     1646#define PDM_IOMMUHLPR3_VERSION                      PDM_VERSION_MAKE(0xff15, 4, 0)
    16201647
    16211648
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r88567 r88580  
    16961696}
    16971697
     1698/** @interface_method_impl{PDMIOMMUHLPR0,pfnSendMsi} */
     1699static DECLCALLBACK(int) pdmR0IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
     1700{
     1701    PDMDEV_ASSERT_DEVINS(pDevIns);
     1702    PGVM pGVM = pDevIns->Internal.s.pGVM;
     1703    if (pGVM->pdm.s.IoApic.pDevInsR0)
     1704    {
     1705        Assert(pGVM->pdm.s.IoApic.pfnSendMsiR0);
     1706        pGVM->pdm.s.IoApic.pfnSendMsiR0(pGVM->pdm.s.IoApic.pDevInsR0, NIL_PCIBDF, pMsi, uTagSrc);
     1707        return VINF_SUCCESS;
     1708    }
     1709
     1710    /** @todo Implement this. */
     1711    AssertMsgFailedReturn(("Queue PDM task for sending the MSI in ring-3"), VERR_IOMMU_IPE_5);
     1712}
     1713
    16981714
    16991715/**
     
    17061722    pdmR0IommuHlp_Unlock,
    17071723    pdmR0IommuHlp_LockIsOwner,
     1724    pdmR0IommuHlp_SendMsi,
    17081725    PDM_IOMMUHLPR0_VERSION, /* the end */
    17091726};
  • trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp

    r88567 r88580  
    291291
    292292
     293/** @interface_method_impl{PDMIOMMUHLPR3,pfnSendMsi} */
     294static DECLCALLBACK(int) pdmR3IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
     295{
     296    PDMDEV_ASSERT_DEVINS(pDevIns);
     297    LogFlowFunc(("caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
     298    return PDMIoApicSendMsi(pDevIns->Internal.s.pVMR3, NIL_PCIBDF, pMsi, uTagSrc);
     299}
     300
     301
    293302/**
    294303 * IOMMU Device Helpers.
     
    300309    pdmR3IommuHlp_Unlock,
    301310    pdmR3IommuHlp_LockIsOwner,
     311    pdmR3IommuHlp_SendMsi,
    302312    PDM_IOMMUHLPR3_VERSION /* the end */
    303313};
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