VirtualBox

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


Ignore:
Timestamp:
Jun 30, 2020 5:19:25 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138905
Message:

AMD IOMMU: bugref:9654 PDM, Main: Changes for southbridge I/O APIC and related PCI address assignment.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r84858 r85007  
    58685868static DECLCALLBACK(int) iommuAmdR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
    58695869{
    5870     NOREF(iInstance);
    5871 
    58725870    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
    5873     PIOMMU          pThis   = PDMDEVINS_2_DATA(pDevIns, PIOMMU);
    5874     PIOMMUCC        pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOMMUCC);
    5875     PCPDMDEVHLPR3   pHlp    = pDevIns->pHlpR3;
    5876     int             rc;
     5871    RT_NOREF2(iInstance, pCfg);
    58775872    LogFlowFunc(("\n"));
    58785873
     5874    PIOMMU   pThis   = PDMDEVINS_2_DATA(pDevIns, PIOMMU);
     5875    PIOMMUCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PIOMMUCC);
    58795876    pThisCC->pDevInsR3 = pDevIns;
    5880 
    5881     /*
    5882      * Validate and read the configuration.
    5883      */
    5884     PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Device|Function", "");
    5885 
    5886     uint8_t uPciDevice;
    5887     rc = pHlp->pfnCFGMQueryU8Def(pCfg, "Device", &uPciDevice, 0);
    5888     if (RT_FAILURE(rc))
    5889         return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"Device\""));
    5890 
    5891     uint8_t uPciFunction;
    5892     rc = pHlp->pfnCFGMQueryU8Def(pCfg, "Function", &uPciFunction, 2);
    5893     if (RT_FAILURE(rc))
    5894         return PDMDEV_SET_ERROR(pDevIns, rc, N_("IOMMU: Failed to query \"Function\""));
    58955877
    58965878    /*
     
    59045886    IommuReg.pfnMsiRemap = iommuAmdDeviceMsiRemap;
    59055887    IommuReg.u32TheEnd   = PDM_IOMMUREGCC_VERSION;
    5906     rc = PDMDevHlpIommuRegister(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp), &pThis->idxIommu);
     5888    int rc = PDMDevHlpIommuRegister(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp), &pThis->idxIommu);
    59075889    if (RT_FAILURE(rc))
    59085890        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to register ourselves as an IOMMU device"));
     
    60075989     * Register the PCI function with PDM.
    60085990     */
    6009     rc = PDMDevHlpPCIRegisterEx(pDevIns, pPciDev, 0 /* fFlags */, uPciDevice, uPciFunction, "amd-iommu");
     5991    rc = PDMDevHlpPCIRegister(pDevIns, pPciDev);
    60105992    AssertLogRelRCReturn(rc, rc);
    60115993
     
    61606142    /* .szName = */                 "iommu-amd",
    61616143    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RZ | PDM_DEVREG_FLAGS_NEW_STYLE,
    6162     /* .fClass = */                 PDM_DEVREG_CLASS_BUS_ISA,   /* Instantiate after PDM_DEVREG_CLASS_BUS_PCI */
     6144    /* .fClass = */                 PDM_DEVREG_CLASS_PCI_BUILTIN,
    61636145    /* .cMaxInstances = */          ~0U,
    61646146    /* .uSharedVersion = */         42,
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r84826 r85007  
    14321432    /* .szName = */                 "pci",
    14331433    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RZ | PDM_DEVREG_FLAGS_NEW_STYLE,
    1434     /* .fClass = */                 PDM_DEVREG_CLASS_BUS_PCI | PDM_DEVREG_CLASS_BUS_ISA,
     1434    /* .fClass = */                 PDM_DEVREG_CLASS_BUS_PCI,
    14351435    /* .cMaxInstances = */          1,
    14361436    /* .uSharedVersion = */         42,
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r84826 r85007  
    38663866    /* .szName = */                 "ich9pci",
    38673867    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RZ | PDM_DEVREG_FLAGS_NEW_STYLE,
    3868     /* .fClass = */                 PDM_DEVREG_CLASS_BUS_PCI | PDM_DEVREG_CLASS_BUS_ISA,
     3868    /* .fClass = */                 PDM_DEVREG_CLASS_BUS_PCI,
    38693869    /* .cMaxInstances = */          1,
    38703870    /* .uSharedVersion = */         42,
  • trunk/src/VBox/Devices/PC/DevIoApic.cpp

    r84868 r85007  
    2424#include <VBox/vmm/hm.h>
    2525#include <VBox/msi.h>
     26#include <Vbox/pci.h>
    2627#include <VBox/vmm/pdmdev.h>
    2728
     
    165166#define IOAPIC_DIRECT_OFF_DATA                  0x10
    166167#define IOAPIC_DIRECT_OFF_EOI                   0x40    /* Newer I/O APIC only. */
    167 
    168 /** The I/O APIC's Bus:Device:Function. */
    169 #define IOAPIC_BUS_DEV_FN                       NIL_PCIBDF
    170168
    171169/* Use PDM critsect for now for I/O APIC locking, see @bugref{8245#c121}. */
     
    657655        uint32_t const uPinMask = UINT32_C(1) << idxRte;
    658656        if (pThis->uIrr & uPinMask)
    659             ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, IOAPIC_BUS_DEV_FN, idxRte);
     657            ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, VBOX_PCI_BDF_SB_IOAPIC, idxRte);
    660658
    661659        IOAPIC_UNLOCK(pDevIns, pThis, pThisCC);
     
    772770                uint32_t const uPinMask = UINT32_C(1) << idxRte;
    773771                if (pThis->uIrr & uPinMask)
    774                     ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, IOAPIC_BUS_DEV_FN, idxRte);
     772                    ioapicSignalIntrForRte(pDevIns, pThis, pThisCC, VBOX_PCI_BDF_SB_IOAPIC, idxRte);
    775773            }
    776774        }
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