儲存庫 vbox 的更動 88333
- 時間撮記:
- 2021-3-31 下午04:29:39 (4 年 以前)
- svn:sync-xref-src-repo-rev:
- 143559
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r88310 r88333 209 209 SYSTEM_INFO_INDEX_PREF64_MEMORY_MAX = 30, 210 210 SYSTEM_INFO_INDEX_NVME_ADDRESS = 31, /**< First NVMe controller PCI address, or 0 */ 211 SYSTEM_INFO_INDEX_IOMMU_A MD_ADDRESS = 32, /**< AMDIOMMU PCI address, or 0 */211 SYSTEM_INFO_INDEX_IOMMU_ADDRESS = 32, /**< IOMMU PCI address, or 0 */ 212 212 SYSTEM_INFO_INDEX_SB_IOAPIC_ADDRESS = 33, /**< Southbridge I/O APIC (needed by AMD IOMMU) PCI address, or 0 */ 213 213 SYSTEM_INFO_INDEX_END = 34, … … 402 402 /** PCI address of the host bus controller device. */ 403 403 uint32_t u32HbcPciAddress; 404 /** PCI address of the AMDIOMMU device. */405 uint32_t u32Iommu AmdPciAddress;404 /** PCI address of the IOMMU device. */ 405 uint32_t u32IommuPciAddress; 406 406 /** PCI address of the southbridge I/O APIC device. */ 407 407 uint32_t u32SbIoApicPciAddress; … … 1655 1655 break; 1656 1656 1657 case SYSTEM_INFO_INDEX_IOMMU_A MD_ADDRESS:1658 *pu32 = pThis->u32Iommu AmdPciAddress;1657 case SYSTEM_INFO_INDEX_IOMMU_ADDRESS: 1658 *pu32 = pThis->u32IommuPciAddress; 1659 1659 break; 1660 1660 … … 3220 3220 3221 3221 uint16_t const uIommuBus = 0; 3222 uint16_t const uIommuDev = RT_HI_U16(pThis->u32Iommu AmdPciAddress);3223 uint16_t const uIommuFn = RT_LO_U16(pThis->u32Iommu AmdPciAddress);3222 uint16_t const uIommuDev = RT_HI_U16(pThis->u32IommuPciAddress); 3223 uint16_t const uIommuFn = RT_LO_U16(pThis->u32IommuPciAddress); 3224 3224 3225 3225 /* IVRS header. */ … … 3387 3387 VtdTable.Drhd.cbLength = sizeof(ACPIDRHD) /* + sizeof(VtdTable.DevScope) */; 3388 3388 VtdTable.Drhd.fFlags = ACPI_DRHD_F_INCLUDE_PCI_ALL; 3389 VtdTable.Drhd.uRegBaseAddr = VTD_MMIO_BASE_ ADDR;3389 VtdTable.Drhd.uRegBaseAddr = VTD_MMIO_BASE_PHYSADDR; 3390 3390 3391 3391 /* Finally, compute checksum. */ … … 4074 4074 "|Parallel0Irq" 4075 4075 "|Parallel1Irq" 4076 "|IommuIntelEnabled" 4076 4077 "|IommuAmdEnabled" 4077 "|Iommu AmdPciAddress"4078 "|IommuPciAddress" 4078 4079 "|SbIoApicPciAddress" 4079 4080 , ""); … … 4242 4243 { 4243 4244 /* Query IOMMU AMD address (IOMA). */ 4244 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Iommu AmdPciAddress", &pThis->u32IommuAmdPciAddress, 0);4245 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0); 4245 4246 if (RT_FAILURE(rc)) 4246 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"Iommu AmdAddress\""));4247 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\"")); 4247 4248 4248 4249 /* Query southbridge I/O APIC address (required when an AMD IOMMU is configured). */ … … 4254 4255 /** @todo We should eventually not assign the IOMMU at this address, see 4255 4256 * @bugref{9654#c53}. */ 4256 if (!pThis->u32Iommu AmdPciAddress)4257 if (!pThis->u32IommuPciAddress) 4257 4258 LogRel(("ACPI: Warning! AMD IOMMU assigned the PCI host bridge address.\n")); 4258 4259 … … 4272 4273 if (RT_FAILURE(rc)) 4273 4274 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuIntelEnabled\"")); 4275 4276 if (pThis->fUseIommuIntel) 4277 { 4278 /* Query IOMMU Intel address. */ 4279 rc = pHlp->pfnCFGMQueryU32Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0); 4280 if (RT_FAILURE(rc)) 4281 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\"")); 4282 } 4274 4283 #endif 4275 4284 -
trunk/src/VBox/Main/src-client/BusAssignmentManager.cpp
r87242 r88333 238 238 * to device number 23 when the VM is configured for an AMD IOMMU. 239 239 */ 240 static const DeviceAssignmentRule g_aIch9Iommu LsiRules[] =240 static const DeviceAssignmentRule g_aIch9IommuAmdRules[] = 241 241 { 242 242 /* AMD IOMMU. */ … … 247 247 /* Storage controller */ 248 248 {"lsilogic", 0, 23, 0, 1}, 249 { NULL, -1, -1, -1, 0} 250 }; 251 #endif 252 253 #ifdef VBOX_WITH_IOMMU_INTEL 254 /* 255 * Intel IOMMU. 256 * The VT-d misc, address remapping, system management device is 257 * located at BDF 00:5:0 on real hardware so we mimick the same. 258 * LSI logic remains at 0:20:0. 259 */ 260 static const DeviceAssignmentRule g_aIch9IommuIntelRules[] = 261 { 262 /* Intel IOMMU. */ 263 {"iommu-intel", 0, 5, 0, 0}, 264 265 /* Storage controller */ 266 {"lsilogic", 0, 20, 0, 1}, 249 267 { NULL, -1, -1, -1, 0} 250 268 }; … … 334 352 HRESULT BusAssignmentManager::State::init(ChipsetType_T chipsetType, IommuType_T iommuType) 335 353 { 336 /* Currently we only support AMD IOMMU. */ 337 Assert(iommuType == IommuType_None || iommuType == IommuType_AMD); 354 if (iommuType != IommuType_None) 355 { 356 #if defined(VBOX_WITH_IOMMU_AMD) && defined(VBOX_WITH_IOMMU_INTEL) 357 Assert(iommuType == IommuType_AMD || iommuType == IommuType_Intel); 358 #elif defined(VBOX_WITH_IOMMU_AMD) 359 Assert(iommuType == IommuType_AMD); 360 #elif defined(VBOX_WITH_IOMMU_INTEL) 361 Assert(iommuType == IommuType_Intel); 362 #endif 363 } 338 364 339 365 mChipsetType = chipsetType; … … 405 431 #ifdef VBOX_WITH_IOMMU_AMD 406 432 if (mIommuType == IommuType_AMD) 407 aArrays[2] = g_aIch9IommuLsiRules; 433 aArrays[2] = g_aIch9IommuAmdRules; 434 else 435 #endif 436 #ifdef VBOX_WITH_IOMMU_INTEL 437 if (mIommuType == IommuType_Intel) 438 aArrays[2] = g_aIch9IommuIntelRules; 408 439 else 409 440 #endif -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r88217 r88333 844 844 } 845 845 846 #if def VBOX_WITH_IOMMU_AMD846 #if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL) 847 847 IommuType_T iommuType; 848 848 hrc = pMachine->COMGETTER(IommuType)(&iommuType); H(); … … 854 854 iommuType = IommuType_AMD; 855 855 else if (ASMIsIntelCpu()) 856 { 856 iommuType = IommuType_Intel; 857 else 858 { 859 /** @todo Should we handle other CPUs like Shanghai, VIA etc. here? */ 860 LogRel(("WARNING! Unrecognized CPU type, IOMMU disabled.\n")); 857 861 iommuType = IommuType_None; 858 LogRel(("WARNING! Intel IOMMU implemention is not yet supported. Disabled IOMMU.\n"));859 }860 else861 {862 /** @todo Should we handle other CPUs like Shanghai, VIA etc. here? */863 LogRel(("WARNING! Unrecognized CPU type. Disabled IOMMU.\n"));864 iommuType = IommuType_None;865 862 } 866 863 } 867 864 868 /* Handle AMD IOMMU specifics. */ 869 if ( iommuType == IommuType_AMD 865 if (iommuType == IommuType_AMD) 866 { 867 #ifndef VBOX_WITH_IOMMU_AMD 868 LogRel(("WARNING! AMD IOMMU not supported, IOMMU disabled.\n")); 869 iommuType = IommuType_None; 870 #endif 871 } 872 if (iommuType != IommuType_Intel) 873 { 874 #ifndef VBOX_WITH_IOMMU_INTEL 875 LogRel(("WARNING! Intel IOMMU not supported, IOMMU disabled.\n")); 876 iommuType = IommuType_None; 877 #endif 878 } 879 if ( (iommuType == IommuType_AMD || iommuType == IommuType_Intel) 870 880 && chipsetType != ChipsetType_ICH9) 871 return VMR3SetError(pUVM, VERR_INVALID_PARAMETER, RT_SRC_POS, 872 N_("AMD IOMMU uses MSIs which requires the ICH9 chipset implementation.")); 873 874 /** @todo Handle Intel IOMMU specifics. */ 881 return VMR3SetError(pUVM, VERR_INVALID_PARAMETER, RT_SRC_POS, 882 N_("IOMMU uses MSIs which requires the ICH9 chipset implementation.")); 875 883 #else 876 884 IommuType_T const iommuType = IommuType_None; … … 1575 1583 #endif 1576 1584 1577 #ifdef VBOX_WITH_IOMMU_AMD1578 1585 if (iommuType == IommuType_AMD) 1579 1586 { … … 1583 1590 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1584 1591 InsertConfigNode(pInst, "Config", &pCfg); 1585 hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst); 1592 hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst); H(); 1586 1593 1587 1594 /* … … 1592 1599 hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/); H(); 1593 1600 } 1594 #endif 1595 } 1596 /** @todo IOMMU: Disallow creating a VM without ICH9 chipset if an IOMMU is 1597 * configured. */ 1601 else if (iommuType == IommuType_Intel) 1602 { 1603 /* Intel IOMMU. */ 1604 InsertConfigNode(pDevices, "iommu-intel", &pDev); 1605 InsertConfigNode(pDev, "0", &pInst); 1606 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1607 InsertConfigNode(pInst, "Config", &pCfg); 1608 hrc = pBusMgr->assignPCIDevice("iommu-intel", pInst); H(); 1609 } 1610 } 1598 1611 1599 1612 /* … … 3361 3374 } 3362 3375 } 3363 #ifdef VBOX_WITH_IOMMU_AMD3364 3376 if (iommuType == IommuType_AMD) 3365 3377 { … … 3369 3381 uint32_t u32IommuAddress = (Address.miDevice << 16) | Address.miFn; 3370 3382 InsertConfigInteger(pCfg, "IommuAmdEnabled", true); 3371 InsertConfigInteger(pCfg, "Iommu AmdPciAddress", u32IommuAddress);3383 InsertConfigInteger(pCfg, "IommuPciAddress", u32IommuAddress); 3372 3384 if (pBusMgr->findPCIAddress("sb-ioapic", 0, Address)) 3373 3385 { … … 3379 3391 } 3380 3392 } 3381 #endif 3393 else if (iommuType == IommuType_Intel) 3394 { 3395 PCIBusAddress Address; 3396 if (pBusMgr->findPCIAddress("iommu-intel", 0, Address)) 3397 { 3398 uint32_t u32IommuAddress = (Address.miDevice << 16) | Address.miFn; 3399 InsertConfigInteger(pCfg, "IommuIntelEnabled", true); 3400 InsertConfigInteger(pCfg, "IommuPciAddress", u32IommuAddress); 3401 } 3402 } 3403 3382 3404 InsertConfigInteger(pCfg, "IocPciAddress", uIocPCIAddress); 3383 3405 if (chipsetType == ChipsetType_ICH9)
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器