Changeset 88841 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 3, 2021 4:13:23 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144175
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r88814 r88841 1058 1058 static void dmarR3InvEventRaiseInterrupt(PPDMDEVINS pDevIns) 1059 1059 { 1060 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 1060 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 1061 PCDMARCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PCDMARCC); 1062 DMAR_ASSERT_LOCK_IS_OWNER(pDevIns, pThisCC); 1063 1061 1064 uint32_t const uIcsReg = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_ICS_REG); 1062 1065 if (uIcsReg & VTD_BF_ICS_REG_IWC_MASK) … … 1072 1075 Msi.Data.u32 = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_IEDATA_REG); 1073 1076 1074 PCDMARCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PCDMARCC);1075 1077 pThisCC->CTX_SUFF(pIommuHlp)->pfnSendMsi(pDevIns, &Msi, 0 /* uTagSrc */); 1076 1078 … … 1403 1405 static DECLCALLBACK(int) iommuIntelMsiRemap(PPDMDEVINS pDevIns, uint16_t idDevice, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 1404 1406 { 1405 RT_NOREF3(idDevice, pMsiIn, pMsiOut); 1406 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 1407 STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMsiRemap)); NOREF(pThis); 1408 1409 return VERR_NOT_IMPLEMENTED; 1407 /* Validate. */ 1408 Assert(pDevIns); 1409 Assert(pMsiIn); 1410 Assert(pMsiOut); 1411 RT_NOREF1(idDevice); 1412 1413 PDMAR pThis = PDMDEVINS_2_DATA(pDevIns, PDMAR); 1414 PCDMARCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PCDMARCC); 1415 1416 /* Lock and read all registers required for interrupt remapping up-front. */ 1417 DMAR_LOCK(pDevIns, pThisCC); 1418 uint32_t const uGstsReg = dmarRegReadRaw32(pThis, VTD_MMIO_OFF_GSTS_REG); 1419 uint64_t const uIrtaReg = pThis->uIrtaReg; 1420 DMAR_UNLOCK(pDevIns, pThisCC); 1421 1422 if (uGstsReg & VTD_BF_GSTS_REG_IRES_MASK) 1423 { 1424 STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMsiRemap)); 1425 1426 /* 1427 * Handle interrupts in compatibility format. 1428 */ 1429 uint8_t const fIntrFormat = VTD_MSI_ADDR_GET_INTR_FORMAT(pMsiIn->Addr.u64); 1430 if (fIntrFormat == VTD_INTR_FORMAT_COMPAT) 1431 { 1432 /* If Extended Interrupt Mode (EIM) is enabled or compatibility format interrupts (CFI) are disabled, 1433 block the interrupt. */ 1434 if ( (uIrtaReg & VTD_BF_IRTA_REG_EIME_MASK) 1435 || !(uGstsReg & VTD_BF_GSTS_REG_CFIS_MASK)) 1436 return VERR_IOMMU_INTR_REMAP_DENIED; 1437 1438 /* Interrupt isn't subject to remapping, pass-through the interrupt. */ 1439 *pMsiOut = *pMsiIn; 1440 return VINF_SUCCESS; 1441 } 1442 1443 /* 1444 * Handle interrupts in remappable format. 1445 */ 1446 /** @todo index IRTA. */ 1447 } 1448 else 1449 { 1450 /* If interrupt-remapping isn't enabled, all interrupts are pass-through. */ 1451 *pMsiOut = *pMsiIn; 1452 } 1453 1454 return VINF_SUCCESS; 1410 1455 } 1411 1456
Note:
See TracChangeset
for help on using the changeset viewer.