Changeset 89452 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 2, 2021 7:46:32 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144806
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp
r89451 r89452 192 192 kDmarDiag_Atf_Lgn_1_2, 193 193 kDmarDiag_Atf_Lgn_1_3, 194 kDmarDiag_Atf_Lgn_4, 194 195 kDmarDiag_Atf_Lrt_1, 195 196 kDmarDiag_Atf_Lrt_2, … … 202 203 kDmarDiag_Atf_Rta_1_3, 203 204 kDmarDiag_Atf_Sgn_5, 205 kDmarDiag_Atf_Sgn_8, 204 206 kDmarDiag_Atf_Ssl_1, 205 207 kDmarDiag_Atf_Ssl_2, … … 269 271 DMARDIAG_DESC(Atf_Lgn_1_2 ), 270 272 DMARDIAG_DESC(Atf_Lgn_1_3 ), 273 DMARDIAG_DESC(Atf_Lgn_4 ), 271 274 DMARDIAG_DESC(Atf_Lrt_1 ), 272 275 DMARDIAG_DESC(Atf_Lrt_2 ), … … 279 282 DMARDIAG_DESC(Atf_Rta_1_3 ), 280 283 DMARDIAG_DESC(Atf_Sgn_5 ), 284 DMARDIAG_DESC(Atf_Sgn_8 ), 281 285 DMARDIAG_DESC(Atf_Ssl_1 ), 282 286 DMARDIAG_DESC(Atf_Ssl_2 ), … … 1994 1998 1995 1999 /** 2000 * Validates the output address of a translation and updates the IOTLB entry for the 2001 * given memory request remapping. 2002 * 2003 * @returns VBox status code. 2004 * @param pDevIns The IOMMU device instance. 2005 * @param GCPhyseBase The output address of the translation. 2006 * @param cShift The page shift of the translation. 2007 * @param fPerm The permissions granted for the translated. 2008 * @param idDomain The domain ID of the translated region. 2009 * @param pMemReqRemap The DMA memory request remapping info. 2010 */ 2011 static int dmarDrValidateAndUpdateIotlbe(PPDMDEVINS pDevIns, RTGCPHYS GCPhyseBase, uint8_t cShift, uint8_t fPerm, 2012 uint16_t idDomain, PDMARMEMREQREMAP pMemReqRemap) 2013 { 2014 Assert( pMemReqRemap->fTtm == VTD_TTM_LEGACY_MODE 2015 || pMemReqRemap->fTtm == VTD_TTM_SCALABLE_MODE); 2016 Assert(!(GCPhyseBase & X86_PAGE_4K_OFFSET_MASK)); 2017 2018 /* Ensure the output address is not in the interrupt address range. */ 2019 if (GCPhyseBase - VBOX_MSI_ADDR_BASE >= VBOX_MSI_ADDR_SIZE) 2020 { 2021 pMemReqRemap->Iotlbe.GCPhysBase = GCPhyseBase; 2022 pMemReqRemap->Iotlbe.cShift = cShift; 2023 pMemReqRemap->Iotlbe.fPerm = fPerm; 2024 pMemReqRemap->Iotlbe.idDomain = idDomain; 2025 return VINF_SUCCESS; 2026 } 2027 2028 if (pMemReqRemap->fTtm == VTD_TTM_LEGACY_MODE) 2029 dmarAtFaultRecord(pDevIns, kDmarDiag_Atf_Lgn_4, VTDATFAULT_LGN_4, pMemReqRemap); 2030 else 2031 dmarAtFaultRecord(pDevIns, kDmarDiag_Atf_Sgn_8, VTDATFAULT_SGN_8, pMemReqRemap); 2032 return VERR_IOMMU_ADDR_TRANSLATION_FAILED; 2033 } 2034 2035 2036 /** 1996 2037 * Performs second level translation. 1997 2038 * … … 2112 2153 if (fSllpsMask & RT_BIT(iLevel - 1)) 2113 2154 { 2114 pMemReqRemap->Iotlbe.GCPhysBase = uPtEntity & ~(RT_BIT_64(cLevelShift) - 1); 2115 pMemReqRemap->Iotlbe.cShift = cLevelShift; 2116 pMemReqRemap->Iotlbe.fPerm = fPtPerm; 2117 pMemReqRemap->Iotlbe.idDomain = idDomain; 2118 return VINF_SUCCESS; 2155 RTGCPHYS const GCPhysBase = uPtEntity & ~(RT_BIT_64(cLevelShift) - 1); 2156 return dmarDrValidateAndUpdateIotlbe(pDevIns, GCPhysBase, cLevelShift, fPtPerm, idDomain, pMemReqRemap); 2119 2157 } 2120 2158 … … 2131 2169 if (iLevel == 0) 2132 2170 { 2133 pMemReqRemap->Iotlbe.GCPhysBase = uPtEntity & ~(RT_BIT_64(cLevelShift) - 1); 2134 pMemReqRemap->Iotlbe.cShift = cLevelShift; 2135 pMemReqRemap->Iotlbe.fPerm = fPtPerm; 2136 pMemReqRemap->Iotlbe.idDomain = idDomain; 2137 return VINF_SUCCESS; 2171 RTGCPHYS const GCPhysBase = uPtEntity & ~(RT_BIT_64(cLevelShift) - 1); 2172 return dmarDrValidateAndUpdateIotlbe(pDevIns, GCPhysBase, cLevelShift, fPtPerm, idDomain, pMemReqRemap); 2138 2173 } 2139 2174 }
Note:
See TracChangeset
for help on using the changeset viewer.