Changeset 89538 in vbox for trunk/src/VBox
- Timestamp:
- Jun 7, 2021 4:07:22 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144896
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r89537 r89538 556 556 uint8_t afPadding[5]; 557 557 /** The first-level page-table pointer. */ 558 uint64_t uFl ptPtr;558 uint64_t uFlPtPtr; 559 559 /** The second-level page-table pointer. */ 560 uint64_t uSl ptPtr;560 uint64_t uSlPtPtr; 561 561 } DMARMEMREQAUX; 562 562 /** Pointer to a DMA memory request output. */ … … 2110 2110 2111 2111 /** 2112 * Reads a second-level pag ing entryfrom guest memory.2112 * Reads a second-level page-table pointer from guest memory. 2113 2113 * 2114 2114 * @returns VBox status code. 2115 2115 * @param pDevIns The IOMMU device instance. 2116 * @param GCPhysSl ptPtr The physical address of the SLPTPTR.2116 * @param GCPhysSlPtPtr The physical address of the SLPTPTR. 2117 2117 * @param pSlpEntry Where to store the read SLPTPTR. 2118 2118 */ 2119 static int dmarDrReadS lpPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhysSlptPtr, PVTD_SLP_ENTRY_T pSlpEntry)2120 { 2121 /* We don't verify bits 63:HAW of GCPhysSl ptPtr is 0 since reading from such an address should fail anyway. */2122 return PDMDevHlpPhysReadMeta(pDevIns, GCPhysSl ptPtr, pSlpEntry, sizeof(*pSlpEntry));2119 static int dmarDrReadSecondLevelPtPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhysSlPtPtr, PVTD_SLP_ENTRY_T pSlpEntry) 2120 { 2121 /* We don't verify bits 63:HAW of GCPhysSlPtPtr is 0 since reading from such an address should fail anyway. */ 2122 return PDMDevHlpPhysReadMeta(pDevIns, GCPhysSlPtPtr, pSlpEntry, sizeof(*pSlpEntry)); 2123 2123 } 2124 2124 … … 2203 2203 * Unlike AMD IOMMU paging, here there is no feature for "skipping" levels. 2204 2204 */ 2205 uint64_t uPtEntity = pMemReqAux->uSl ptPtr;2205 uint64_t uPtEntity = pMemReqAux->uSlPtPtr; 2206 2206 int8_t iLevel = pMemReqAux->cPagingLevel - 1; 2207 2207 uint8_t cLevelShift = X86_PAGE_4K_SHIFT + (iLevel * 9); … … 2480 2480 { 2481 2481 /* Read the SLPTPTR from guest memory. */ 2482 VTD_SLP_ENTRY_T Sl ptPtr;2483 RTGCPHYS const GCPhysSl ptPtr = uCtxEntryQword0 & VTD_BF_0_CONTEXT_ENTRY_SLPTPTR_MASK;2484 rc = dmarDrReadS lpPtr(pDevIns, GCPhysSlptPtr, &SlptPtr);2482 VTD_SLP_ENTRY_T SlPtPtr; 2483 RTGCPHYS const GCPhysSlPtPtr = uCtxEntryQword0 & VTD_BF_0_CONTEXT_ENTRY_SLPTPTR_MASK; 2484 rc = dmarDrReadSecondLevelPtPtr(pDevIns, GCPhysSlPtPtr, &SlPtPtr); 2485 2485 if (RT_SUCCESS(rc)) 2486 2486 { 2487 2487 /* Finally... perform second-level translation. */ 2488 pMemReqAux->uSl ptPtr = SlptPtr;2488 pMemReqAux->uSlPtPtr = SlPtPtr; 2489 2489 pMemReqAux->cPagingLevel = cPagingLevel; 2490 2490 return dmarDrMemRangeLookup(pDevIns, dmarDrSecondLevelTranslate, pMemReqRemap); … … 3123 3123 /* 3124 3124 * The below check is redundant since we check both TTM and DW for each 3125 * descriptor type we process. However, the order errors reported by hardware3125 * descriptor type we process. However, the order of errors reported by hardware 3126 3126 * may differ hence this is kept commented out but not removed if we need to 3127 3127 * change this in the future.
Note:
See TracChangeset
for help on using the changeset viewer.