Changeset 88484 in vbox for trunk/src/VBox/Devices/PC/DevACPI.cpp
- Timestamp:
- Apr 13, 2021 5:50:44 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r88342 r88484 866 866 ACPIDMAR Dmar; 867 867 ACPIDRHD Drhd; 868 /* ACPIDMARDEVSCOPE DevScope; */868 ACPIDMARDEVSCOPE DevScopeIoApic; 869 869 } ACPITBLVTD; 870 870 #endif /* VBOX_WITH_IOMMU_INTEL */ … … 3385 3385 3386 3386 /* DRHD. */ 3387 VtdTable.Drhd.cbLength = sizeof(ACPIDRHD) /* + sizeof(VtdTable.DevScope) */;3387 VtdTable.Drhd.cbLength = sizeof(ACPIDRHD); 3388 3388 VtdTable.Drhd.fFlags = ACPI_DRHD_F_INCLUDE_PCI_ALL; 3389 3389 VtdTable.Drhd.uRegBaseAddr = DMAR_MMIO_BASE_PHYSADDR; 3390 3391 /* Device Scopes: I/O APIC. */ 3392 if (pThis->u8UseIOApic) 3393 { 3394 uint8_t const uIoApicBus = 0; 3395 uint8_t const uIoApicDev = RT_HI_U16(pThis->u32SbIoApicPciAddress); 3396 uint8_t const uIoApicFn = RT_LO_U16(pThis->u32SbIoApicPciAddress); 3397 3398 VtdTable.DevScopeIoApic.uType = ACPIDMARDEVSCOPE_TYPE_IOAPIC; 3399 VtdTable.DevScopeIoApic.cbLength = sizeof(ACPIDMARDEVSCOPE); 3400 VtdTable.DevScopeIoApic.idEnum = pThis->cCpus; /* The I/O APIC ID, see u8IOApicId in acpiR3SetupMadt(). */ 3401 VtdTable.DevScopeIoApic.uStartBusNum = uIoApicBus; 3402 VtdTable.DevScopeIoApic.Path.uDevice = uIoApicDev; 3403 VtdTable.DevScopeIoApic.Path.uFunction = uIoApicFn; 3404 3405 VtdTable.Drhd.cbLength += sizeof(VtdTable.DevScopeIoApic); 3406 } 3390 3407 3391 3408 /* Finally, compute checksum. */ … … 3538 3555 #ifdef VBOX_WITH_IOMMU_INTEL 3539 3556 if (pThis->fUseIommuIntel) 3540 iIommu = cAddr++; /* IOMMU ( AMD) */3557 iIommu = cAddr++; /* IOMMU (Intel) */ 3541 3558 #endif 3542 3559 … … 3555 3572 Assert(cAddr < RT_ELEMENTS(aGCPhysXsdt)); 3556 3573 3557 cbRsdt += cAddr *sizeof(uint32_t); /* each entry: 32 bits phys. address. */3558 cbXsdt += cAddr *sizeof(uint64_t); /* each entry: 64 bits phys. address. */3574 cbRsdt += cAddr * sizeof(uint32_t); /* each entry: 32 bits phys. address. */ 3575 cbXsdt += cAddr * sizeof(uint64_t); /* each entry: 64 bits phys. address. */ 3559 3576 3560 3577 /* … … 4243 4260 { 4244 4261 /* Query IOMMU AMD address (IOMA). */ 4245 rc = pHlp->pfnCFGMQueryU32 Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0);4262 rc = pHlp->pfnCFGMQueryU32(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress); 4246 4263 if (RT_FAILURE(rc)) 4247 4264 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\"")); 4248 4265 4249 4266 /* Query southbridge I/O APIC address (required when an AMD IOMMU is configured). */ 4250 rc = pHlp->pfnCFGMQueryU32 Def(pCfg, "SbIoApicPciAddress", &pThis->u32SbIoApicPciAddress, 0);4267 rc = pHlp->pfnCFGMQueryU32(pCfg, "SbIoApicPciAddress", &pThis->u32SbIoApicPciAddress); 4251 4268 if (RT_FAILURE(rc)) 4252 4269 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"SbIoApicAddress\"")); … … 4258 4275 LogRel(("ACPI: Warning! AMD IOMMU assigned the PCI host bridge address.\n")); 4259 4276 4260 /* Warn if the SB IOAPIC is not at the required address if an AMD IOMMU is configured. */4277 /* Warn if the IOAPIC is not at the expected address. */ 4261 4278 if (pThis->u32SbIoApicPciAddress != RT_MAKE_U32(VBOX_PCI_FN_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC)) 4262 4279 { 4263 /** @todo Maybe make this a VM startup failure later. */ 4264 LogRel(("ACPI: Warning! Southbridge I/O APIC not at %#x:%#x:%#x when an AMD IOMMU is present.\n", 4280 LogRel(("ACPI: Southbridge I/O APIC not at %#x:%#x:%#x when an AMD IOMMU is present.\n", 4265 4281 VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC)); 4282 return PDMDEV_SET_ERROR(pDevIns, VERR_MISMATCH, N_("Configuration error: \"SbIoApicAddress\" mismatch")); 4266 4283 } 4267 4284 } … … 4277 4294 { 4278 4295 /* Query IOMMU Intel address. */ 4279 rc = pHlp->pfnCFGMQueryU32 Def(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress, 0);4296 rc = pHlp->pfnCFGMQueryU32(pCfg, "IommuPciAddress", &pThis->u32IommuPciAddress); 4280 4297 if (RT_FAILURE(rc)) 4281 4298 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"IommuPciAddress\"")); 4299 4300 /* Get the reserved I/O APIC PCI address (required when an Intel IOMMU is configured). */ 4301 rc = pHlp->pfnCFGMQueryU32(pCfg, "SbIoApicPciAddress", &pThis->u32SbIoApicPciAddress); 4302 if (RT_FAILURE(rc)) 4303 return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"SbIoApicAddress\"")); 4304 4305 /* Warn if the IOAPIC is not at the expected address. */ 4306 if (pThis->u32SbIoApicPciAddress != RT_MAKE_U32(VBOX_PCI_FN_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC)) 4307 { 4308 LogRel(("ACPI: Southbridge I/O APIC not at %#x:%#x:%#x when an Intel IOMMU is present.\n", 4309 VBOX_PCI_BUS_SB_IOAPIC, VBOX_PCI_DEV_SB_IOAPIC, VBOX_PCI_FN_SB_IOAPIC)); 4310 return PDMDEV_SET_ERROR(pDevIns, VERR_MISMATCH, N_("Configuration error: \"SbIoApicAddress\" mismatch")); 4311 } 4282 4312 } 4283 4313 #endif
Note:
See TracChangeset
for help on using the changeset viewer.