Changeset 81947 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Nov 18, 2019 4:14:43 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IOMAllMmioNew.cpp
r81462 r81947 858 858 * for SMP VMs if we're unlucky and the guest isn't well behaved. 859 859 */ 860 IOM_LOCK_SHARED(pVM); /** @todo Need lookup that doesn't require locking... */861 RTGCPHYS offIgn;862 uint16_t idxIgn = UINT16_MAX;863 860 # ifdef IN_RING0 864 Assert(pRegEntry == iomMmioGetEntry(pVM, GCPhysFault, &offIgn, &idxIgn) || !pRegEntryR3->fMapped);861 Assert(pRegEntry && (GCPhysFault - pRegEntryR3->GCPhysMapping < pRegEntryR3->cbRegion || !pRegEntryR3->fMapped)); 865 862 # else 866 Assert(pRegEntry == iomMmioGetEntry(pVM, GCPhysFault, &offIgn, &idxIgn) || !pRegEntry->fMapped);863 Assert(pRegEntry && (GCPhysFault - pRegEntry->GCPhysMapping < pRegEntry->cbRegion || !pRegEntry->fMapped)); 867 864 # endif 868 IOM_UNLOCK_SHARED(pVM);869 865 #endif 870 866 … … 1046 1042 * 1047 1043 * @returns VBox status code. This API may return VINF_SUCCESS even if no 1048 * remapping is made ,.1044 * remapping is made. 1049 1045 * 1050 1046 * @param pVM The cross context VM structure. … … 1102 1098 * to prevent remapping. Shared suffices as we change nothing. 1103 1099 */ 1104 IOM_LOCK_SHARED(pVM); 1105 1106 RTGCPHYS const GCPhys = pRegEntry->fMapped ? pRegEntry->GCPhysMapping : NIL_RTGCPHYS; 1107 AssertReturnStmt(GCPhys != NIL_RTGCPHYS, IOM_UNLOCK_SHARED(pVM), VERR_IOM_MMIO_REGION_NOT_MAPPED); 1108 Assert(!(GCPhys & PAGE_OFFSET_MASK)); 1109 1110 /* 1111 * Do the aliasing; page align the addresses since PGM is picky. 1112 */ 1100 int rc = IOM_LOCK_SHARED(pVM); 1101 if (rc == VINF_SUCCESS) 1102 { 1103 RTGCPHYS const GCPhys = pRegEntry->fMapped ? pRegEntry->GCPhysMapping : NIL_RTGCPHYS; 1104 if (GCPhys != NIL_RTGCPHYS) 1105 { 1106 Assert(!(GCPhys & PAGE_OFFSET_MASK)); 1107 1108 /* 1109 * Do the aliasing; page align the addresses since PGM is picky. 1110 */ 1113 1111 #if 0 /** @todo fix when DevVGA is converted to new model. */ 1114 intrc = PGMHandlerPhysicalPageAlias(pVM, GCPhys, GCPhys + (offRange & ~(RTGCPHYS)PAGE_OFFSET_MASK),1115 pDevIns, hMmio2, offMmio2);1112 rc = PGMHandlerPhysicalPageAlias(pVM, GCPhys, GCPhys + (offRange & ~(RTGCPHYS)PAGE_OFFSET_MASK), 1113 pDevIns, hMmio2, offMmio2); 1116 1114 #else 1117 AssertFailed(); 1118 int rc = VERR_NOT_IMPLEMENTED; 1119 RT_NOREF(offMmio2, hMmio2); 1120 #endif 1121 1122 IOM_UNLOCK_SHARED(pVM); 1123 1124 AssertRCReturn(rc, rc); 1115 AssertFailed(); 1116 rc = VERR_NOT_IMPLEMENTED; 1117 RT_NOREF(offMmio2, hMmio2); 1118 #endif 1119 } 1120 else 1121 AssertFailedStmt(rc = VERR_IOM_MMIO_REGION_NOT_MAPPED); 1122 1123 IOM_UNLOCK_SHARED(pVM); 1124 } 1125 1125 1126 1126 /** @todo either ditch this or replace it with something that works in the … … 1144 1144 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1145 1145 #endif 1146 return VINF_SUCCESS;1146 return rc; 1147 1147 } 1148 1148 … … 1180 1180 * Check input address (it's HM calling, not the device, so no region handle). 1181 1181 */ 1182 IOM_LOCK_SHARED(pVM); 1183 RTGCPHYS offIgn; 1184 uint16_t idxIgn = UINT16_MAX; 1185 PIOMMMIOENTRYR0 pRegEntry = iomMmioGetEntry(pVM, GCPhys, &offIgn, &idxIgn); 1186 IOM_UNLOCK_SHARED(pVM); 1187 Assert(pRegEntry); 1188 Assert(pRegEntry && !(pRegEntry->cbRegion & PAGE_OFFSET_MASK)); 1182 int rcSem = IOM_LOCK_SHARED(pVM); 1183 if (rcSem == VINF_SUCCESS) 1184 { 1185 RTGCPHYS offIgn; 1186 uint16_t idxIgn = UINT16_MAX; 1187 PIOMMMIOENTRYR0 pRegEntry = iomMmioGetEntry(pVM, GCPhys, &offIgn, &idxIgn); 1188 IOM_UNLOCK_SHARED(pVM); 1189 Assert(pRegEntry); 1190 Assert(pRegEntry && !(pRegEntry->cbRegion & PAGE_OFFSET_MASK)); 1191 } 1189 1192 # endif 1190 1193 … … 1263 1266 Assert((pRegEntry->cbRegion & PAGE_OFFSET_MASK) == 0); 1264 1267 1265 IOM_LOCK_SHARED(pVM);1268 int rcSem = IOM_LOCK_SHARED(pVM); 1266 1269 RTGCPHYS GCPhys = pRegEntry->fMapped ? pRegEntry->GCPhysMapping : NIL_RTGCPHYS; 1267 IOM_UNLOCK_SHARED(pVM); 1270 if (rcSem == VINF_SUCCESS) 1271 IOM_UNLOCK_SHARED(pVM); 1268 1272 1269 1273 Assert(!(GCPhys & PAGE_OFFSET_MASK));
Note:
See TracChangeset
for help on using the changeset viewer.