VirtualBox

Changeset 17503 in vbox


Ignore:
Timestamp:
Mar 6, 2009 9:13:13 PM (16 years ago)
Author:
vboxsync
Message:

PGM: PGMR3PhysAllocateHandyPages fix and error handling.

File:
1 edited

Legend:

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

    r17438 r17503  
    24722472    pgmLock(pVM);
    24732473
    2474 
    24752474    /*
    24762475     * Allocate more pages, noting down the index of the first new page.
     
    24782477    uint32_t iClear = pVM->pgm.s.cHandyPages;
    24792478    AssertMsgReturn(iClear <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), ("%d", iClear), VERR_INTERNAL_ERROR);
     2479    Log(("PGMR3PhysAllocateHandyPages: %d -> %d\n", iClear, RT_ELEMENTS(pVM->pgm.s.aHandyPages)));
    24802480    int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, 0, NULL);
    24812481    if (rc == VERR_GMM_SEED_ME)
     
    24852485        if (RT_SUCCESS(rc))
    24862486            rc = VMMR3CallR0(pVM, VMMR0_DO_GMM_SEED_CHUNK, (uintptr_t)pvChunk, NULL);
    2487         if (RT_FAILURE(rc))
    2488         {
    2489             LogRel(("PGM: GMM Seeding failed, rc=%Rrc\n", rc));
    2490             rc = VINF_EM_NO_MEMORY;
    2491         }
     2487        if (RT_SUCCESS(rc))
     2488            rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, 0, NULL);
    24922489    }
    24932490
     
    25062503            iClear++;
    25072504        }
     2505
     2506        VM_FF_CLEAR(pVM, VM_FF_PGM_NEED_HANDY_PAGES);
     2507    }
     2508    else
     2509    {
     2510        LogRel(("PGM: Failed to procure handy pages, rc=%Rrc cHandyPages=%u\n",
     2511                rc, pVM->pgm.s.cHandyPages));
     2512        rc = VERR_EM_NO_MEMORY;
     2513        //rc = VINF_EM_NO_MEMORY;
     2514        //VM_FF_SET(pVM, VM_FF_PGM_WE_ARE_SCREWED?);
    25082515    }
    25092516
    25102517/** @todo Do proper VERR_EM_NO_MEMORY reporting. */
     2518    AssertMsg(   pVM->pgm.s.cHandyPages == RT_ELEMENTS(pVM->pgm.s.aHandyPages)
     2519              || rc != VINF_SUCCESS, ("%d rc=%Rrc\n", pVM->pgm.s.cHandyPages, rc));
    25112520    pgmUnlock(pVM);
    2512     Assert(rc == VINF_SUCCESS || rc == VINF_EM_NO_MEMORY);
     2521    Assert(rc == VINF_SUCCESS || rc == VINF_EM_NO_MEMORY || rc == VERR_EM_NO_MEMORY);
    25132522    return rc;
    25142523}
     
    26362645            if (PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage)) /* catches MMIO */
    26372646                rc = VERR_PGM_PHYS_TLB_CATCH_ALL;
    2638             else if (fWritable && PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage))
    2639                 rc = VINF_PGM_PHYS_TLB_CATCH_WRITE;
     2647            else if (PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage))
     2648            {
     2649                /** @todo Handle TLB loads of virtual handlers so ./test.sh can be made to work
     2650                 *        in -norawr0 mode. */
     2651                if (fWritable)
     2652                    rc = VINF_PGM_PHYS_TLB_CATCH_WRITE;
     2653            }
    26402654            else
    26412655            {
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