VirtualBox

Changeset 70372 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 28, 2017 10:19:33 AM (7 years ago)
Author:
vboxsync
Message:

PGM: Fixes for 256 MB VRAM in raw-mode. bugref:9084

  • PGMR3MapPT: Adjusted size restrictions on what pgmR3PhysMMIOExCreate does.
  • pgmR3PhysMMIOExCreate: Fixed wrong loop bound when initializing floating ram range (raw mode only).
  • pgmR3PhysMMIOExCreate: Fixed wrong GC mapping address calculation for floading ram range (raw mode only).
  • pgmR3PhysMMIOExCreate: Addressed review comment regarding detection of non-final chunks.
Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

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

    r69111 r70372  
    6767    /*
    6868     * Validate input.
     69     * Note! The lower limit (1 MB) matches how pgmR3PhysMMIOExCreate works.
    6970     */
    7071    Assert(!fFlags || fFlags == PGMR3MAPPT_FLAGS_UNMAPPABLE);
    71     if (cb < _2M || cb > 64 * _1M)
    72     {
    73         AssertMsgFailed(("Serious? cb=%d\n", cb));
    74         return VERR_INVALID_PARAMETER;
    75     }
     72    AssertMsgReturn(cb >= _1M && cb <= _64M, ("Seriously? cb=%d (%#x)\n", cb, cb), VERR_OUT_OF_RANGE);
     73
    7674    cb = RT_ALIGN_32(cb, _4M);
    7775    RTGCPTR GCPtrLast = GCPtr + cb - 1;
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r69111 r70372  
    25972597        const size_t     cbRange = RT_OFFSETOF(PGMREGMMIORANGE, RamRange.aPages[cPagesTrackedByChunk]);
    25982598        PPGMREGMMIORANGE pNew    = NULL;
    2599         if (   cPagesTrackedByChunk > cPagesLeft /**< @todo r=klaus the first part of the condition is guaranteed false due to RT_MIN above */
     2599        if (   iChunk + 1 < cChunks
    26002600            || cbRange >= _1M)
    26012601        {
     
    26432643            else
    26442644            {
    2645                 RTGCPTR         GCPtrChunkMap = pVM->pgm.s.GCPtrPrevRamRangeMapping - cbChunk;
     2645                RTGCPTR         GCPtrChunkMap = pVM->pgm.s.GCPtrPrevRamRangeMapping - RT_ALIGN_Z(cbChunk, _4M);
    26462646                RTGCPTR const   GCPtrChunk    = GCPtrChunkMap + PAGE_SIZE;
    26472647                rc = PGMR3MapPT(pVM, GCPtrChunkMap, (uint32_t)cbChunk, 0 /*fFlags*/, pgmR3PhysMMIOExRangeRelocate, pNew, pszDesc);
     
    26512651
    26522652                    RTGCPTR GCPtrPage  = GCPtrChunk;
    2653                     for (uint32_t iPage = 0; iPage < cPagesTrackedByChunk && RT_SUCCESS(rc); iPage++, GCPtrPage += PAGE_SIZE)
     2653                    for (uint32_t iPage = 0; iPage < cChunkPages && RT_SUCCESS(rc); iPage++, GCPtrPage += PAGE_SIZE)
    26542654                        rc = PGMMap(pVM, GCPtrPage, paChunkPages[iPage].Phys, PAGE_SIZE, 0);
    26552655                }
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