VirtualBox

Changeset 89098 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 17, 2021 1:58:09 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144439
Message:

Intel IOMMU: bugref:9967 ConsoleImpl2, DevIoApic: When Main configures the PCI address of the I/O APIC to the BusAssignmentManager, pass it on to the I/O APIC device as well.
This will allow us to use different PCI addresses for AMD and Intel IOMMUs if required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r89004 r89098  
    832832
    833833    BOOL fIOAPIC;
     834    uint32_t uIoApicPciAddress = NIL_PCIBDF;
    834835    hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC);                                 H();
    835836
     
    868869    if (iommuType == IommuType_AMD)
    869870    {
    870 #ifndef VBOX_WITH_IOMMU_AMD
     871#ifdef VBOX_WITH_IOMMU_AMD
     872        /*
     873         * Reserve the specific PCI address of the "SB I/O APIC" when using
     874         * an AMD IOMMU. Required by Linux guests, see @bugref{9654#c23}.
     875         */
     876        uIoApicPciAddress = VBOX_PCI_BDF_SB_IOAPIC;
     877#else
    871878        LogRel(("WARNING! AMD IOMMU not supported, IOMMU disabled.\n"));
    872879        iommuType = IommuType_None;
     
    876883    if (iommuType == IommuType_Intel)
    877884    {
    878 #ifndef VBOX_WITH_IOMMU_INTEL
     885#ifdef VBOX_WITH_IOMMU_INTEL
     886        /*
     887         * Reserve a unique PCI address for the I/O APIC when using
     888         * an Intel IOMMU. For convenience we use the same address as
     889         * we do on AMD, see @bugref{9967#c13}.
     890         */
     891        uIoApicPciAddress = VBOX_PCI_BDF_SB_IOAPIC;
     892#else
    879893        LogRel(("WARNING! Intel IOMMU not supported, IOMMU disabled.\n"));
    880894        iommuType = IommuType_None;
     
    16001614                hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst);                         H();
    16011615
    1602                 /*
    1603                  * Reserve the specific PCI address of the "SB I/O APIC" when using
    1604                  * an AMD IOMMU. Required by Linux guests, see @bugref{9654#c23}.
    1605                  */
    1606                 PCIBusAddress PCIAddr = PCIBusAddress(VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC);
     1616                PCIBusAddress PCIAddr = PCIBusAddress((int32_t)uIoApicPciAddress);
    16071617                hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/);  H();
    16081618            }
     
    16161626                hrc = pBusMgr->assignPCIDevice("iommu-intel", pInst);                       H();
    16171627
    1618                 /*
    1619                  * Reserve a specific PCI address for the I/O APIC when using
    1620                  * an Intel IOMMU. For convenience we use the same address as
    1621                  * we do on AMD, see @bugref{9967#c13}.
    1622                  */
    1623                 PCIBusAddress PCIAddr = PCIBusAddress(VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC);
     1628                PCIBusAddress PCIAddr = PCIBusAddress((int32_t)uIoApicPciAddress);
    16241629                hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/);  H();
    16251630            }
     
    17691774                InsertConfigInteger(pCfg,  "NumCPUs", cCpus);
    17701775                if (iommuType == IommuType_Intel)
     1776                {
    17711777                    InsertConfigString(pCfg, "ChipType", "DMAR");
     1778                    InsertConfigInteger(pCfg, "PCIAddress", uIoApicPciAddress);
     1779                }
     1780                else if (iommuType == IommuType_AMD)
     1781                    InsertConfigInteger(pCfg, "PCIAddress", uIoApicPciAddress);
    17721782            }
    17731783        }
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