VirtualBox

Ignore:
Timestamp:
Feb 6, 2022 8:35:16 AM (3 years ago)
Author:
vboxsync
Message:

VMM/PGMPool: Replaced MMR3HyperAllocOnceNoRel call with direct SUPR3PageAllocEx call, replacing a few associated MMHyperCCToR3/R0 calls with speedier pgmPoolConvertPageToR3/R0 ones. bugref:10093

File:
1 edited

Legend:

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

    r93554 r93617  
    233233    cb += cMaxPhysExts * sizeof(PGMPOOLPHYSEXT);
    234234    PPGMPOOL pPool;
    235     rc = MMR3HyperAllocOnceNoRel(pVM, cb, 0, MM_TAG_PGM_POOL, (void **)&pPool);
     235    RTR0PTR  pPoolR0;
     236    rc = SUPR3PageAllocEx(RT_ALIGN_32(cb, HOST_PAGE_SIZE) >> HOST_PAGE_SHIFT, 0 /*fFlags*/, (void **)&pPool, &pPoolR0, NULL);
    236237    if (RT_FAILURE(rc))
    237238        return rc;
    238     pVM->pgm.s.pPoolR3 = pPool;
    239     pVM->pgm.s.pPoolR0 = MMHyperR3ToR0(pVM, pPool);
     239    Assert(ASMMemIsZero(pPool, cb));
     240    pVM->pgm.s.pPoolR3 = pPool->pPoolR3 = pPool;
     241    pVM->pgm.s.pPoolR0 = pPool->pPoolR0 = pPoolR0;
    240242
    241243    /*
     
    250252    PPGMPOOLUSER paUsers = (PPGMPOOLUSER)&pPool->aPages[pPool->cMaxPages];
    251253    pPool->paUsersR3 = paUsers;
    252     pPool->paUsersR0 = MMHyperR3ToR0(pVM, paUsers);
     254    pPool->paUsersR0 = pPoolR0 + (uintptr_t)paUsers - (uintptr_t)pPool;
    253255    for (unsigned i = 0; i < cMaxUsers; i++)
    254256    {
     
    262264    PPGMPOOLPHYSEXT paPhysExts = (PPGMPOOLPHYSEXT)&paUsers[cMaxUsers];
    263265    pPool->paPhysExtsR3 = paPhysExts;
    264     pPool->paPhysExtsR0 = MMHyperR3ToR0(pVM, paPhysExts);
     266    pPool->paPhysExtsR0 = pPoolR0 + (uintptr_t)paPhysExts - (uintptr_t)pPool;
    265267    for (unsigned i = 0; i < cMaxPhysExts; i++)
    266268    {
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