Changeset 83665 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Apr 10, 2020 9:33:38 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r83649 r83665 2051 2051 } 2052 2052 2053 2053 2054 /** 2054 2055 * Writes the Device Table Base Address Register. … … 2385 2386 Assert(!(off & (cb - 1))); 2386 2387 2387 PIOMMU pThis = PDMDEVINS_2_DATA(pDevIns, PIOMMU);2388 2388 uint64_t const uValue = cb == 8 ? *(uint64_t const *)pv : *(uint32_t const *)pv; 2389 2389 return iommuAmdWriteRegister(pDevIns, off, cb, uValue); … … 2429 2429 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0]; 2430 2430 PDMPCIDEV_ASSERT_VALID(pDevIns, pPciDev); 2431 2432 pThis->DevTabBaseAddr.u64 = 0; 2433 pThis->CmdBufBaseAddr.u64 = 0; 2434 pThis->EvtLogBaseAddr.u64 = 0; 2435 pThis->Ctrl.u64 = 0; 2436 pThis->ExclRangeBaseAddr.u64 = 0; 2437 pThis->ExclRangeLimit.u64 = 0; 2438 pThis->ExtFeat.n.u1PrefetchSup = 0; 2439 pThis->ExtFeat.n.u1PprSup = 0; 2440 pThis->ExtFeat.n.u1X2ApicSup = 0; 2441 pThis->ExtFeat.n.u1NoExecuteSup = 0; 2442 pThis->ExtFeat.n.u1GstTranslateSup = 0; 2443 pThis->ExtFeat.n.u1InvAllSup = 0; 2444 pThis->ExtFeat.n.u1GstVirtApicSup = 0; 2445 pThis->ExtFeat.n.u1HwErrorSup = 0; 2446 pThis->ExtFeat.n.u1PerfCounterSup = 0; 2447 pThis->ExtFeat.n.u2HostAddrTranslateSize = 0; /* Requires GstTranslateSup. */ 2448 pThis->ExtFeat.n.u2GstAddrTranslateSize = 0; /* Requires GstTranslateSup. */ 2449 pThis->ExtFeat.n.u2GstCr3RootTblLevel = 0; /* Requires GstTranslateSup. */ 2450 pThis->ExtFeat.n.u2SmiFilterSup = 0; 2451 pThis->ExtFeat.n.u3SmiFilterCount = 0; 2452 pThis->ExtFeat.n.u3GstVirtApicModeSup = 0; /* Requires GstVirtApicSup */ 2453 pThis->ExtFeat.n.u2DualPprLogSup = 0; 2454 pThis->ExtFeat.n.u2DualEvtLogSup = 0; 2455 pThis->ExtFeat.n.u5MaxPasidSup = 0; /* Requires GstTranslateSup. */ 2456 pThis->ExtFeat.n.u1UserSupervisorSup = 0; 2457 pThis->ExtFeat.n.u2DevTabSegSup = 0; 2458 pThis->ExtFeat.n.u1PprLogOverflowWarn = 0; 2459 pThis->ExtFeat.n.u1PprAutoRespSup = 0; 2460 pThis->ExtFeat.n.u2MarcSup = 0; 2461 pThis->ExtFeat.n.u1BlockStopMarkSup = 0; 2462 pThis->ExtFeat.n.u1PerfOptSup = 0; 2463 pThis->ExtFeat.n.u1MsiCapMmioSup = 1; 2464 pThis->ExtFeat.n.u1GstIoSup = 0; 2465 pThis->ExtFeat.n.u1HostAccessSup = 0; 2466 pThis->ExtFeat.n.u1EnhancedPprSup = 0; 2467 pThis->ExtFeat.n.u1AttrForwardSup = 0; 2468 pThis->ExtFeat.n.u1HostDirtySup = 0; 2469 pThis->ExtFeat.n.u1InvIoTlbTypeSup = 0; 2470 pThis->ExtFeat.n.u1GstUpdateDisSup = 0; 2471 pThis->ExtFeat.n.u1ForcePhysDstSup = 0; 2472 pThis->PprLogBaseAddr.u64 = 0; 2473 pThis->HwEvtHi.u64 = 0; 2474 pThis->HwEvtLo = 0; 2475 pThis->HwEvtStatus.u64 = 0; 2476 pThis->GALogBaseAddr.n.u40GALogBase = 0; 2477 pThis->GALogBaseAddr.n.u4GALogLen = 8; 2478 pThis->GALogTailAddr.u64 = 0; 2479 pThis->PprLogBBaseAddr.n.u40PprLogBase = 0; 2480 pThis->PprLogBBaseAddr.n.u4PprLogLen = 8; 2481 pThis->EvtLogBBaseAddr.n.u40EvtBase = 0; 2482 pThis->EvtLogBBaseAddr.n.u4EvtLen = 8; 2483 memset(&pThis->DevTabSeg[0], 0, sizeof(pThis->DevTabSeg)); 2484 pThis->DevSpecificFeat.u64 = 0; 2485 pThis->DevSpecificCtrl.u64 = 0; 2486 pThis->DevSpecificStatus.u64 = 0; 2487 pThis->MsiMiscInfo.u64 = 0; 2488 pThis->MsiCapHdr.u32 = PDMPciDevGetDWord(pPciDev, IOMMU_PCI_OFF_MSI_CAP_HDR); 2489 pThis->MsiAddr.u64 = 0; 2490 pThis->MsiData.u32 = 0; 2491 pThis->MsiMapCapHdr.u32 = 0; 2492 pThis->PerfOptCtrl.u32 = 0; 2493 pThis->XtGenIntrCtrl.u64 = 0; 2494 pThis->XtPprIntrCtrl.u64 = 0; 2495 pThis->XtGALogIntrCtrl.u64 = 0; 2496 memset(&pThis->aMarcApers[0], 0, sizeof(pThis->aMarcApers)); 2497 pThis->RsvdReg = 0; 2498 pThis->CmdBufHeadPtr.u64 = 0; 2499 pThis->CmdBufTailPtr.u64 = 0; 2500 pThis->EvtLogHeadPtr.u64 = 0; 2501 pThis->EvtLogTailPtr.u64 = 0; 2502 pThis->Status.u64 = 0; 2503 pThis->PprLogHeadPtr.u64 = 0; 2504 pThis->PprLogTailPtr.u64 = 0; 2505 pThis->GALogHeadPtr.u64 = 0; 2506 pThis->GALogTailPtr.u64 = 0; 2507 pThis->PprLogBHeadPtr.u64 = 0; 2508 pThis->PprLogBTailPtr.u64 = 0; 2509 pThis->EvtLogBHeadPtr.u64 = 0; 2510 pThis->EvtLogBTailPtr.u64 = 0; 2511 pThis->PprLogAutoResp.u64 = 0; 2512 pThis->PprLogOverflowEarly.u64 = 0; 2513 pThis->PprLogBOverflowEarly.u64 = 0; 2431 2514 2432 2515 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_BASE_ADDR_REG_LO, 0); … … 3084 3167 3085 3168 /* 3086 * Initialize thePCI configuration space.3169 * Initialize read-only PCI configuration space. 3087 3170 */ 3088 3171 PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0]; … … 3145 3228 MsiReg.cMsiVectors = 1; 3146 3229 MsiReg.iMsiCapOffset = IOMMU_PCI_OFF_MSI_CAP_HDR; 3147 MsiReg.iMsiNextOffset = IOMMU_PCI_OFF_MSI_MAP_CAP_HDR;3230 MsiReg.iMsiNextOffset = 0; /* IOMMU_PCI_OFF_MSI_MAP_CAP_HDR */ 3148 3231 rc = PDMDevHlpPCIRegisterMsi(pDevIns, &MsiReg); 3149 3232 AssertRCReturn(rc, rc); 3233 /* This is later copied to its MMIO shadow register (MsiCapHdr), see iommuAmdR3Init. */ 3150 3234 #endif 3235 3236 /* These read-write PCI config registers are initialized in iommuAmdR3Init. */ 3151 3237 #if 0 3152 3238 /* MSI Address Lo. */ … … 3156 3242 /* MSI Data. */ 3157 3243 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_DATA, 0); /* RW - MSI data. */ 3158 #else3159 /* These are initialized in iommuAmdInit. */3160 3244 #endif 3161 /** @todo IOMMU: I don't know if we can support this, disable later if required. */ 3245 3246 #if 0 3247 /** @todo IOMMU: I don't know if we need to support this, enable later if 3248 * required. */ 3162 3249 /* MSI Mapping Capability Header register. */ 3163 3250 PDMPciDevSetDWord(pPciDev, IOMMU_PCI_OFF_MSI_MAP_CAP_HDR, … … 3167 3254 | RT_BF_MAKE(IOMMU_BF_MSI_MAP_CAPHDR_FIXED, 0x1) /* RO - MSI mapping range is fixed */ 3168 3255 | RT_BF_MAKE(IOMMU_BF_MSI_MAP_CAPHDR_CAP_TYPE, 0x15)); /* RO - MSI mapping capability */ 3256 /* When implementing don't forget to copy this to its MMIO shadow register (MsiMapCapHdr) in iommuAmdR3Init. */ 3257 #endif 3169 3258 3170 3259 /* 3171 3260 * Initialize parts of the IOMMU state as it would during reset. 3261 * Must be called -after- initializing PCI config. space registers. 3172 3262 */ 3173 3263 iommuAmdR3Init(pDevIns);
Note:
See TracChangeset
for help on using the changeset viewer.