VirtualBox

Changeset 88638 in vbox for trunk/src/VBox/VMM/VMMR3


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.

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r88565 r88638  
    18701870#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    18711871    int rc = pdmIommuMemAccessRead(pDevIns, pPciDev, GCPhys, pvBuf, cbRead, fFlags);
    1872     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     1872    if (   rc == VERR_IOMMU_NOT_PRESENT
     1873        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     1874    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     1875    else
    18731876        return rc;
    18741877#endif
     
    19041907#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    19051908    int rc = pdmIommuMemAccessWrite(pDevIns, pPciDev, GCPhys, pvBuf, cbWrite, fFlags);
    1906     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     1909    if (   rc == VERR_IOMMU_NOT_PRESENT
     1910        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     1911    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     1912    else
    19071913        return rc;
    19081914#endif
     
    19351941#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    19361942    int rc = pdmR3IommuMemAccessWriteCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);
    1937     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     1943    if (   rc == VERR_IOMMU_NOT_PRESENT
     1944        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     1945    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     1946    else
    19381947        return rc;
    19391948#endif
     
    19661975#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    19671976    int rc = pdmR3IommuMemAccessReadCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);
    1968     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     1977    if (   rc == VERR_IOMMU_NOT_PRESENT
     1978        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     1979    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     1980    else
    19691981        return rc;
    19701982#endif
     
    19982010#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    19992011    int rc = pdmR3IommuMemAccessBulkWriteCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);
    2000     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     2012    if (   rc == VERR_IOMMU_NOT_PRESENT
     2013        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     2014    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     2015    else
    20012016        return rc;
    20022017#endif
     
    20302045#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    20312046    int rc = pdmR3IommuMemAccessBulkReadCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);
    2032     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     2047    if (   rc == VERR_IOMMU_NOT_PRESENT
     2048        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     2049    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     2050    else
    20332051        return rc;
    20342052#endif
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlpTracing.cpp

    r87477 r88638  
    420420#ifdef VBOX_WITH_IOMMU_AMD
    421421    int rc = pdmIommuMemAccessRead(pDevIns, pPciDev, GCPhys, pvBuf, cbRead, fFlags);
    422     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     422    if (   rc == VERR_IOMMU_NOT_PRESENT
     423        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     424    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     425    else
    423426        return rc;
    424427#endif
     
    454457#ifdef VBOX_WITH_IOMMU_AMD
    455458    int rc = pdmIommuMemAccessWrite(pDevIns, pPciDev, GCPhys, pvBuf, cbWrite, fFlags);
    456     if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT)
     459    if (   rc == VERR_IOMMU_NOT_PRESENT
     460        || rc == VERR_IOMMU_CANNOT_CALL_SELF)
     461    { /* likely - ASSUMING most VMs won't be configured with an IOMMU. */ }
     462    else
    457463        return rc;
    458464#endif
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