VirtualBox

Ignore:
Timestamp:
Sep 9, 2020 9:50:01 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140287
Message:

AMD IOMMU: bugref:9654 Fix accidentally not copying/initialize MSIMSG values. Fix using the translated memory address on
successful translations from the IOMMU. Fix not remapping any interrupt when IOMMU code is compiled but an IOMMU is not present.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp

    r85861 r86070  
    166166        uint16_t const uDeviceId = PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn);
    167167        int rc = pIommu->pfnMemRead(pDevInsIommu, uDeviceId, GCPhys, cbRead, &GCPhysOut);
    168         if (RT_FAILURE(rc))
     168        if (RT_SUCCESS(rc))
     169            GCPhys = GCPhysOut;
     170        else
    169171        {
    170172            Log(("pdmR0DevHlp_PCIPhysRead: IOMMU translation failed. uDeviceId=%#x GCPhys=%#RGp cb=%u rc=%Rrc\n", uDeviceId,
     
    218220        uint16_t const uDeviceId = PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn);
    219221        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDeviceId, GCPhys, cbWrite, &GCPhysOut);
    220         if (RT_FAILURE(rc))
     222        if (RT_SUCCESS(rc))
     223            GCPhys = GCPhysOut;
     224        else
    221225        {
    222226            Log(("pdmR0DevHlp_PCIPhysWrite: IOMMU translation failed. uDeviceId=%#x GCPhys=%#RGp cb=%u rc=%Rrc\n", uDeviceId,
     
    15691573                        ("pdmR0IoApicHlp_IommuMsiRemap: pfnMsiRemap invalid!\n"), VERR_INVALID_POINTER);
    15701574        int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDevId, pMsiIn, pMsiOut);
    1571         if (RT_FAILURE(rc))
    1572         {
    1573             Log(("pdmR0IoApicHlp_IommuMsiRemap: IOMMU MSI remap failed. uDevId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n",
    1574                  uDevId, pMsiIn->Addr.u64, pMsiIn->Data.u32, rc));
     1575        if (RT_SUCCESS(rc))
    15751576            return rc;
    1576         }
     1577
     1578        Log(("pdmR0IoApicHlp_IommuMsiRemap: IOMMU MSI remap failed. uDevId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n",
     1579             uDevId, pMsiIn->Addr.u64, pMsiIn->Data.u32, rc));
    15771580    }
    15781581#else
    15791582    RT_NOREF(pDevIns, uDevId);
     1583#endif
     1584
    15801585    *pMsiOut = *pMsiIn;
    1581 #endif
    15821586    return VINF_SUCCESS;
    15831587}
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