VirtualBox

Changeset 88638 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 22, 2021 5:40:05 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143951
Message:

Intel IOMMU: bugref:9967 Refactor some PDM-IOMMU interfaces to differentiate between device present vs. device instance available in current context (ring-0/ring-3).
This should help us to support IOMMU as ring-3-only device in the future.
Still more work to do in that regard (PDM task queue), but one step at a time.

File:
1 edited

Legend:

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

    r88631 r88638  
    537537        ioapicGetMsiFromApicIntr(&ApicIntr, &MsiIn);
    538538        int const rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, VBOX_PCI_BDF_SB_IOAPIC, &MsiIn, &MsiOut);
    539         if (RT_SUCCESS(rcRemap))
     539        if (   rcRemap == VERR_IOMMU_NOT_PRESENT
     540            || rcRemap == VERR_IOMMU_CANNOT_CALL_SELF)
     541            MsiOut = MsiIn;
     542        else if (RT_SUCCESS(rcRemap))
    540543            STAM_COUNTER_INC(&pThis->StatIommuRemappedIntr);
    541         else if (rcRemap == VERR_IOMMU_NOT_PRESENT)
    542             MsiOut = MsiIn;
    543544        else
    544545        {
     
    924925     *
    925926     * If the Bus:Dev:Fn isn't valid, it is ASSUMED the device generating the
    926      * MSI is the IOMMU itself and hence is not subject to remapping.
     927     * MSI may be the IOMMU itself and hence is not subject to remapping.
     928     *
     929     * For AMD IOMMUs, since it's a full fledged PCI device, the BDF will be
     930     * valid but will be handled by VERR_IOMMU_CANNOT_CALL_SELF case.
    927931     */
    928932    if (PCIBDF_IS_VALID(uBusDevFn))
     
    931935        RT_ZERO(MsiOut);
    932936        int const rcRemap = pThisCC->pIoApicHlp->pfnIommuMsiRemap(pDevIns, uBusDevFn, pMsi, &MsiOut);
    933         if (RT_SUCCESS(rcRemap))
     937        if (   rcRemap == VERR_IOMMU_NOT_PRESENT
     938            || rcRemap == VERR_IOMMU_CANNOT_CALL_SELF)
     939            MsiOut = *pMsi;
     940        else if (RT_SUCCESS(rcRemap))
    934941            STAM_COUNTER_INC(&pThis->StatIommuRemappedMsi);
    935         else if (rcRemap == VERR_IOMMU_NOT_PRESENT)
    936             MsiOut = *pMsi;
    937942        else
    938943        {
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