Changeset 104796 in vbox
- Timestamp:
- May 27, 2024 11:22:11 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r98103 r104796 2233 2233 * Perform the hypercall. 2234 2234 */ 2235 /** @todo r=bird: This is *nothing* like the microsoft description (2024-05-28). 2236 * https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/hypercalls/hvextcallgetbootzeroedmemory 2237 * 2238 * It describes this as returning pages known to be all zeros at the time this 2239 * hypercall is made. What we return instead is a is a single entry: 2240 * GIMHVEXTGETBOOTZEROMEM::GCPhysStart = 0; 2241 * GIMHVEXTGETBOOTZEROMEM::cPages = SUM(PGMRAMRANGE.cb) >> GIM_HV_PAGE_SHIFT; 2242 * 2243 * This isn't right for any VM configuration, given that VGA & MMIO & ROM memory 2244 * starts at 0xa0000 and contains pages that aren't zero. For VM configurations 2245 * with more than 3GB (or 2) of memory, it doesn't take into account the RAM hole 2246 * below 4G. 2247 * 2248 * A much better approach for VMs with large configs, but still not really correct, 2249 * would be to find the highest RAM address (non-MMIO, non-MMIO2, non-ROM) and 2250 * convert it to a page count and assign that to cPages. 2251 * 2252 * A slight improvement would be to report two or three ranges: 2253 * [0] = 0x00000-0xa0000, 2254 * [1] = 1MB - RamHole, 2255 * [2] = 4GB - EndOfRam; 2256 * 2257 * The best would be to implement this directly PGM, as the number of mapped RAM 2258 * ranges doesn't need to be constant during the call if other VCPUs are 2259 * enabling/disabling devices and such. 2260 */ 2235 2261 uint32_t const cRanges = PGMR3PhysGetRamRangeCount(pVM); 2236 2262 pOut->cPages = 0;
Note:
See TracChangeset
for help on using the changeset viewer.