Changeset 107194 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Nov 29, 2024 2:47:06 PM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 166196
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r107179 r107194 2065 2065 } 2066 2066 2067 #ifndef VBOX_WITH_ONLY_PGM_NEM_MODE 2067 2068 2068 2069 /** … … 2087 2088 * Do we need to do anything special? 2088 2089 */ 2089 # ifdef IN_RING32090 # ifdef IN_RING3 2090 2091 if (pVM->pgm.s.cHandyPages <= RT_MAX(PGM_HANDY_PAGES_SET_FF, PGM_HANDY_PAGES_R3_ALLOC)) 2091 # else2092 # else 2092 2093 if (pVM->pgm.s.cHandyPages <= RT_MAX(PGM_HANDY_PAGES_SET_FF, PGM_HANDY_PAGES_RZ_TO_R3)) 2093 # endif2094 # endif 2094 2095 { 2095 2096 /* 2096 2097 * Allocate pages only if we're out of them, or in ring-3, almost out. 2097 2098 */ 2098 # ifdef IN_RING32099 # ifdef IN_RING3 2099 2100 if (pVM->pgm.s.cHandyPages <= PGM_HANDY_PAGES_R3_ALLOC) 2100 # else2101 # else 2101 2102 if (pVM->pgm.s.cHandyPages <= PGM_HANDY_PAGES_RZ_ALLOC) 2102 # endif2103 # endif 2103 2104 { 2104 2105 Log(("PGM: cHandyPages=%u out of %u -> allocate more; VM_FF_PGM_NO_MEMORY=%RTbool\n", 2105 2106 pVM->pgm.s.cHandyPages, RT_ELEMENTS(pVM->pgm.s.aHandyPages), VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY) )); 2106 # ifdef IN_RING32107 # ifdef IN_RING3 2107 2108 int rc = PGMR3PhysAllocateHandyPages(pVM); 2108 # else2109 # else 2109 2110 int rc = pgmR0PhysAllocateHandyPages(pVM, VMMGetCpuId(pVM), false /*fRing3*/); 2110 # endif2111 # endif 2111 2112 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 2112 2113 { … … 2121 2122 Assert(VM_FF_IS_SET(pVM, VM_FF_PGM_NEED_HANDY_PAGES)); 2122 2123 Assert(VM_FF_IS_SET(pVM, VM_FF_PGM_NO_MEMORY)); 2123 # ifndef IN_RING32124 # ifndef IN_RING3 2124 2125 VMCPU_FF_SET(VMMGetCpu(pVM), VMCPU_FF_TO_R3); /* paranoia */ 2125 # endif2126 # endif 2126 2127 } 2127 2128 AssertMsgReturn( pVM->pgm.s.cHandyPages > 0 … … 2134 2135 if (pVM->pgm.s.cHandyPages <= PGM_HANDY_PAGES_SET_FF) 2135 2136 VM_FF_SET(pVM, VM_FF_PGM_NEED_HANDY_PAGES); 2136 # ifndef IN_RING32137 # ifndef IN_RING3 2137 2138 if (pVM->pgm.s.cHandyPages <= PGM_HANDY_PAGES_RZ_TO_R3) 2138 2139 { … … 2140 2141 VMCPU_FF_SET(VMMGetCpu(pVM), VMCPU_FF_TO_R3); 2141 2142 } 2142 # endif2143 # endif 2143 2144 } 2144 2145 } … … 2331 2332 } 2332 2333 2333 # ifdef PGM_WITH_LARGE_PAGES2334 # ifdef PGM_WITH_LARGE_PAGES 2334 2335 2335 2336 /** … … 2408 2409 * Do the allocation. 2409 2410 */ 2410 # ifdef IN_RING32411 # ifdef IN_RING3 2411 2412 rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_LARGE_PAGE, GCPhysBase, NULL); 2412 # elif defined(IN_RING0)2413 # elif defined(IN_RING0) 2413 2414 rc = pgmR0PhysAllocateLargePage(pVM, VMMGetCpuId(pVM), GCPhysBase); 2414 # else2415 # error "Port me"2416 # endif2415 # else 2416 # error "Port me" 2417 # endif 2417 2418 if (RT_SUCCESS(rc)) 2418 2419 { … … 2496 2497 } 2497 2498 2498 #endif /* PGM_WITH_LARGE_PAGES */ 2499 # endif /* PGM_WITH_LARGE_PAGES */ 2500 #endif /* !VBOX_WITH_ONLY_PGM_NEM_MODE */ 2501 2499 2502 2500 2503 … … 2585 2588 RT_FALL_THRU(); 2586 2589 case PGM_PAGE_STATE_SHARED: 2590 #ifndef VBOX_WITH_ONLY_PGM_NEM_MODE 2587 2591 return pgmPhysAllocPage(pVM, pPage, GCPhys); 2592 #else 2593 AssertFailed(); /** @todo not sure if we make use of ZERO pages or not in NEM-mode, but I can't see how pgmPhysAllocPage would work. */ 2594 return VERR_PGM_NOT_SUPPORTED_FOR_NEM_MODE; 2595 #endif 2588 2596 2589 2597 /* Not allowed to write to ballooned pages. */ … … 2593 2601 } 2594 2602 2595 2603 #if 0 /* unused */ 2596 2604 /** 2597 2605 * Internal usage: Map the page specified by its GMM ID. … … 2665 2673 #endif 2666 2674 } 2667 2675 #endif /* unused */ 2668 2676 2669 2677 /** … … 3078 3086 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* not returned */, ("%Rrc\n", rc)); 3079 3087 } 3080 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 );3088 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 || PGM_IS_IN_NEM_MODE(pVM)); 3081 3089 3082 3090 /* … … 3213 3221 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* not returned */, ("%Rrc\n", rc)); 3214 3222 } 3215 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 );3223 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 || PGM_IS_IN_NEM_MODE(pVM)); 3216 3224 3217 3225 /* … … 3250 3258 AssertReturn(pPage, VERR_PGM_PHYS_NULL_PAGE_PARAM); 3251 3259 PGM_LOCK_ASSERT_OWNER(pVM); 3252 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 );3260 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 || PGM_IS_IN_NEM_MODE(pVM)); 3253 3261 3254 3262 /* … … 3736 3744 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* not returned */, ("%Rrc\n", rc)); 3737 3745 } 3738 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 );3746 Assert(PGM_PAGE_GET_HCPHYS(pPage) != 0 || PGM_IS_IN_NEM_MODE(pVM)); 3739 3747 3740 3748 /*
Note:
See TracChangeset
for help on using the changeset viewer.