VirtualBox

Changeset 92424 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Nov 15, 2021 1:09:17 PM (3 years ago)
Author:
vboxsync
Message:

VMM/PGM: Adjusted the ram range sizes again so they better align with 2MiB large pages. bugref:10122

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r92391 r92424  
    17931793         * the PGMRAMRANGE structure.
    17941794         *
     1795         * See also pgmR3PhysMmio2CalcChunkCount.
     1796         *
    17951797         * Note! The sizes used here will influence the saved state.
    17961798         */
    17971799        uint32_t cbChunk = 16U*_1M;
    1798         uint32_t cPagesPerChunk = 1048048; /* max ~1048059 */
    1799         AssertCompile(sizeof(PGMRAMRANGE) + sizeof(PGMPAGE) * 1048048 < 16U*_1M - PAGE_SIZE * 2);
     1800        uint32_t cPagesPerChunk = 1047552; /* max ~1048059 */
     1801        Assert(cPagesPerChunk / 512 * 512 == cPagesPerChunk); /* NEM large page requirement */
     1802        AssertCompile(sizeof(PGMRAMRANGE) + sizeof(PGMPAGE) * 1047552 < 16U*_1M - PAGE_SIZE * 2);
    18001803        AssertRelease(RT_UOFFSETOF_DYN(PGMRAMRANGE, aPages[cPagesPerChunk]) + PAGE_SIZE * 2 <= cbChunk);
    18011804
     
    27102713     * P.S. If we want to include a dirty bitmap, we'd have to drop down to 1040384 pages.
    27112714     */
    2712     uint32_t cbChunk = 16U*_1M;
    2713     uint32_t cPagesPerChunk = 1048000; /* max ~1048059 */
    2714     Assert(cPagesPerChunk / 64 * 64 == cPagesPerChunk); /* (NEM requirement) */
    2715     AssertCompile(sizeof(PGMREGMMIO2RANGE) + sizeof(PGMPAGE) * 1048000 < 16U*_1M - PAGE_SIZE * 2);
     2715    uint32_t cbChunk = _16M;
     2716    uint32_t cPagesPerChunk = 1047552; /* max ~1048059 */
     2717    Assert(cPagesPerChunk / 64 * 64   == cPagesPerChunk); /* (NEM requirement) */
     2718    Assert(cPagesPerChunk / 512 * 512 == cPagesPerChunk); /* (NEM large page requirement) */
     2719    AssertCompile(sizeof(PGMREGMMIO2RANGE) + sizeof(PGMPAGE) * 1047552 < _16M - PAGE_SIZE * 2);
    27162720    AssertRelease(cPagesPerChunk <= PGM_MMIO2_MAX_PAGE_COUNT); /* See above note. */
    27172721    AssertRelease(RT_UOFFSETOF_DYN(PGMREGMMIO2RANGE, RamRange.aPages[cPagesPerChunk]) + PAGE_SIZE * 2 <= cbChunk);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette