VirtualBox

Changeset 86070 in vbox for trunk/src/VBox/VMM/VMMR0


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.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 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}
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlpTracing.cpp

    r85126 r86070  
    327327        uint16_t const uDeviceId = PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn);
    328328        int rc = pIommu->pfnMemRead(pDevInsIommu, uDeviceId, GCPhys, cbRead, &GCPhysOut);
    329         if (RT_FAILURE(rc))
     329        if (RT_SUCCESS(rc))
     330            GCPhys = GCPhysOut;
     331        else
    330332        {
    331333            Log(("pdmR0DevHlp_PCIPhysRead: IOMMU translation failed. uDeviceId=%#x GCPhys=%#RGp cb=%u rc=%Rrc\n", uDeviceId,
     
    379381        uint16_t const uDeviceId = PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn);
    380382        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDeviceId, GCPhys, cbWrite, &GCPhysOut);
    381         if (RT_FAILURE(rc))
     383        if (RT_SUCCESS(rc))
     384            GCPhys = GCPhysOut;
     385        else
    382386        {
    383387            Log(("pdmR0DevHlp_PCIPhysWrite: IOMMU translation failed. uDeviceId=%#x GCPhys=%#RGp cb=%u rc=%Rrc\n", uDeviceId,
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