- Timestamp:
- May 21, 2020 8:42:19 AM (5 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r84320 r84431 2266 2266 /** The translated system physical address (SPA) of the page. */ 2267 2267 RTGCPHYS GCPhysSpa; 2268 /** The index of the 4K page within a large page. */ 2269 uint32_t idxSubPage; 2268 2270 /** The I/O access permissions (IOMMU_IO_PERM_XXX). */ 2269 2271 uint8_t fIoPerm; 2272 /** The number of offset bits in the translation indicating page size. */ 2273 uint8_t cShift; 2270 2274 /** Alignment padding. */ 2271 uint8_t afPadding[ 7];2275 uint8_t afPadding[2]; 2272 2276 } IOTLBE_T; 2273 2277 AssertCompileSize(IOTLBE_T, 16); … … 4513 4517 4514 4518 /** 4519 * Interrupt remap request from a device. 4520 * 4521 * @returns VBox status code. 4522 * @param pDevIns The IOMMU device instance. 4523 * @param uDevId The device ID (bus, device, function). 4524 * @param GCPhysIn The source MSI address. 4525 * @param uDataIn The source MSI data. 4526 * @param pGCPhysOut Where to store the remapped MSI address. 4527 * @param puDataOut Where to store the remapped MSI data. 4528 */ 4529 static int iommuAmdDeviceMsiRemap(PPDMDEVINS pDevIns, uint16_t uDevId, RTGCPHYS GCPhysIn, uint32_t uDataIn, 4530 PRTGCPHYS pGCPhysOut, uint32_t *puDataOut) 4531 { 4532 RT_NOREF(pDevIns, uDevId, GCPhysIn, uDataIn, pGCPhysOut, puDataOut); 4533 return VERR_NOT_IMPLEMENTED; 4534 } 4535 4536 4537 /** 4515 4538 * @callback_method_impl{FNIOMMMIONEWWRITE} 4516 4539 */ … … 4544 4567 return rcStrict; 4545 4568 } 4546 4547 4569 4548 4570 # ifdef IN_RING3 … … 5603 5625 IommuReg.pfnMemRead = iommuAmdDeviceMemRead; 5604 5626 IommuReg.pfnMemWrite = iommuAmdDeviceMemWrite; 5627 IommuReg.pfnMsiRemap = iommuAmdDeviceMsiRemap; 5605 5628 IommuReg.u32TheEnd = PDM_IOMMUREGCC_VERSION; 5606 5629 rc = PDMDevHlpIommuRegister(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp), &pThis->idxIommu); … … 5840 5863 IommuReg.pfnMemRead = iommuAmdDeviceMemRead; 5841 5864 IommuReg.pfnMemWrite = iommuAmdDeviceMemWrite; 5865 IommuReg.pfnMsiRemap = iommuAmdDeviceMsiRemap; 5842 5866 IommuReg.u32TheEnd = PDM_IOMMUREGCC_VERSION; 5843 5867 rc = PDMDevHlpIommuSetUpContext(pDevIns, &IommuReg, &pThisCC->CTX_SUFF(pIommuHlp)); -
trunk/src/VBox/Devices/testcase/tstDevicePdmDevHlp.cpp
r83296 r84431 4656 4656 ("%s/%d: u32Version=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIommuReg->u32Version, PDM_IOMMUREGR3_VERSION), 4657 4657 VERR_INVALID_PARAMETER); 4658 4659 /** @todo IOMMU: Validate other parameters */4660 4658 AssertPtrReturn(pIommuReg->pfnMemRead, VERR_INVALID_POINTER); 4659 AssertPtrReturn(pIommuReg->pfnMemWrite, VERR_INVALID_POINTER); 4660 AssertPtrReturn(pIommuReg->pfnMsiRemap, VERR_INVALID_POINTER); 4661 4661 AssertMsgReturn(pIommuReg->u32TheEnd == PDM_IOMMUREGR3_VERSION, 4662 4662 ("%s/%d: u32TheEnd=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIommuReg->u32TheEnd, PDM_IOMMUREGR3_VERSION), -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r84332 r84431 3348 3348 ("%s/%d: u32Version=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIommuReg->u32Version, PDM_IOMMUREGR3_VERSION), 3349 3349 VERR_INVALID_PARAMETER); 3350 /** @todo IOMMU: Validate other parameters, see also tstDevicePdmDevHlp.cpp. */ 3350 AssertPtrReturn(pIommuReg->pfnMemRead, VERR_INVALID_POINTER); 3351 AssertPtrReturn(pIommuReg->pfnMemWrite, VERR_INVALID_POINTER); 3352 AssertPtrReturn(pIommuReg->pfnMsiRemap, VERR_INVALID_POINTER); 3351 3353 AssertMsgReturn(pIommuReg->u32TheEnd == PDM_IOMMUREGR3_VERSION, 3352 3354 ("%s/%d: u32TheEnd=%#x expected %#x\n", pDevIns->pReg->szName, pDevIns->iInstance, pIommuReg->u32TheEnd, PDM_IOMMUREGR3_VERSION), … … 3362 3364 */ 3363 3365 unsigned idxIommu = 0; 3366 #if 0 3364 3367 for (idxIommu = 0; idxIommu < RT_ELEMENTS(pVM->pdm.s.aIommus); idxIommu++) 3365 3368 if (!pVM->pdm.s.aIommus[idxIommu].pDevInsR3) … … 3368 3371 ("Too many IOMMUs. Max=%u\n", RT_ELEMENTS(pVM->pdm.s.aIommus)), 3369 3372 VERR_OUT_OF_RESOURCES); 3373 #else 3374 /* Currently we support only a single IOMMU. */ 3375 AssertMsgReturn(!pVM->pdm.s.aIommus[0].pDevInsR3, 3376 ("%s/%u: Only one IOMMU device is supported!\n", pDevIns->pReg->szName, pDevIns->iInstance), 3377 VERR_ALREADY_EXISTS); 3378 #endif 3370 3379 PPDMIOMMU pIommu = &pVM->pdm.s.aIommus[idxIommu]; 3371 3380 … … 3377 3386 pIommu->pfnMemRead = pIommuReg->pfnMemRead; 3378 3387 pIommu->pfnMemWrite = pIommuReg->pfnMemWrite; 3388 pIommu->pfnMsiRemap = pIommuReg->pfnMsiRemap; 3379 3389 Log(("PDM: Registered IOMMU device '%s'/%d pDevIns=%p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns)); 3380 3390 -
trunk/src/VBox/VMM/include/PDMInternal.h
r84170 r84431 635 635 DECLR3CALLBACKMEMBER(int, pfnMemWrite,(PPDMDEVINS pDevIns, uint16_t uDevId, uint64_t uDva, size_t cbWrite, 636 636 PRTGCPHYS pGCPhysSpa)); 637 /** @copydoc PDMIOMMUREGR3::pfnMsiRemap */ 638 DECLR3CALLBACKMEMBER(int, pfnMsiRemap,(PPDMDEVINS pDevIns, uint16_t uDevId, RTGCPHYS GCPhysIn, uint32_t uDataIn, 639 PRTGCPHYS pGCPhysOut, uint32_t *puDataOut)); 637 640 } PDMIOMMU; 638 641 … … 655 658 DECLR0CALLBACKMEMBER(int, pfnMemWrite,(PPDMDEVINS pDevIns, uint16_t uDevId, uint64_t uDva, size_t cbWrite, 656 659 PRTGCPHYS pGCPhysSpa)); 660 /** @copydoc PDMIOMMUREGR3::pfnMsiRemap */ 661 DECLR0CALLBACKMEMBER(int, pfnMsiRemap,(PPDMDEVINS pDevIns, uint16_t uDevId, RTGCPHYS GCPhysIn, uint32_t uDataIn, 662 PRTGCPHYS pGCPhysOut, uint32_t *puDataOut)); 657 663 } PDMIOMMUR0; 658 664 /** Pointer to a ring-0 IOMMU data. */
Note:
See TracChangeset
for help on using the changeset viewer.