Changeset 85007 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 30, 2020 5:19:25 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138905
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r84618 r85007 878 878 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \ 879 879 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \ 880 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) 880 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \ 881 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) 881 882 ifdef VBOX_WITH_NETSHAPER 882 883 VBoxC_DEFS += VBOX_WITH_NETSHAPER -
trunk/src/VBox/Main/include/BusAssignmentManager.h
r82968 r85007 47 47 }; 48 48 49 static BusAssignmentManager *createInstance(ChipsetType_T chipsetType );49 static BusAssignmentManager *createInstance(ChipsetType_T chipsetType, bool fIommu); 50 50 virtual void AddRef(); 51 51 virtual void Release(); -
trunk/src/VBox/Main/src-client/BusAssignmentManager.cpp
r82968 r85007 68 68 69 69 /* Storage controllers */ 70 {"lsilogic", 0, 20, 0, 1},71 70 {"buslogic", 0, 21, 0, 1}, 72 71 {"lsilogicsas", 0, 22, 0, 1}, … … 111 110 {"piix3ide", 0, 1, 1, 0}, 112 111 {"ahci", 0, 13, 0, 1}, 112 {"lsilogic", 0, 20, 0, 1}, 113 113 {"pcibridge", 0, 24, 0, 0}, 114 114 {"pcibridge", 0, 25, 0, 0}, … … 229 229 }; 230 230 231 232 #ifdef VBOX_WITH_IOMMU_AMD 233 /* 234 * AMD IOMMU and LSI Logic controller rules. 235 * 236 * Since the PCI slot (BDF=00:20.0) of the LSI Logic controller 237 * conflicts with the SB I/O APIC, we assign the LSI Logic controller 238 * to device number 23 when the VM is configured for an AMD IOMMU. 239 */ 240 static const DeviceAssignmentRule aIch9IommuLsiRules[] = 241 { 242 /* AMD IOMMU. */ 243 {"iommu-amd", 0, 0, 2, 0}, 244 /* AMD IOMMU: Reserved for southbridge I/O APIC. */ 245 {"sb-ioapic", 0, 20, 0, 0}, 246 247 /* Storage controller */ 248 {"lsilogic", 0, 23, 0, 1}, 249 { NULL, -1, -1, -1, 0} 250 }; 251 #endif 252 253 /* LSI Logic Controller. */ 254 static const DeviceAssignmentRule aIch9LsiRules[] = 255 { 256 /* Storage controller */ 257 {"lsilogic", 0, 20, 0, 1}, 258 { NULL, -1, -1, -1, 0} 259 }; 260 231 261 /* Aliasing rules */ 232 262 static const DeviceAliasRule aDeviceAliases[] = … … 280 310 ChipsetType_T mChipsetType; 281 311 const char * mpszBridgeName; 312 bool mfIommu; 282 313 PCIMap mPCIMap; 283 314 ReversePCIMap mReversePCIMap; … … 289 320 {} 290 321 291 HRESULT init(ChipsetType_T chipsetType );322 HRESULT init(ChipsetType_T chipsetType, bool fIommu); 292 323 293 324 HRESULT record(const char *pszName, PCIBusAddress& GuestAddress, PCIBusAddress HostAddress); … … 301 332 }; 302 333 303 HRESULT BusAssignmentManager::State::init(ChipsetType_T chipsetType )334 HRESULT BusAssignmentManager::State::init(ChipsetType_T chipsetType, bool fIommu) 304 335 { 305 336 mChipsetType = chipsetType; 337 mfIommu = fIommu; 306 338 switch (chipsetType) 307 339 { … … 340 372 } 341 373 342 bool 374 bool BusAssignmentManager::State::findPCIAddress(const char *pszDevName, int iInstance, PCIBusAddress& Address) 343 375 { 344 376 PCIDeviceRecord devRec(pszDevName); … … 358 390 { 359 391 size_t iRuleset, iRule; 360 const DeviceAssignmentRule *aArrays[ 2] = {aGenericRules, NULL};392 const DeviceAssignmentRule *aArrays[3] = {aGenericRules, NULL, NULL}; 361 393 362 394 switch (mChipsetType) … … 366 398 break; 367 399 case ChipsetType_ICH9: 400 { 368 401 aArrays[1] = aIch9Rules; 402 #ifdef VBOX_WITH_IOMMU_AMD 403 if (mfIommu) 404 aArrays[2] = aIch9IommuLsiRules; 405 else 406 #endif 407 { 408 aArrays[2] = aIch9LsiRules; 409 } 369 410 break; 411 } 370 412 default: 371 413 AssertFailed(); … … 405 447 PCIRulesList matchingRules; 406 448 407 addMatchingRules(pszName, 449 addMatchingRules(pszName, matchingRules); 408 450 const char *pszAlias = findAlias(pszName); 409 451 if (pszAlias) … … 468 510 } 469 511 470 BusAssignmentManager *BusAssignmentManager::createInstance(ChipsetType_T chipsetType )512 BusAssignmentManager *BusAssignmentManager::createInstance(ChipsetType_T chipsetType, bool fIommu) 471 513 { 472 514 BusAssignmentManager *pInstance = new BusAssignmentManager(); 473 pInstance->pState->init(chipsetType );515 pInstance->pState->init(chipsetType, fIommu); 474 516 Assert(pInstance); 475 517 return pInstance; … … 537 579 return rc; 538 580 539 rc = InsertConfigInteger(pCfg, "PCIBusNo", GuestAddress.miBus); 540 if (FAILED(rc)) 541 return rc; 542 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", GuestAddress.miDevice); 543 if (FAILED(rc)) 544 return rc; 545 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", GuestAddress.miFn); 546 if (FAILED(rc)) 547 return rc; 581 if (pCfg) 582 { 583 rc = InsertConfigInteger(pCfg, "PCIBusNo", GuestAddress.miBus); 584 if (FAILED(rc)) 585 return rc; 586 rc = InsertConfigInteger(pCfg, "PCIDeviceNo", GuestAddress.miDevice); 587 if (FAILED(rc)) 588 return rc; 589 rc = InsertConfigInteger(pCfg, "PCIFunctionNo", GuestAddress.miFn); 590 if (FAILED(rc)) 591 return rc; 592 } 548 593 549 594 /* Check if the bus is still unknown, i.e. the bridge to it is missing */ -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r84618 r85007 801 801 } 802 802 803 BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType); 803 /** @todo Get IOMMU from pMachine and pass info to createInstance() below. */ 804 BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType, false /* fIommu */); 804 805 805 806 ULONG cCpus = 1; … … 1493 1494 hrc = i_attachRawPCIDevices(pUVM, pBusMgr, pDevices); H(); 1494 1495 #endif 1495 } 1496 1497 #ifdef VBOX_WITH_IOMMU_AMD 1498 /* AMD IOMMU. */ 1499 /** @todo Get IOMMU from pMachine. */ 1500 InsertConfigNode(pDevices, "iommu-amd", &pDev); 1501 InsertConfigNode(pDev, "0", &pInst); 1502 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 1503 InsertConfigNode(pInst, "Config", &pCfg); 1504 hrc = pBusMgr->assignPCIDevice("iommu-amd", pInst); H(); 1505 1506 /* 1507 * Reserve the specific PCI address of the "SB I/O APIC" when using 1508 * an AMD IOMMU. Required by Linux guests, see @bugref{9654#c23}. 1509 */ 1510 PCIBusAddress PCIAddr = PCIBusAddress(VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC); 1511 hrc = pBusMgr->assignPCIDevice("sb-ioapic", NULL /* pCfg */, PCIAddr, true /*fGuestAddressRequired*/); H(); 1512 #endif 1513 } 1514 /** @todo IOMMU: Disallow creating a VM without ICH9 chipset if an IOMMU is 1515 * configured. */ 1496 1516 1497 1517 /*
Note:
See TracChangeset
for help on using the changeset viewer.