VirtualBox

Changeset 89200 in vbox


Ignore:
Timestamp:
May 20, 2021 2:05:10 PM (4 years ago)
Author:
vboxsync
Message:

Intel IOMMU: bugref:9967 Add ring-3 MSI queuing for the IOMMU send MSI interface as well. Added a todo for later.

Location:
trunk
Files:
4 edited

Legend:

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

    r89069 r89200  
    15251525     * @param   uTagSrc         The IRQ tag and source (for tracing).
    15261526     */
    1527     DECLR0CALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
     1527    DECLR0CALLBACKMEMBER(void,  pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
    15281528
    15291529    /** Just a safety precaution. */
     
    15361536
    15371537/** Current PDMIOMMUHLPR0 version number. */
    1538 #define PDM_IOMMUHLPR0_VERSION                      PDM_VERSION_MAKE(0xff13, 4, 0)
     1538#define PDM_IOMMUHLPR0_VERSION                      PDM_VERSION_MAKE(0xff13, 5, 0)
    15391539
    15401540
     
    15791579     * @param   uTagSrc         The IRQ tag and source (for tracing).
    15801580     */
    1581     DECLRCCALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
     1581    DECLRCCALLBACKMEMBER(void,  pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
    15821582
    15831583    /** Just a safety precaution. */
     
    15901590
    15911591/** Current PDMIOMMUHLPRC version number. */
    1592 #define PDM_IOMMUHLPRC_VERSION                      PDM_VERSION_MAKE(0xff14, 4, 0)
     1592#define PDM_IOMMUHLPRC_VERSION                      PDM_VERSION_MAKE(0xff14, 5, 0)
    15931593
    15941594
     
    16331633     * @param   uTagSrc         The IRQ tag and source (for tracing).
    16341634     */
    1635     DECLR3CALLBACKMEMBER(int,   pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
     1635    DECLR3CALLBACKMEMBER(void,  pfnSendMsi,(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc));
    16361636
    16371637    /** Just a safety precaution. */
     
    16441644
    16451645/** Current PDMIOMMUHLPR3 version number. */
    1646 #define PDM_IOMMUHLPR3_VERSION                      PDM_VERSION_MAKE(0xff15, 4, 0)
     1646#define PDM_IOMMUHLPR3_VERSION                      PDM_VERSION_MAKE(0xff15, 5, 0)
    16471647
    16481648
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r88562 r89200  
    224224 * @param   pMsi        The MSI to send.
    225225 * @param   uTagSrc     The IRQ tag and source tracer ID.
     226 *
     227 * @remarks Atm, don't call this from ring-0. Use the respective R0 device helpers
     228 *          instead.
    226229 */
    227230VMM_INT_DECL(int) PDMIoApicSendMsi(PVM pVM, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc)
    228231{
     232    /** @todo We should somehow move/make this to ring-3 only, as in ring-0, the helper
     233     *        code handles queuing the MSI to be sent from ring-3 when I/O APIC isn't
     234     *        available in R0. When this TODO is done, remove the remark in the doxygen
     235     *        above. */
    229236    Assert(PCIBDF_IS_VALID(uBusDevFn));
    230237    if (pVM->pdm.s.IoApic.CTX_SUFF(pDevIns))
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r89069 r89200  
    16261626
    16271627
    1628 /** @interface_method_impl{PDMPCIHLPR0,pfnIoApicSendMsi} */
    1629 static DECLCALLBACK(void) pdmR0PciHlp_IoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc)
    1630 {
    1631     PDMDEV_ASSERT_DEVINS(pDevIns);
    1632     Assert(PCIBDF_IS_VALID(uBusDevFn));
    1633     Log4(("pdmR0PciHlp_IoApicSendMsi: uBusDevFn=%#x Msi=(Addr:%#RX64 Data:%#RX32) uTagSrc=%#x\n", uBusDevFn, pMsi->Addr.u64,
    1634           pMsi->Data.u32, uTagSrc));
     1628/**
     1629 * Helper for sending an MSI via the I/O APIC.
     1630 *
     1631 * @param   pDevIns     PCI device instance.
     1632 * @param   uBusDevFn   The bus:device:function of the device initiating the MSI.
     1633 * @param   pMsi        The MSI to send.
     1634 * @param   uTagSrc     The IRQ tag and source (for tracing).
     1635 */
     1636static void pdmR0IoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc)
     1637{
    16351638    PGVM pGVM = pDevIns->Internal.s.pGVM;
    16361639    if (pGVM->pdm.s.IoApic.pDevInsR0)
     
    16561659
    16571660
     1661/** @interface_method_impl{PDMPCIHLPR0,pfnIoApicSendMsi} */
     1662static DECLCALLBACK(void) pdmR0PciHlp_IoApicSendMsi(PPDMDEVINS pDevIns, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uTagSrc)
     1663{
     1664    PDMDEV_ASSERT_DEVINS(pDevIns);
     1665    Assert(PCIBDF_IS_VALID(uBusDevFn));
     1666    Log4(("pdmR0PciHlp_IoApicSendMsi: uBusDevFn=%#x Msi=(Addr:%#RX64 Data:%#RX32) uTagSrc=%#x\n", uBusDevFn, pMsi->Addr.u64,
     1667          pMsi->Data.u32, uTagSrc));
     1668    pdmR0IoApicSendMsi(pDevIns, uBusDevFn, pMsi, uTagSrc);
     1669}
     1670
     1671
    16581672/** @interface_method_impl{PDMPCIHLPR0,pfnLock} */
    16591673static DECLCALLBACK(int) pdmR0PciHlp_Lock(PPDMDEVINS pDevIns, int rc)
     
    17311745
    17321746/** @interface_method_impl{PDMIOMMUHLPR0,pfnSendMsi} */
    1733 static DECLCALLBACK(int) pdmR0IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
    1734 {
    1735     PDMDEV_ASSERT_DEVINS(pDevIns);
    1736     PGVM pGVM = pDevIns->Internal.s.pGVM;
    1737     if (pGVM->pdm.s.IoApic.pDevInsR0)
    1738     {
    1739         Assert(pGVM->pdm.s.IoApic.pfnSendMsiR0);
    1740         pGVM->pdm.s.IoApic.pfnSendMsiR0(pGVM->pdm.s.IoApic.pDevInsR0, NIL_PCIBDF, pMsi, uTagSrc);
    1741         return VINF_SUCCESS;
    1742     }
    1743 
    1744     /** @todo Implement this. */
    1745     AssertMsgFailedReturn(("Queue PDM task for sending the MSI in ring-3"), VERR_IOMMU_IPE_5);
     1747static DECLCALLBACK(void) pdmR0IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
     1748{
     1749    PDMDEV_ASSERT_DEVINS(pDevIns);
     1750    pdmR0IoApicSendMsi(pDevIns, NIL_PCIBDF, pMsi, uTagSrc);
    17461751}
    17471752
  • trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp

    r89065 r89200  
    299299
    300300/** @interface_method_impl{PDMIOMMUHLPR3,pfnSendMsi} */
    301 static DECLCALLBACK(int) pdmR3IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
     301static DECLCALLBACK(void) pdmR3IommuHlp_SendMsi(PPDMDEVINS pDevIns, PCMSIMSG pMsi, uint32_t uTagSrc)
    302302{
    303303    PDMDEV_ASSERT_DEVINS(pDevIns);
    304304    LogFlowFunc(("caller='%s'/%d:\n", pDevIns->pReg->szName, pDevIns->iInstance));
    305     return PDMIoApicSendMsi(pDevIns->Internal.s.pVMR3, NIL_PCIBDF, pMsi, uTagSrc);
     305    PDMIoApicSendMsi(pDevIns->Internal.s.pVMR3, NIL_PCIBDF, pMsi, uTagSrc);
    306306}
    307307
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