VirtualBox

Changeset 84809 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 12, 2020 6:49:41 AM (5 years ago)
Author:
vboxsync
Message:

AMD IOMMU: bugref:9654 Use the proper PCI bus number. Not the Bus array index.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r84755 r84809  
    158158        && pDevInsIommu != pDevIns)
    159159    {
     160        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     161        Assert(idxBus < RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses));
     162        PPDMPCIBUSR0 pBus = &pGVM->pdmr0.s.aPciBuses[idxBus];
     163
    160164        RTGCPHYS GCPhysOut;
    161         uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     165        uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    162166        int rc = pIommu->pfnMemRead(pDevInsIommu, uDeviceId, GCPhys, cbRead, &GCPhysOut);
    163167        if (RT_FAILURE(rc))
     
    206210        && pDevInsIommu != pDevIns)
    207211    {
     212        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     213        Assert(idxBus < RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses));
     214        PPDMPCIBUSR0 pBus = &pGVM->pdmr0.s.aPciBuses[idxBus];
     215
    208216        RTGCPHYS GCPhysOut;
    209         uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     217        uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    210218        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDeviceId, GCPhys, cbWrite, &GCPhysOut);
    211219        if (RT_FAILURE(rc))
  • trunk/src/VBox/VMM/VMMR0/PDMR0DevHlpTracing.cpp

    r84715 r84809  
    317317        && pDevInsIommu != pDevIns)
    318318    {
     319        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     320        Assert(idxBus < RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses));
     321        PPDMPCIBUSR0 pBus = &pGVM->pdmr0.s.aPciBuses[idxBus];
     322
    319323        RTGCPHYS GCPhysOut;
    320         uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     324        uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    321325        int rc = pIommu->pfnMemRead(pDevInsIommu, uDeviceId, GCPhys, cbRead, &GCPhysOut);
    322326        if (RT_FAILURE(rc))
     
    365369        && pDevInsIommu != pDevIns)
    366370    {
     371        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     372        Assert(idxBus < RT_ELEMENTS(pGVM->pdmr0.s.aPciBuses));
     373        PPDMPCIBUSR0 pBus = &pGVM->pdmr0.s.aPciBuses[idxBus];
     374
    367375        RTGCPHYS GCPhysOut;
    368         uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     376        uint16_t const uDeviceId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    369377        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDeviceId, GCPhys, cbWrite, &GCPhysOut);
    370378        if (RT_FAILURE(rc))
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r84755 r84809  
    17991799        && pDevInsIommu != pDevIns)
    18001800    {
     1801        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     1802        Assert(idxBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses));
     1803        PPDMPCIBUS pBus = &pVM->pdm.s.aPciBuses[idxBus];
     1804
    18011805        RTGCPHYS GCPhysOut;
    1802         uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     1806        uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    18031807        int rc = pIommu->pfnMemRead(pDevInsIommu, uDevId, GCPhys, cbRead, &GCPhysOut);
    18041808        if (RT_FAILURE(rc))
     
    18471851        && pDevInsIommu != pDevIns)
    18481852    {
     1853        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     1854        Assert(idxBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses));
     1855        PPDMPCIBUS pBus = &pVM->pdm.s.aPciBuses[idxBus];
     1856
    18491857        RTGCPHYS GCPhysOut;
    1850         uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     1858        uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    18511859        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDevId, GCPhys, cbWrite, &GCPhysOut);
    18521860        if (RT_FAILURE(rc))
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlpTracing.cpp

    r84766 r84809  
    422422        && pDevInsIommu != pDevIns)
    423423    {
     424        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     425        Assert(idxBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses));
     426        PPDMPCIBUS pBus = &pVM->pdm.s.aPciBuses[idxBus];
     427
    424428        RTGCPHYS GCPhysOut;
    425         uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     429        uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    426430        int rc = pIommu->pfnMemRead(pDevInsIommu, uDevId, GCPhys, cbRead, &GCPhysOut);
    427431        if (RT_FAILURE(rc))
     
    470474        && pDevInsIommu != pDevIns)
    471475    {
     476        size_t const idxBus = pPciDev->Int.s.idxPdmBus;
     477        Assert(idxBus < RT_ELEMENTS(pVM->pdm.s.aPciBuses));
     478        PPDMPCIBUS pBus = &pVM->pdm.s.aPciBuses[idxBus];
     479
    472480        RTGCPHYS GCPhysOut;
    473         uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pPciDev->Int.s.idxPdmBus, pPciDev->uDevFn);
     481        uint16_t const uDevId = VBOX_PCI_BUSDEVFN_MAKE(pBus->iBus, pPciDev->uDevFn);
    474482        int rc = pIommu->pfnMemWrite(pDevInsIommu, uDevId, GCPhys, cbWrite, &GCPhysOut);
    475483        if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

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