VirtualBox

Changeset 88581 in vbox for trunk/src


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

Intel IOMMU: bugref:9967 DevIoApic: Don't try to remap MSIs generated by the IOMMU itself (for upcoming changes).

File:
1 edited

Legend:

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

    r86927 r88581  
    914914    RT_ZERO(ApicIntr);
    915915
    916 #ifdef VBOX_WITH_IOMMU_AMD
     916#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    917917    /*
    918918     * The MSI may need to be remapped (or discarded) if an IOMMU is present.
     919     *
     920     * If the Bus:Dev:Fn isn't valid, it is ASSUMED the device generating the
     921     * MSI is the IOMMU itself and hence is not subject to remapping.
    919922     */
    920     MSIMSG MsiOut;
    921     RT_ZERO(MsiOut);
    922     Assert(PCIBDF_IS_VALID(uBusDevFn));
    923     int rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, uBusDevFn, pMsi, &MsiOut);
    924     if (RT_SUCCESS(rcRemap))
     923    if (PCIBDF_IS_VALID(uBusDevFn))
    925924    {
    926         STAM_COUNTER_INC(&pThis->StatIommuRemappedMsi);
    927         ioapicGetApicIntrFromMsi(&MsiOut, &ApicIntr);
     925        MSIMSG MsiOut;
     926        RT_ZERO(MsiOut);
     927        int rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, uBusDevFn, pMsi, &MsiOut);
     928        if (RT_SUCCESS(rcRemap))
     929        {
     930            STAM_COUNTER_INC(&pThis->StatIommuRemappedMsi);
     931            ioapicGetApicIntrFromMsi(&MsiOut, &ApicIntr);
     932        }
     933        else
     934        {
     935            STAM_COUNTER_INC(&pThis->StatIommuDiscardedMsi);
     936            Log(("IOAPIC: MSI (Addr=%#RX64 Data=%#RX32) remapping failed. rc=%Rrc", pMsi->Addr.u64, pMsi->Data.u32, rcRemap));
     937            return;
     938        }
    928939    }
    929940    else
    930     {
    931         STAM_COUNTER_INC(&pThis->StatIommuDiscardedMsi);
    932         Log(("IOAPIC: MSI (Addr=%#RX64 Data=%#RX32) remapping failed. rc=%Rrc", pMsi->Addr.u64, pMsi->Data.u32, rcRemap));
    933         return;
    934     }
     941        ioapicGetApicIntrFromMsi(pMsi, &ApicIntr);
    935942#else
    936943    NOREF(uBusDevFn);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette