Changeset 85830 in vbox
- Timestamp:
- Aug 19, 2020 10:14:57 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r85803 r85830 801 801 } 802 802 803 #ifdef VBOX_WITH_IOMMU_AMD 803 804 /** @todo Get IOMMU from pMachine and pass info to createInstance() below. */ 804 BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType, false /* fIommu */); 805 bool const fIommu = RT_BOOL(chipsetType == ChipsetType_ICH9); 806 #else 807 bool const fIommu = false; 808 #endif 809 BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType, fIommu); 805 810 806 811 ULONG cCpus = 1; … … 1501 1506 1502 1507 #ifdef VBOX_WITH_IOMMU_AMD 1503 /* AMD IOMMU. */ 1504 /** @todo Get IOMMU from pMachine. */ 1505 InsertConfigNode(pDevices, "iommu-amd", &pDev); 1506 InsertConfigNode(pDev, "0", &pInst); 1507 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1508 InsertConfigNode(pInst, "Config", &pCfg); 1509 hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst); H(); 1510 1511 /* 1512 * Reserve the specific PCI address of the "SB I/O APIC" when using 1513 * an AMD IOMMU. Required by Linux guests, see @bugref{9654#c23}. 1514 */ 1515 PCIBusAddress PCIAddr = PCIBusAddress(VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC); 1516 hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/); H(); 1508 if (fIommu) 1509 { 1510 /* AMD IOMMU. */ 1511 InsertConfigNode(pDevices, "iommu-amd", &pDev); 1512 InsertConfigNode(pDev, "0", &pInst); 1513 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1514 InsertConfigNode(pInst, "Config", &pCfg); 1515 hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst); H(); 1516 1517 /* 1518 * Reserve the specific PCI address of the "SB I/O APIC" when using 1519 * an AMD IOMMU. Required by Linux guests, see @bugref{9654#c23}. 1520 */ 1521 PCIBusAddress PCIAddr = PCIBusAddress(VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC); 1522 hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/); H(); 1523 } 1517 1524 #endif 1518 1525 } … … 3258 3265 } 3259 3266 } 3267 #ifdef VBOX_WITH_IOMMU_AMD 3268 if (fIommu) 3269 { 3270 PCIBusAddress Address; 3271 if (pBusMgr->findPCIAddress("iommu-amd", 0, Address)) 3272 { 3273 uint32_t u32IommuAddress = (Address.miDevice << 16) | Address.miFn; 3274 InsertConfigInteger(pCfg, "IommuAmdPciAddress", u32IommuAddress); 3275 if (pBusMgr->findPCIAddress("sb-ioapic", 0, Address)) 3276 { 3277 uint32_t u32SbIoapicAddress = (Address.miDevice << 16) | Address.miFn; 3278 InsertConfigInteger(pCfg, "SbIoApicPciAddress", u32SbIoapicAddress); 3279 } 3280 else 3281 LogRel(("IOMMU: AMD IOMMU is enabled, but southbridge I/O APIC is not assigned a PCI address!\n")); 3282 } 3283 } 3284 #endif 3260 3285 InsertConfigInteger(pCfg, "IocPciAddress", uIocPCIAddress); 3261 3286 if (chipsetType == ChipsetType_ICH9)
Note:
See TracChangeset
for help on using the changeset viewer.