Changeset 31444 in vbox
- Timestamp:
- Aug 6, 2010 7:47:04 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/VBox/types.h (modified) (1 diff)
-
src/VBox/VMM/PGMInline.h (modified) (1 diff)
-
src/VBox/VMM/VMMAll/PGMAllPhys.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/types.h
r30646 r31444 825 825 /** 826 826 * Page mapping lock. 827 *828 827 */ 829 828 typedef struct PGMPAGEMAPLOCK 830 829 { 831 /** @todo see PGMPhysIsPageMappingLockValid for possibly incorrect assumptions */832 830 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 833 /** Just a dummy for the time being. */834 uint32_t u32Dummy;835 uint32_t u32Dummy1;836 # if HC_ARCH_BITS == 64 837 uint32_t u32Align[2];838 # endif 831 /** The locked page. */ 832 void *pvPage; 833 /** Pointer to the CPU that made the mapping. 834 * In ring-0 and raw-mode context we don't intend to ever allow long term 835 * locking and this is a way of making sure we're still on the same CPU. */ 836 PVMCPU pVCpu; 839 837 #else 840 838 /** Pointer to the PGMPAGE and lock type. -
trunk/src/VBox/VMM/PGMInline.h
r31402 r31444 500 500 } 501 501 AssertFatalMsgFailed(("pgmPoolMapPageV2Inlined invalid page index %x\n", pPage->idx)); 502 }503 504 /**505 * Temporarily maps one host page specified by HC physical address, returning506 * pointer within the page.507 *508 * Be WARNED that the dynamic page mapping area is small, 8 pages, thus the space is509 * reused after 8 mappings (or perhaps a few more if you score with the cache).510 *511 * @returns The address corresponding to HCPhys.512 * @param pVM The VM handle.513 * @param HCPhys HC Physical address of the page.514 */515 DECLINLINE(void *) pgmRZDynMapHCPageOff(PVM pVM, RTHCPHYS HCPhys RTLOG_COMMA_SRC_POS_DECL)516 {517 void *pv;518 pgmRZDynMapHCPageInlined(VMMGetCpu(pVM), HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, &pv RTLOG_COMMA_SRC_POS_ARGS);519 pv = (void *)((uintptr_t)pv | ((uintptr_t)HCPhys & PAGE_OFFSET_MASK));520 return pv;521 502 } 522 503 -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r31402 r31444 1128 1128 */ 1129 1129 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 1130 *ppv = pgmRZDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK) RTLOG_COMMA_SRC_POS); 1130 void *pv; 1131 rc = pgmRZDynMapHCPageInlined(VMMGetCpu(pVM), 1132 PGM_PAGE_GET_HCPHYS(pPage), 1133 &pv 1134 RTLOG_COMMA_SRC_POS); 1135 if (RT_FAILURE(rc)) 1136 return rc; 1137 *ppv = (void *)((uintptr_t)pv | (uintptr_t)(GCPhys & PAGE_OFFSET_MASK)); 1131 1138 #else 1132 1139 PPGMPAGEMAPTLBE pTlbe; … … 1166 1173 */ 1167 1174 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 1168 *ppv = pgmRZDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK) RTLOG_COMMA_SRC_POS); /** @todo add a read only flag? */ 1175 void *pv; 1176 int rc = pgmRZDynMapHCPageInlined(VMMGetCpu(pVM), 1177 PGM_PAGE_GET_HCPHYS(pPage), 1178 &pv 1179 RTLOG_COMMA_SRC_POS); /** @todo add a read only flag? */ 1180 if (RT_FAILURE(rc)) 1181 return rc; 1182 *ppv = (void *)((uintptr_t)pv | (uintptr_t)(GCPhys & PAGE_OFFSET_MASK)); 1169 1183 #else 1170 1184 PPGMPAGEMAPTLBE pTlbe; … … 1224 1238 if (RT_SUCCESS(rc)) 1225 1239 { 1226 *ppv = pgmRZDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK) RTLOG_COMMA_SRC_POS); /** @todo add a read only flag? */1227 # if 01228 pLock->pvMap = 0;1229 pLock->pvPage = pPage;1230 # else1231 pLock->u32Dummy = UINT32_MAX;1232 # endif1233 1240 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* not returned */, ("%Rrc\n", rc)); 1234 rc = VINF_SUCCESS; 1241 1242 PVMCPU pVCpu = VMMGetCpu(pVM); 1243 void *pv; 1244 rc = pgmRZDynMapHCPageInlined(pVCpu, 1245 PGM_PAGE_GET_HCPHYS(pPage), 1246 &pv 1247 RTLOG_COMMA_SRC_POS); 1248 if (RT_SUCCESS(rc)) 1249 { 1250 AssertRCSuccess(rc); 1251 1252 pv = (void *)((uintptr_t)pv | (uintptr_t)(GCPhys & PAGE_OFFSET_MASK)); 1253 *ppv = pv; 1254 pLock->pvPage = pv; 1255 pLock->pVCpu = pVCpu; 1256 } 1235 1257 } 1236 1258 } … … 1335 1357 else 1336 1358 { 1337 *ppv = pgmRZDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK) RTLOG_COMMA_SRC_POS); /** @todo add a read only flag? */ 1338 # if 0 1339 pLock->pvMap = 0; 1340 pLock->pvPage = pPage; 1341 # else 1342 pLock->u32Dummy = UINT32_MAX; 1343 # endif 1344 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* not returned */, ("%Rrc\n", rc)); 1345 rc = VINF_SUCCESS; 1359 PVMCPU pVCpu = VMMGetCpu(pVM); 1360 void *pv; 1361 rc = pgmRZDynMapHCPageInlined(pVCpu, 1362 PGM_PAGE_GET_HCPHYS(pPage), 1363 &pv 1364 RTLOG_COMMA_SRC_POS); /** @todo add a read only flag? */ 1365 if (RT_SUCCESS(rc)) 1366 { 1367 AssertRCSuccess(rc); 1368 1369 pv = (void *)((uintptr_t)pv | (uintptr_t)(GCPhys & PAGE_OFFSET_MASK)); 1370 *ppv = pv; 1371 pLock->pvPage = pv; 1372 pLock->pVCpu = pVCpu; 1373 } 1346 1374 } 1347 1375 } … … 1479 1507 { 1480 1508 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 1481 /* currently nothing to do here. */ 1482 Assert(pLock->u32Dummy == UINT32_MAX); 1483 pLock->u32Dummy = 0; 1509 Assert(pLock->pvPage != NULL); 1510 Assert(pLock->pVCpu == VMMGetCpu(pVM)); 1511 PGM_DYNMAP_UNUSED_HINT(pLock->pVCpu, pLock->pvPage); 1512 pLock->pVCpu = NULL; 1513 pLock->pvPage = NULL; 1484 1514 1485 1515 #else
Note:
See TracChangeset
for help on using the changeset viewer.

