Changeset 82591 in vbox
- Timestamp:
- Dec 16, 2019 5:55:40 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135476
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r82496 r82591 431 431 VBOX_WITH_NATIVE_NEM = 1 432 432 endif 433 # Enables mapping guest RAM into host kernel space. 434 #if1of ($(KBUILD_TARGET), linux win) 435 # VBOX_WITH_RAM_IN_KERNEL := 1 436 #endif 433 437 ## @} 434 438 -
trunk/include/VBox/vmm/gmm.h
r80346 r82591 414 414 GMMR0DECL(int) GMMR0MapUnmapChunk(PGVM pGVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3); 415 415 GMMR0DECL(int) GMMR0SeedChunk(PGVM pGVM, VMCPUID idCpu, RTR3PTR pvR3); 416 GMMR0DECL(int) GMMR0PageIdToVirt(PGVM pGVM, uint32_t idPage, void **ppv); 416 417 GMMR0DECL(int) GMMR0RegisterSharedModule(PGVM pGVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName, 417 418 char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule, uint32_t cRegions, -
trunk/src/VBox/VMM/Config.kmk
r81153 r82591 81 81 endif 82 82 endif 83 ifdef VBOX_WITH_RAM_IN_KERNEL 84 VMM_COMMON_DEFS += VBOX_WITH_RAM_IN_KERNEL 85 if1of ($(KBUILD_TARGET), linux solaris) # Hosts that implements SUPR0HCPhysToVirt. 86 VMM_COMMON_DEFS += VBOX_WITH_LINEAR_HOST_PHYS_MEM 87 endif 88 endif 83 89 84 90 # VMM_COMMON_DEFS += VBOX_WITH_NS_ACCOUNTING_STATS -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r81153 r82591 2154 2154 if (RT_SUCCESS(rc)) 2155 2155 { 2156 # ifdef VBOX_WITH_RAM_IN_KERNEL 2157 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)ppPd); 2158 if (RT_SUCCESS(rc)) 2159 { 2160 # ifdef IN_RING3 2161 pVCpu->pgm.s.pGst32BitPdR0 = NIL_RTR0PTR; 2162 pVCpu->pgm.s.pGst32BitPdR3 = *ppPd; 2163 # else 2164 pVCpu->pgm.s.pGst32BitPdR3 = NIL_RTR0PTR; 2165 pVCpu->pgm.s.pGst32BitPdR0 = *ppPd; 2166 # endif 2167 pgmUnlock(pVM); 2168 return VINF_SUCCESS; 2169 } 2170 # else 2156 2171 RTHCPTR HCPtrGuestCR3; 2157 2172 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)&HCPtrGuestCR3); … … 2159 2174 { 2160 2175 pVCpu->pgm.s.pGst32BitPdR3 = (R3PTRTYPE(PX86PD))HCPtrGuestCR3; 2161 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE2176 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 2162 2177 pVCpu->pgm.s.pGst32BitPdR0 = (R0PTRTYPE(PX86PD))HCPtrGuestCR3; 2163 # endif2178 # endif 2164 2179 *ppPd = (PX86PD)HCPtrGuestCR3; 2165 2180 … … 2167 2182 return VINF_SUCCESS; 2168 2183 } 2169 2184 # endif 2170 2185 AssertRC(rc); 2171 2186 } … … 2196 2211 if (RT_SUCCESS(rc)) 2197 2212 { 2213 # ifdef VBOX_WITH_RAM_IN_KERNEL 2214 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)ppPdpt); 2215 if (RT_SUCCESS(rc)) 2216 { 2217 # ifdef IN_RING3 2218 pVCpu->pgm.s.pGstPaePdptR0 = NIL_RTR0PTR; 2219 pVCpu->pgm.s.pGstPaePdptR3 = *ppPdpt; 2220 # else 2221 pVCpu->pgm.s.pGstPaePdptR3 = NIL_RTR3PTR; 2222 pVCpu->pgm.s.pGstPaePdptR0 = *ppPdpt; 2223 # endif 2224 pgmUnlock(pVM); 2225 return VINF_SUCCESS; 2226 } 2227 # else 2198 2228 RTHCPTR HCPtrGuestCR3; 2199 2229 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)&HCPtrGuestCR3); … … 2201 2231 { 2202 2232 pVCpu->pgm.s.pGstPaePdptR3 = (R3PTRTYPE(PX86PDPT))HCPtrGuestCR3; 2203 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE2233 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 2204 2234 pVCpu->pgm.s.pGstPaePdptR0 = (R0PTRTYPE(PX86PDPT))HCPtrGuestCR3; 2205 # endif2235 # endif 2206 2236 *ppPdpt = (PX86PDPT)HCPtrGuestCR3; 2207 2237 … … 2209 2239 return VINF_SUCCESS; 2210 2240 } 2211 2241 # endif 2212 2242 AssertRC(rc); 2213 2243 } … … 2244 2274 if (RT_SUCCESS(rc)) 2245 2275 { 2276 # ifdef VBOX_WITH_RAM_IN_KERNEL 2277 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhys, (void **)ppPd); 2278 AssertRC(rc); 2279 if (RT_SUCCESS(rc)) 2280 { 2281 # ifdef IN_RING3 2282 pVCpu->pgm.s.apGstPaePDsR0[iPdpt] = NIL_RTR0PTR; 2283 pVCpu->pgm.s.apGstPaePDsR3[iPdpt] = *ppPd; 2284 # else 2285 pVCpu->pgm.s.apGstPaePDsR3[iPdpt] = NIL_RTR3PTR; 2286 pVCpu->pgm.s.apGstPaePDsR0[iPdpt] = *ppPd; 2287 # endif 2288 if (fChanged) 2289 pVCpu->pgm.s.aGCPhysGstPaePDs[iPdpt] = GCPhys; 2290 pgmUnlock(pVM); 2291 return VINF_SUCCESS; 2292 } 2293 # else 2246 2294 RTHCPTR HCPtr = NIL_RTHCPTR; 2247 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R02295 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 2248 2296 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhys, &HCPtr); 2249 2297 AssertRC(rc); 2250 # endif2298 # endif 2251 2299 if (RT_SUCCESS(rc)) 2252 2300 { 2253 2301 pVCpu->pgm.s.apGstPaePDsR3[iPdpt] = (R3PTRTYPE(PX86PDPAE))HCPtr; 2254 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE2302 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 2255 2303 pVCpu->pgm.s.apGstPaePDsR0[iPdpt] = (R0PTRTYPE(PX86PDPAE))HCPtr; 2256 # endif2304 # endif 2257 2305 if (fChanged) 2258 2306 pVCpu->pgm.s.aGCPhysGstPaePDs[iPdpt] = GCPhys; … … 2262 2310 return VINF_SUCCESS; 2263 2311 } 2312 # endif 2264 2313 } 2265 2314 2266 2315 /* Invalid page or some failure, invalidate the entry. */ 2267 2316 pVCpu->pgm.s.aGCPhysGstPaePDs[iPdpt] = NIL_RTGCPHYS; 2268 pVCpu->pgm.s.apGstPaePDsR3[iPdpt] = 0;2317 pVCpu->pgm.s.apGstPaePDsR3[iPdpt] = NIL_RTR3PTR; 2269 2318 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 2270 pVCpu->pgm.s.apGstPaePDsR0[iPdpt] = 0;2319 pVCpu->pgm.s.apGstPaePDsR0[iPdpt] = NIL_RTR0PTR; 2271 2320 # endif 2272 2321 … … 2295 2344 if (RT_SUCCESS(rc)) 2296 2345 { 2346 # ifdef VBOX_WITH_RAM_IN_KERNEL 2347 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)ppPml4); 2348 if (RT_SUCCESS(rc)) 2349 { 2350 # ifdef IN_RING3 2351 pVCpu->pgm.s.pGstAmd64Pml4R0 = NIL_RTR0PTR; 2352 pVCpu->pgm.s.pGstAmd64Pml4R3 = *ppPml4; 2353 # else 2354 pVCpu->pgm.s.pGstAmd64Pml4R3 = NIL_RTR3PTR; 2355 pVCpu->pgm.s.pGstAmd64Pml4R0 = *ppPml4; 2356 # endif 2357 pgmUnlock(pVM); 2358 return VINF_SUCCESS; 2359 } 2360 # else 2297 2361 RTHCPTR HCPtrGuestCR3; 2298 2362 rc = pgmPhysGCPhys2CCPtrInternalDepr(pVM, pPage, GCPhysCR3, (void **)&HCPtrGuestCR3); … … 2300 2364 { 2301 2365 pVCpu->pgm.s.pGstAmd64Pml4R3 = (R3PTRTYPE(PX86PML4))HCPtrGuestCR3; 2302 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE2366 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 2303 2367 pVCpu->pgm.s.pGstAmd64Pml4R0 = (R0PTRTYPE(PX86PML4))HCPtrGuestCR3; 2304 # endif2368 # endif 2305 2369 *ppPml4 = (PX86PML4)HCPtrGuestCR3; 2306 2370 … … 2308 2372 return VINF_SUCCESS; 2309 2373 } 2374 # endif 2310 2375 } 2311 2376 -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r80268 r82591 4341 4341 { 4342 4342 # if PGM_GST_TYPE == PGM_TYPE_32BIT 4343 # ifdef VBOX_WITH_RAM_IN_KERNEL 4344 # ifdef IN_RING3 4345 pVCpu->pgm.s.pGst32BitPdR3 = (PX86PD)HCPtrGuestCR3; 4346 pVCpu->pgm.s.pGst32BitPdR0 = NIL_RTR0PTR; 4347 # else 4348 pVCpu->pgm.s.pGst32BitPdR3 = NIL_RTR3PTR; 4349 pVCpu->pgm.s.pGst32BitPdR0 = (PX86PD)HCPtrGuestCR3; 4350 # endif 4351 # else 4343 4352 pVCpu->pgm.s.pGst32BitPdR3 = (R3PTRTYPE(PX86PD))HCPtrGuestCR3; 4344 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE4353 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 4345 4354 pVCpu->pgm.s.pGst32BitPdR0 = (R0PTRTYPE(PX86PD))HCPtrGuestCR3; 4355 # endif 4346 4356 # endif 4347 4357 4348 4358 # elif PGM_GST_TYPE == PGM_TYPE_PAE 4359 # ifdef VBOX_WITH_RAM_IN_KERNEL 4360 # ifdef IN_RING3 4361 pVCpu->pgm.s.pGstPaePdptR3 = (PX86PDPT)HCPtrGuestCR3; 4362 pVCpu->pgm.s.pGstPaePdptR0 = NIL_RTR0PTR; 4363 # else 4364 pVCpu->pgm.s.pGstPaePdptR3 = NIL_RTR3PTR; 4365 pVCpu->pgm.s.pGstPaePdptR0 = (PX86PDPT)HCPtrGuestCR3; 4366 # endif 4367 # else 4349 4368 pVCpu->pgm.s.pGstPaePdptR3 = (R3PTRTYPE(PX86PDPT))HCPtrGuestCR3; 4350 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE4369 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 4351 4370 pVCpu->pgm.s.pGstPaePdptR0 = (R0PTRTYPE(PX86PDPT))HCPtrGuestCR3; 4371 # endif 4352 4372 # endif 4353 4373 … … 4375 4395 if (RT_SUCCESS(rc2)) 4376 4396 { 4397 # ifdef VBOX_WITH_RAM_IN_KERNEL 4398 # ifdef IN_RING3 4399 pVCpu->pgm.s.apGstPaePDsR3[i] = (PX86PDPAE)HCPtr; 4400 pVCpu->pgm.s.apGstPaePDsR0[i] = NIL_RTR0PTR; 4401 # else 4402 pVCpu->pgm.s.apGstPaePDsR3[i] = NIL_RTR3PTR; 4403 pVCpu->pgm.s.apGstPaePDsR0[i] = (PX86PDPAE)HCPtr; 4404 # endif 4405 # else 4377 4406 pVCpu->pgm.s.apGstPaePDsR3[i] = (R3PTRTYPE(PX86PDPAE))HCPtr; 4378 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE4407 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 4379 4408 pVCpu->pgm.s.apGstPaePDsR0[i] = (R0PTRTYPE(PX86PDPAE))HCPtr; 4409 # endif 4380 4410 # endif 4381 4411 pVCpu->pgm.s.aGCPhysGstPaePDs[i] = GCPhys; … … 4393 4423 4394 4424 # elif PGM_GST_TYPE == PGM_TYPE_AMD64 4425 # ifdef VBOX_WITH_RAM_IN_KERNEL 4426 # ifdef IN_RING3 4427 pVCpu->pgm.s.pGstAmd64Pml4R3 = (PX86PML4)HCPtrGuestCR3; 4428 pVCpu->pgm.s.pGstAmd64Pml4R0 = NIL_RTR0PTR; 4429 # else 4430 pVCpu->pgm.s.pGstAmd64Pml4R3 = NIL_RTR3PTR; 4431 pVCpu->pgm.s.pGstAmd64Pml4R0 = (PX86PML4)HCPtrGuestCR3; 4432 # endif 4433 # else 4395 4434 pVCpu->pgm.s.pGstAmd64Pml4R3 = (R3PTRTYPE(PX86PML4))HCPtrGuestCR3; 4396 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE4435 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 4397 4436 pVCpu->pgm.s.pGstAmd64Pml4R0 = (R0PTRTYPE(PX86PML4))HCPtrGuestCR3; 4437 # endif 4398 4438 # endif 4399 4439 # endif -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r81624 r82591 573 573 pVM->pgm.s.PhysTlbR0.aEntries[i].GCPhys = NIL_RTGCPHYS; 574 574 pVM->pgm.s.PhysTlbR0.aEntries[i].pPage = 0; 575 #ifndef VBOX_WITH_RAM_IN_KERNEL 575 576 pVM->pgm.s.PhysTlbR0.aEntries[i].pMap = 0; 577 #endif 576 578 pVM->pgm.s.PhysTlbR0.aEntries[i].pv = 0; 577 579 } … … 605 607 pVM->pgm.s.PhysTlbR0.aEntries[idx].GCPhys = NIL_RTGCPHYS; 606 608 pVM->pgm.s.PhysTlbR0.aEntries[idx].pPage = 0; 609 #ifndef VBOX_WITH_RAM_IN_KERNEL 607 610 pVM->pgm.s.PhysTlbR0.aEntries[idx].pMap = 0; 611 #endif 608 612 pVM->pgm.s.PhysTlbR0.aEntries[idx].pv = 0; 609 613 … … 1131 1135 * @param pVM The cross context VM structure. 1132 1136 * @param idPage The Page ID. 1133 * @param HCPhys The physical address (for RC).1137 * @param HCPhys The physical address (for SUPR0HCPhysToVirt). 1134 1138 * @param ppv Where to store the mapping address. 1135 1139 * … … 1152 1156 */ 1153 1157 return pgmRZDynMapHCPageInlined(VMMGetCpu(pVM), HCPhys, ppv RTLOG_COMMA_SRC_POS); 1158 1159 #elif defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) 1160 # ifdef VBOX_WITH_LINEAR_HOST_PHYS_MEM 1161 return SUPR0HCPhysToVirt(HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, ppv); 1162 # else 1163 return GMMR0PageIdToVirt(pVM, idPage, ppv); 1164 # endif 1154 1165 1155 1166 #else … … 1253 1264 AssertLogRelReturn(pMmio2Range->idMmio2 == idMmio2, VERR_PGM_PHYS_PAGE_MAP_MMIO2_IPE); 1254 1265 AssertLogRelReturn(iPage < (pMmio2Range->RamRange.cb >> PAGE_SHIFT), VERR_PGM_PHYS_PAGE_MAP_MMIO2_IPE); 1266 *ppMap = NULL; 1267 # if defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) && defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 1268 return SUPR0HCPhysToVirt(PGM_PAGE_GET_HCPHYS(pPage), ppv); 1269 # elif defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) 1270 *ppv = (uint8_t *)pMmio2Range->pvR0 + ((uintptr_t)iPage << PAGE_SHIFT); 1271 return VINF_SUCCESS; 1272 # else 1255 1273 *ppv = (uint8_t *)pMmio2Range->RamRange.pvR3 + ((uintptr_t)iPage << PAGE_SHIFT); 1256 *ppMap = NULL;1257 1274 return VINF_SUCCESS; 1275 # endif 1258 1276 } 1259 1277 … … 1277 1295 } 1278 1296 1297 # if defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) && defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 1298 /* 1299 * Just use the physical address. 1300 */ 1301 *ppMap = NULL; 1302 return SUPR0HCPhysToVirt(PGM_PAGE_GET_HCPHYS(pPage), ppv); 1303 1304 # elif defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) 1305 /* 1306 * Go by page ID thru GMMR0. 1307 */ 1308 *ppMap = NULL; 1309 return GMMR0PageIdToVirt(pVM, PGM_PAGE_GET_PAGEID(pPage), ppv); 1310 1311 # else 1279 1312 /* 1280 1313 * Find/make Chunk TLB entry for the mapping chunk. … … 1326 1359 *ppMap = pMap; 1327 1360 return VINF_SUCCESS; 1361 # endif /* !IN_RING0 || !VBOX_WITH_RAM_IN_KERNEL */ 1328 1362 #endif /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 */ 1329 1363 } … … 1480 1514 if (RT_FAILURE(rc)) 1481 1515 return rc; 1516 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1482 1517 pTlbe->pMap = pMap; 1518 # endif 1483 1519 pTlbe->pv = pv; 1484 1520 Assert(!((uintptr_t)pTlbe->pv & PAGE_OFFSET_MASK)); … … 1487 1523 { 1488 1524 AssertMsg(PGM_PAGE_GET_HCPHYS(pPage) == pVM->pgm.s.HCPhysZeroPg, ("%RGp/%R[pgmpage]\n", GCPhys, pPage)); 1525 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1489 1526 pTlbe->pMap = NULL; 1527 # endif 1490 1528 pTlbe->pv = pVM->pgm.s.CTXALLSUFF(pvZeroPg); 1491 1529 } … … 1575 1613 DECLINLINE(void) pgmPhysPageMapLockForWriting(PVM pVM, PPGMPAGE pPage, PPGMPAGEMAPTLBE pTlbe, PPGMPAGEMAPLOCK pLock) 1576 1614 { 1615 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1577 1616 PPGMPAGEMAP pMap = pTlbe->pMap; 1578 1617 if (pMap) 1579 1618 pMap->cRefs++; 1619 # else 1620 RT_NOREF(pTlbe); 1621 # endif 1580 1622 1581 1623 unsigned cLocks = PGM_PAGE_GET_WRITE_LOCKS(pPage); … … 1590 1632 PGM_PAGE_INC_WRITE_LOCKS(pPage); 1591 1633 AssertMsgFailed(("%R[pgmpage] is entering permanent write locked state!\n", pPage)); 1634 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1592 1635 if (pMap) 1593 1636 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1637 # endif 1594 1638 } 1595 1639 1596 1640 pLock->uPageAndType = (uintptr_t)pPage | PGMPAGEMAPLOCK_TYPE_WRITE; 1641 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1597 1642 pLock->pvMap = pMap; 1643 # else 1644 pLock->pvMap = NULL; 1645 # endif 1598 1646 } 1599 1647 … … 1608 1656 DECLINLINE(void) pgmPhysPageMapLockForReading(PVM pVM, PPGMPAGE pPage, PPGMPAGEMAPTLBE pTlbe, PPGMPAGEMAPLOCK pLock) 1609 1657 { 1658 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1610 1659 PPGMPAGEMAP pMap = pTlbe->pMap; 1611 1660 if (pMap) 1612 1661 pMap->cRefs++; 1662 # else 1663 RT_NOREF(pTlbe); 1664 # endif 1613 1665 1614 1666 unsigned cLocks = PGM_PAGE_GET_READ_LOCKS(pPage); … … 1623 1675 PGM_PAGE_INC_READ_LOCKS(pPage); 1624 1676 AssertMsgFailed(("%R[pgmpage] is entering permanent read locked state!\n", pPage)); 1677 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1625 1678 if (pMap) 1626 1679 pMap->cRefs++; /* Extra ref to prevent it from going away. */ 1680 # endif 1627 1681 } 1628 1682 1629 1683 pLock->uPageAndType = (uintptr_t)pPage | PGMPAGEMAPLOCK_TYPE_READ; 1684 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 1630 1685 pLock->pvMap = pMap; 1686 # else 1687 pLock->pvMap = NULL; 1688 # endif 1631 1689 } 1632 1690 … … 2042 2100 2043 2101 #else 2102 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 2044 2103 PPGMPAGEMAP pMap = (PPGMPAGEMAP)pLock->pvMap; 2104 # endif 2045 2105 PPGMPAGE pPage = (PPGMPAGE)(pLock->uPageAndType & ~PGMPAGEMAPLOCK_TYPE_MASK); 2046 2106 bool fWriteLock = (pLock->uPageAndType & PGMPAGEMAPLOCK_TYPE_MASK) == PGMPAGEMAPLOCK_TYPE_WRITE; … … 2084 2144 } 2085 2145 2146 # if !defined(IN_RING0) || !defined(VBOX_WITH_RAM_IN_KERNEL) 2086 2147 if (pMap) 2087 2148 { … … 2089 2150 pMap->cRefs--; 2090 2151 } 2152 # endif 2091 2153 pgmUnlock(pVM); 2092 2154 #endif /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 */ … … 4268 4330 *ppb = NULL; 4269 4331 #else 4270 PPGMPAGE R3MAPTLBE pTlbe;4332 PPGMPAGEMAPTLBE pTlbe; 4271 4333 rc = pgmPhysPageQueryTlbeWithPage(pVM, pPage, GCPhys, &pTlbe); 4272 4334 AssertLogRelRCReturn(rc, rc); … … 4309 4371 *ppb = NULL; 4310 4372 #else 4311 PPGMPAGE R3MAPTLBE pTlbe;4373 PPGMPAGEMAPTLBE pTlbe; 4312 4374 rc = pgmPhysPageQueryTlbeWithPage(pVM, pPage, GCPhys, &pTlbe); 4313 4375 AssertLogRelRCReturn(rc, rc); … … 4437 4499 #else 4438 4500 /* Get a ring-3 mapping of the address. */ 4439 PPGMPAGE R3MAPTLBE pTlbe;4501 PPGMPAGEMAPTLBE pTlbe; 4440 4502 rc2 = pgmPhysPageQueryTlbeWithPage(pVM, pPage, GCPhys, &pTlbe); 4441 4503 AssertLogRelRCReturn(rc2, rc2); … … 4664 4726 4665 4727 return rc; 4666 4667 } 4668 4728 } 4729 -
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r82333 r82591 130 130 if (pTimer->enmType == TMTIMERTYPE_DEV) 131 131 { 132 RTCCUINTREG fSavedFlags = ASMAddFlags(X86_EFL_AC); /** @todo fix ring-3 pointer use */ 132 133 PPDMDEVINSR0 pDevInsR0 = ((struct PDMDEVINSR3 *)pTimer->u.Dev.pDevIns)->pDevInsR0RemoveMe; /* !ring-3 read! */ 134 ASMSetFlags(fSavedFlags); 133 135 struct PDMDEVINSR3 *pDevInsR3 = pDevInsR0->pDevInsForR3R0; 134 136 if (pTimer->pCritSect == pDevInsR3->pCritSectRoR3) -
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r81369 r82591 400 400 * and related frees.) */ 401 401 RTR0MEMOBJ hMemObj; 402 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 403 /** Pointer to the kernel mapping. */ 404 uint8_t *pbMapping; 405 #endif 402 406 /** Pointer to the next chunk in the free list. (Giant mtx.) */ 403 407 PGMMCHUNK pFreeNext; … … 2113 2117 * @param pGMM Pointer to the GMM instance. 2114 2118 * @param pSet Pointer to the set. 2115 * @param MemObjThe memory object for the chunk.2119 * @param hMemObj The memory object for the chunk. 2116 2120 * @param hGVM The affinity of the chunk. NIL_GVM_HANDLE for no 2117 2121 * affinity. … … 2123 2127 * the success path. On failure, no locks will be held. 2124 2128 */ 2125 static int gmmR0RegisterChunk(PGMM pGMM, PGMMCHUNKFREESET pSet, RTR0MEMOBJ MemObj, uint16_t hGVM, uint16_t fChunkFlags,2129 static int gmmR0RegisterChunk(PGMM pGMM, PGMMCHUNKFREESET pSet, RTR0MEMOBJ hMemObj, uint16_t hGVM, uint16_t fChunkFlags, 2126 2130 PGMMCHUNK *ppChunk) 2127 2131 { … … 2130 2134 Assert(fChunkFlags == 0 || fChunkFlags == GMM_CHUNK_FLAGS_LARGE_PAGE); 2131 2135 2136 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 2137 /* 2138 * Get a ring-0 mapping of the object. 2139 */ 2140 uint8_t *pbMapping = (uint8_t *)RTR0MemObjAddress(hMemObj); 2141 if (!pbMapping) 2142 { 2143 RTR0MEMOBJ hMapObj; 2144 int rc = RTR0MemObjMapKernel(&hMapObj, hMemObj, (void *)-1, 0, RTMEM_PROT_READ | RTMEM_PROT_WRITE); 2145 if (RT_SUCCESS(rc)) 2146 pbMapping = (uint8_t *)RTR0MemObjAddress(hMapObj); 2147 else 2148 return rc; 2149 AssertPtr(pbMapping); 2150 } 2151 #endif 2152 2153 /* 2154 * Allocate a chunk. 2155 */ 2132 2156 int rc; 2133 2157 PGMMCHUNK pChunk = (PGMMCHUNK)RTMemAllocZ(sizeof(*pChunk)); … … 2137 2161 * Initialize it. 2138 2162 */ 2139 pChunk->hMemObj = MemObj; 2163 pChunk->hMemObj = hMemObj; 2164 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 2165 pChunk->pbMapping = pbMapping; 2166 #endif 2140 2167 pChunk->cFree = GMM_CHUNK_NUM_PAGES; 2141 2168 pChunk->hGVM = hGVM; … … 2217 2244 if (RT_SUCCESS(rc)) 2218 2245 { 2219 /** @todo Duplicate gmmR0RegisterChunk here so we can avoid chaining up the2220 * free pages first and then unchaining them right afterwards. Instead2221 * do as much work as possible without holding the giant lock. */2246 /** @todo Duplicate gmmR0RegisterChunk here so we can avoid chaining up the 2247 * free pages first and then unchaining them right afterwards. Instead 2248 * do as much work as possible without holding the giant lock. */ 2222 2249 PGMMCHUNK pChunk; 2223 2250 rc = gmmR0RegisterChunk(pGMM, pSet, hMemObj, pGVM->hSelf, 0 /*fChunkFlags*/, &pChunk); … … 2229 2256 2230 2257 /* bail out */ 2231 RTR0MemObjFree(hMemObj, false /* fFreeMappings */);2258 RTR0MemObjFree(hMemObj, true /* fFreeMappings */); 2232 2259 } 2233 2260 … … 3104 3131 gmmR0LinkChunk(pChunk, pSet); 3105 3132 gmmR0MutexRelease(pGMM); 3133 LogFlow(("GMMR0AllocateLargePage: returns VINF_SUCCESS\n")); 3134 return VINF_SUCCESS; 3106 3135 } 3107 else 3108 RTR0MemObjFree(hMemObj, false /* fFreeMappings */); 3136 RTR0MemObjFree(hMemObj, true /* fFreeMappings */); 3109 3137 } 3110 3138 } … … 3292 3320 RTMemFree(pChunk); 3293 3321 3322 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 3323 int rc = RTR0MemObjFree(hMemObj, true /* fFreeMappings */); 3324 #else 3294 3325 int rc = RTR0MemObjFree(hMemObj, false /* fFreeMappings */); 3326 #endif 3295 3327 AssertLogRelRC(rc); 3296 3328 … … 4255 4287 * (The GMM locking is done inside gmmR0RegisterChunk.) 4256 4288 */ 4257 RTR0MEMOBJ MemObj;4258 rc = RTR0MemObjLockUser(& MemObj, pvR3, GMM_CHUNK_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE, NIL_RTR0PROCESS);4289 RTR0MEMOBJ hMemObj; 4290 rc = RTR0MemObjLockUser(&hMemObj, pvR3, GMM_CHUNK_SIZE, RTMEM_PROT_READ | RTMEM_PROT_WRITE, NIL_RTR0PROCESS); 4259 4291 if (RT_SUCCESS(rc)) 4260 4292 { 4261 rc = gmmR0RegisterChunk(pGMM, &pGVM->gmm.s.Private, MemObj, pGVM->hSelf, 0 /*fChunkFlags*/, NULL);4293 rc = gmmR0RegisterChunk(pGMM, &pGVM->gmm.s.Private, hMemObj, pGVM->hSelf, 0 /*fChunkFlags*/, NULL); 4262 4294 if (RT_SUCCESS(rc)) 4263 4295 gmmR0MutexRelease(pGMM); 4264 4296 else 4265 RTR0MemObjFree( MemObj, false /* fFreeMappings */);4297 RTR0MemObjFree(hMemObj, true /* fFreeMappings */); 4266 4298 } 4267 4299 … … 4269 4301 return rc; 4270 4302 } 4303 4304 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 4305 4306 /** 4307 * Gets the ring-0 virtual address for the given page. 4308 * 4309 * @returns VBox status code. 4310 * @param pGVM Pointer to the kernel-only VM instace data. 4311 * @param idPage The page ID. 4312 * @param ppv Where to store the address. 4313 * @thread EMT 4314 */ 4315 GMMR0DECL(int) GMMR0PageIdToVirt(PGVM pGVM, uint32_t idPage, void **ppv) 4316 { 4317 *ppv = NULL; 4318 PGMM pGMM; 4319 GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE); 4320 gmmR0MutexAcquire(pGMM); /** @todo shared access */ 4321 4322 int rc; 4323 PGMMCHUNK pChunk = gmmR0GetChunk(pGMM, idPage >> GMM_CHUNKID_SHIFT); 4324 if (pChunk) 4325 { 4326 const GMMPAGE *pPage = &pChunk->aPages[idPage & GMM_PAGEID_IDX_MASK]; 4327 if (RT_LIKELY( ( GMM_PAGE_IS_PRIVATE(pPage) 4328 && pPage->Private.hGVM == pGVM->hSelf) 4329 || GMM_PAGE_IS_SHARED(pPage))) 4330 { 4331 AssertPtr(pChunk->pbMapping); 4332 *ppv = &pChunk->pbMapping[(idPage & GMM_PAGEID_IDX_MASK) << PAGE_SHIFT]; 4333 rc = VINF_SUCCESS; 4334 } 4335 else 4336 rc = VERR_GMM_NOT_PAGE_OWNER; 4337 } 4338 else 4339 rc = VERR_GMM_PAGE_NOT_FOUND; 4340 4341 gmmR0MutexRelease(pGMM); 4342 return rc; 4343 } 4344 4345 #endif 4271 4346 4272 4347 #ifdef VBOX_WITH_PAGE_SHARING -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r82556 r82591 106 106 * be logged, written to the VMs assertion text buffer, and @a a_BadExpr is 107 107 * executed. */ 108 #if defined(VBOX_STRICT) || 1108 #if (defined(VBOX_STRICT) || 1) && !defined(VBOX_WITH_RAM_IN_KERNEL) 109 109 # define GVMM_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures() 110 110 # define GVMM_CHECK_SMAP_CHECK(a_BadExpr) \ -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r82555 r82591 375 375 PPGMREGMMIO2RANGE pFirstRegMmio = pgmR0PhysMMIOExFind(pGVM, pDevIns, hMmio2); 376 376 AssertReturn(pFirstRegMmio, VERR_NOT_FOUND); 377 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 378 uint8_t * const pvR0 = (uint8_t *)pFirstRegMmio->pvR0; 379 #else 377 380 RTR3PTR const pvR3 = pFirstRegMmio->pvR3; 381 #endif 378 382 RTGCPHYS const cbReal = pFirstRegMmio->cbReal; 379 383 pFirstRegMmio = NULL; … … 389 393 * Do the mapping. 390 394 */ 395 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 396 AssertPtr(pvR0); 397 *ppvMapping = pvR0 + offSub; 398 return VINF_SUCCESS; 399 #else 391 400 return SUPR0PageMapKernel(pGVM->pSession, pvR3, (uint32_t)offSub, (uint32_t)cbSub, 0 /*fFlags*/, ppvMapping); 401 #endif 392 402 } 393 403 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r82555 r82591 88 88 * be logged, written to the VMs assertion text buffer, and @a a_BadExpr is 89 89 * executed. */ 90 #if defined(VBOX_STRICT) || 190 #if (defined(VBOX_STRICT) || 1) && !defined(VBOX_WITH_RAM_IN_KERNEL) 91 91 # define VMM_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures() 92 92 # define VMM_CHECK_SMAP_CHECK(a_BadExpr) \ … … 437 437 } 438 438 #endif /* LOG_ENABLED */ 439 SUPR0Printf("VMMR0InitVM: eflags=%x fKernelFeatures=%#x (SUPKERNELFEATURES_SMAP=%d)\n", 440 ASMGetFlags(), fKernelFeatures, RT_BOOL(fKernelFeatures & SUPKERNELFEATURES_SMAP)); 439 441 440 442 /* -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r82316 r82591 2995 2995 AssertLogRelReturn(((RTGCPHYS)cPages << PAGE_SHIFT) == cb, VERR_INVALID_PARAMETER); 2996 2996 AssertLogRelReturn(cPages <= (MM_MMIO_64_MAX >> X86_PAGE_SHIFT), VERR_OUT_OF_RANGE); 2997 AssertLogRelReturn(cPages <= PGM_MMIO2_MAX_PAGE_COUNT, VERR_OUT_OF_RANGE); 2997 2998 2998 2999 /* … … 3035 3036 { 3036 3037 void *pvPages; 3038 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 3039 RTR0PTR pvPagesR0; 3040 rc = SUPR3PageAllocEx(cPages, 0 /*fFlags*/, &pvPages, &pvPagesR0, paPages); 3041 #else 3037 3042 rc = SUPR3PageAllocEx(cPages, 0 /*fFlags*/, &pvPages, NULL /*pR0Ptr*/, paPages); 3043 #endif 3038 3044 if (RT_SUCCESS(rc)) 3039 3045 { … … 3055 3061 { 3056 3062 pCur->pvR3 = pbCurPages; 3063 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 3064 pCur->pvR0 = pvPagesR0 + (iSrcPage << PAGE_SHIFT); 3065 #endif 3057 3066 pCur->RamRange.pvR3 = pbCurPages; 3058 3067 pCur->idMmio2 = idMmio2; … … 4630 4639 #endif 4631 4640 4641 #ifndef VBOX_WITH_RAM_IN_KERNEL 4632 4642 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbR0.aEntries); i++) 4633 4643 if (pVM->pgm.s.PhysTlbR0.aEntries[i].pMap == pChunk) 4634 4644 return 0; 4645 #endif 4635 4646 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbR3.aEntries); i++) 4636 4647 if (pVM->pgm.s.PhysTlbR3.aEntries[i].pMap == pChunk) -
trunk/src/VBox/VMM/include/PGMInline.h
r82092 r82591 505 505 #endif 506 506 AssertPtr(pTlbe->pv); 507 #if ndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0507 #if defined(IN_RING3) || (!defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) && !defined(VBOX_WITH_RAM_IN_KERNEL)) 508 508 Assert(!pTlbe->pMap || RT_VALID_PTR(pTlbe->pMap->pv)); 509 509 #endif -
trunk/src/VBox/VMM/include/PGMInternal.h
r82558 r82591 1479 1479 /** The owner of the range. (a device) */ 1480 1480 PPDMDEVINSR3 pDevInsR3; 1481 /** Pointer to the ring-3 mapping of the allocation , if MMIO2. */1481 /** Pointer to the ring-3 mapping of the allocation. */ 1482 1482 RTR3PTR pvR3; 1483 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 1484 /** Pointer to the ring-0 mapping of the allocation. */ 1485 RTR0PTR pvR0; 1486 #endif 1483 1487 /** Pointer to the next range - R3. */ 1484 1488 R3PTRTYPE(struct PGMREGMMIO2RANGE *) pNextR3; … … 1494 1498 uint8_t idMmio2; 1495 1499 /** Alignment padding for putting the ram range on a PGMPAGE alignment boundary. */ 1500 #if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM) 1501 uint8_t abAlignment[HC_ARCH_BITS == 32 ? 6 + 4 : 2]; 1502 #else 1496 1503 uint8_t abAlignment[HC_ARCH_BITS == 32 ? 6 + 8 : 2 + 8]; 1504 #endif 1497 1505 /** The real size. 1498 1506 * This may be larger than indicated by RamRange.cb if the range has been … … 1568 1576 1569 1577 1578 /** @name Ring-3 page mapping TLBs 1579 * @{ */ 1580 1570 1581 /** Pointer to an allocation chunk ring-3 mapping. */ 1571 1582 typedef struct PGMCHUNKR3MAP *PPGMCHUNKR3MAP; … … 1604 1615 #endif 1605 1616 /** The chunk map. */ 1606 #if def VBOX_WITH_2X_4GB_ADDR_SPACE1617 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE) || defined(VBOX_WITH_RAM_IN_KERNEL) 1607 1618 R3PTRTYPE(PPGMCHUNKR3MAP) volatile pChunk; 1608 1619 #else … … 1656 1667 RTGCPHYS volatile GCPhys; 1657 1668 /** The guest page. */ 1658 #if def VBOX_WITH_2X_4GB_ADDR_SPACE1669 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE) || defined(VBOX_WITH_RAM_IN_KERNEL) 1659 1670 R3PTRTYPE(PPGMPAGE) volatile pPage; 1660 1671 #else … … 1662 1673 #endif 1663 1674 /** Pointer to the page mapping tracking structure, PGMCHUNKR3MAP. */ 1664 #if def VBOX_WITH_2X_4GB_ADDR_SPACE1675 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE) || defined(VBOX_WITH_RAM_IN_KERNEL) 1665 1676 R3PTRTYPE(PPGMCHUNKR3MAP) volatile pMap; 1666 1677 #else … … 1668 1679 #endif 1669 1680 /** The address */ 1670 #if def VBOX_WITH_2X_4GB_ADDR_SPACE1681 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE) || defined(VBOX_WITH_RAM_IN_KERNEL) 1671 1682 R3PTRTYPE(void *) volatile pv; 1672 1683 #else … … 1704 1715 #define PGM_PAGER3MAPTLB_IDX(GCPhys) ( ((GCPhys) >> PAGE_SHIFT) & (PGM_PAGER3MAPTLB_ENTRIES - 1) ) 1705 1716 1717 /** @} */ 1718 1719 #if defined(VBOX_WITH_RAM_IN_KERNEL) || defined(DOXYGEN_RUNNING) 1720 /** @name Ring-0 page mapping TLB 1721 * @{ */ 1722 /** 1723 * Ring-0 guest page mapping TLB entry. 1724 */ 1725 typedef struct PGMPAGER0MAPTLBE 1726 { 1727 /** Address of the page. */ 1728 RTGCPHYS volatile GCPhys; 1729 /** The guest page. */ 1730 R0PTRTYPE(PPGMPAGE) volatile pPage; 1731 /** The address */ 1732 R0PTRTYPE(void *) volatile pv; 1733 } PGMPAGER0MAPTLBE; 1734 /** Pointer to an entry in the HC physical TLB. */ 1735 typedef PGMPAGER0MAPTLBE *PPGMPAGER0MAPTLBE; 1736 1737 1738 /** The number of entries in the ring-3 guest page mapping TLB. 1739 * @remarks The value must be a power of two. */ 1740 #define PGM_PAGER0MAPTLB_ENTRIES 256 1741 1742 /** 1743 * Ring-3 guest page mapping TLB. 1744 * @remarks used in ring-0 as well at the moment. 1745 */ 1746 typedef struct PGMPAGER0MAPTLB 1747 { 1748 /** The TLB entries. */ 1749 PGMPAGER0MAPTLBE aEntries[PGM_PAGER0MAPTLB_ENTRIES]; 1750 } PGMPAGER0MAPTLB; 1751 /** Pointer to the ring-3 guest page mapping TLB. */ 1752 typedef PGMPAGER0MAPTLB *PPGMPAGER0MAPTLB; 1753 1754 /** 1755 * Calculates the index of the TLB entry for the specified guest page. 1756 * @returns Physical TLB index. 1757 * @param GCPhys The guest physical address. 1758 */ 1759 #define PGM_PAGER0MAPTLB_IDX(GCPhys) ( ((GCPhys) >> PAGE_SHIFT) & (PGM_PAGER0MAPTLB_ENTRIES - 1) ) 1760 /** @} */ 1761 #endif /* VBOX_WITH_RAM_IN_KERNEL || DOXYGEN_RUNNING */ 1706 1762 1707 1763 /** … … 1867 1923 /** @typedef PPPGMPAGEMAP 1868 1924 * Pointer to a page mapper unit pointer for current context. */ 1869 #if defined(IN_RING0) && 01870 // typedef PPGMPAGER0MAPTLBPPGMPAGEMAPTLB;1871 // typedef PPGMPAGER0MAPTLBEPPGMPAGEMAPTLBE;1872 // typedef PPGMPAGER0MAPTLBE*PPPGMPAGEMAPTLBE;1873 //# define PGM_PAGEMAPTLB_ENTRIES PGM_PAGER0MAPTLB_ENTRIES1874 //# define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGER0MAPTLB_IDX(GCPhys)1875 // typedef PPGMCHUNKR0MAPPPGMPAGEMAP;1876 // typedef PPPGMCHUNKR0MAPPPPGMPAGEMAP;1925 #if defined(IN_RING0) && defined(VBOX_WITH_RAM_IN_KERNEL) 1926 typedef PPGMPAGER0MAPTLB PPGMPAGEMAPTLB; 1927 typedef PPGMPAGER0MAPTLBE PPGMPAGEMAPTLBE; 1928 typedef PPGMPAGER0MAPTLBE *PPPGMPAGEMAPTLBE; 1929 # define PGM_PAGEMAPTLB_ENTRIES PGM_PAGER0MAPTLB_ENTRIES 1930 # define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGER0MAPTLB_IDX(GCPhys) 1931 typedef struct PGMCHUNKR0MAP *PPGMPAGEMAP; 1932 typedef struct PGMCHUNKR0MAP **PPPGMPAGEMAP; 1877 1933 #else 1878 typedef PPGMPAGER3MAPTLBPPGMPAGEMAPTLB;1879 typedef PPGMPAGER3MAPTLBEPPGMPAGEMAPTLBE;1880 typedef PPGMPAGER3MAPTLBE*PPPGMPAGEMAPTLBE;1934 typedef PPGMPAGER3MAPTLB PPGMPAGEMAPTLB; 1935 typedef PPGMPAGER3MAPTLBE PPGMPAGEMAPTLBE; 1936 typedef PPGMPAGER3MAPTLBE *PPPGMPAGEMAPTLBE; 1881 1937 # define PGM_PAGEMAPTLB_ENTRIES PGM_PAGER3MAPTLB_ENTRIES 1882 1938 # define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGER3MAPTLB_IDX(GCPhys) 1883 typedef PPGMCHUNKR3MAPPPGMPAGEMAP;1884 typedef PPPGMCHUNKR3MAPPPPGMPAGEMAP;1939 typedef PPGMCHUNKR3MAP PPGMPAGEMAP; 1940 typedef PPPGMCHUNKR3MAP PPPGMPAGEMAP; 1885 1941 #endif 1886 1942 /** @} */ … … 3229 3285 PGMCHUNKR3MAPTLB Tlb; 3230 3286 /** The chunk tree, ordered by chunk id. */ 3231 #if def VBOX_WITH_2X_4GB_ADDR_SPACE3287 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE) || defined(VBOX_WITH_RAM_IN_KERNEL) 3232 3288 R3PTRTYPE(PAVLU32NODECORE) pTree; 3233 3289 #else … … 3251 3307 /** The page mapping TLB for ring-3. */ 3252 3308 PGMPAGER3MAPTLB PhysTlbR3; 3309 #ifdef VBOX_WITH_RAM_IN_KERNEL 3310 /** The page mapping TLB for ring-0. */ 3311 PGMPAGER0MAPTLB PhysTlbR0; 3312 #else 3253 3313 /** The page mapping TLB for ring-0 (still using ring-3 mappings). */ 3254 3314 PGMPAGER3MAPTLB PhysTlbR0; 3315 #endif 3255 3316 3256 3317 /** @name The zero page.
Note:
See TracChangeset
for help on using the changeset viewer.