VirtualBox

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


Ignore:
Timestamp:
Jul 28, 2010 3:20:02 PM (14 years ago)
Author:
vboxsync
Message:

PGM: More inline cleanup (prep for tracking dynamic mappings in raw-mode).

Location:
trunk/src/VBox/VMM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInline.h

    r31167 r31170  
    293293 *
    294294 * @returns VINF_SUCCESS. Will bail out to ring-3 on failure.
    295  * @param   pPGM        Pointer to the PVM instance data.
     295 * @param   pVCpu       The current CPU.
    296296 * @param   HCPhys      The physical address of the page.
    297297 * @param   ppv         Where to store the mapping address.
    298298 */
    299 DECLINLINE(int) pgmR0DynMapHCPageInlined(PPGM pPGM, RTHCPHYS HCPhys, void **ppv)
    300 {
    301     PVM         pVM     = PGM2VM(pPGM);
    302     PPGMCPU     pPGMCPU = (PPGMCPU)((uint8_t *)VMMGetCpu(pVM) + pPGM->offVCpuPGM); /* very pretty ;-) */
    303     PPGMMAPSET  pSet    = &pPGMCPU->AutoSet;
    304 
    305     STAM_PROFILE_START(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapHCPageInl, a);
     299DECLINLINE(int) pgmR0DynMapHCPageInlined(PVMCPU pVCpu, RTHCPHYS HCPhys, void **ppv)
     300{
     301    PPGMMAPSET  pSet    = &pVCpu->pgm.s.AutoSet;
     302
     303    STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapHCPageInl, a);
    306304    Assert(!(HCPhys & PAGE_OFFSET_MASK));
    307305    Assert(pSet->cEntries <= RT_ELEMENTS(pSet->aEntries));
     
    313311    {
    314312        *ppv = pSet->aEntries[iEntry].pvPage;
    315         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapHCPageInlHits);
     313        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapHCPageInlHits);
    316314    }
    317315    else
    318316    {
    319         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapHCPageInlMisses);
    320         pgmR0DynMapHCPageCommon(pVM, pSet, HCPhys, ppv);
    321     }
    322 
    323     STAM_PROFILE_STOP(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapHCPageInl, a);
     317        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapHCPageInlMisses);
     318        pgmR0DynMapHCPageCommon(pSet, HCPhys, ppv);
     319    }
     320
     321    STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapHCPageInl, a);
    324322    return VINF_SUCCESS;
    325323}
     
    331329 *
    332330 * @returns See PGMDynMapGCPage.
    333  * @param   pPGM        Pointer to the PVM instance data.
     331 * @param   pVCpu       The current CPU.
    334332 * @param   GCPhys      The guest physical address of the page.
    335333 * @param   ppv         Where to store the mapping address.
    336334 */
    337 DECLINLINE(int) pgmR0DynMapGCPageInlined(PPGM pPGM, RTGCPHYS GCPhys, void **ppv)
    338 {
    339     PVM     pVM     = PGM2VM(pPGM);
    340     PPGMCPU pPGMCPU = (PPGMCPU)((uint8_t *)VMMGetCpu(pVM) + pPGM->offVCpuPGM); /* very pretty ;-) */
    341 
    342     STAM_PROFILE_START(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
     335DECLINLINE(int) pgmR0DynMapGCPageInlined(PVMCPU pVCpu, RTGCPHYS GCPhys, void **ppv)
     336{
     337    STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
    343338    AssertMsg(!(GCPhys & PAGE_OFFSET_MASK), ("%RGp\n", GCPhys));
    344339
     
    346341     * Get the ram range.
    347342     */
    348     PPGMRAMRANGE    pRam = pPGM->CTX_SUFF(pRamRanges);
    349     RTGCPHYS        off = GCPhys - pRam->GCPhys;
     343    PVM             pVM  = pVCpu->CTX_SUFF(pVM);
     344    PPGMRAMRANGE    pRam = pVM->pgm.s.CTX_SUFF(pRamRanges);
     345    RTGCPHYS        off  = GCPhys - pRam->GCPhys;
    350346    if (RT_UNLIKELY(off >= pRam->cb
    351347        /** @todo   || page state stuff */))
    352348    {
    353349        /* This case is not counted into StatR0DynMapGCPageInl. */
    354         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamMisses);
     350        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamMisses);
    355351        return PGMDynMapGCPage(pVM, GCPhys, ppv);
    356352    }
    357353
    358354    RTHCPHYS HCPhys = PGM_PAGE_GET_HCPHYS(&pRam->aPages[off >> PAGE_SHIFT]);
    359     STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamHits);
     355    STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamHits);
    360356
    361357    /*
    362358     * pgmR0DynMapHCPageInlined with out stats.
    363359     */
    364     PPGMMAPSET pSet = &pPGMCPU->AutoSet;
     360    PPGMMAPSET pSet = &pVCpu->pgm.s.AutoSet;
    365361    Assert(!(HCPhys & PAGE_OFFSET_MASK));
    366362    Assert(pSet->cEntries <= RT_ELEMENTS(pSet->aEntries));
     
    372368    {
    373369        *ppv = pSet->aEntries[iEntry].pvPage;
    374         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlHits);
     370        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlHits);
    375371    }
    376372    else
    377373    {
    378         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlMisses);
    379         pgmR0DynMapHCPageCommon(pVM, pSet, HCPhys, ppv);
    380     }
    381 
    382     STAM_PROFILE_STOP(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
     374        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlMisses);
     375        pgmR0DynMapHCPageCommon(pSet, HCPhys, ppv);
     376    }
     377
     378    STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
    383379    return VINF_SUCCESS;
    384380}
     
    390386 *
    391387 * @returns See PGMDynMapGCPage.
    392  * @param   pPGM        Pointer to the PVM instance data.
     388 * @param   pVCpu       The current CPU.
    393389 * @param   HCPhys      The physical address of the page.
    394390 * @param   ppv         Where to store the mapping address.
    395391 */
    396 DECLINLINE(int) pgmR0DynMapGCPageOffInlined(PPGM pPGM, RTGCPHYS GCPhys, void **ppv)
    397 {
    398     PVM     pVM     = PGM2VM(pPGM);
    399     PPGMCPU pPGMCPU = (PPGMCPU)((uint8_t *)VMMGetCpu(pVM) + pPGM->offVCpuPGM); /* very pretty ;-) */
    400 
    401     STAM_PROFILE_START(&pPGMCPU->StatR0DynMapGCPageInl, a);
     392DECLINLINE(int) pgmR0DynMapGCPageOffInlined(PVMCPU pVCpu, RTGCPHYS GCPhys, void **ppv)
     393{
     394    STAM_PROFILE_START(&pVCpu->pgm.s.StatR0DynMapGCPageInl, a);
    402395
    403396    /*
    404397     * Get the ram range.
    405398     */
    406     PPGMRAMRANGE    pRam = pPGM->CTX_SUFF(pRamRanges);
    407     RTGCPHYS        off = GCPhys - pRam->GCPhys;
     399    PVM             pVM  = pVCpu->CTX_SUFF(pVM);
     400    PPGMRAMRANGE    pRam = pVM->pgm.s.CTX_SUFF(pRamRanges);
     401    RTGCPHYS        off  = GCPhys - pRam->GCPhys;
    408402    if (RT_UNLIKELY(off >= pRam->cb
    409403        /** @todo   || page state stuff */))
    410404    {
    411405        /* This case is not counted into StatR0DynMapGCPageInl. */
    412         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamMisses);
     406        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamMisses);
    413407        return PGMDynMapGCPageOff(pVM, GCPhys, ppv);
    414408    }
    415409
    416410    RTHCPHYS HCPhys = PGM_PAGE_GET_HCPHYS(&pRam->aPages[off >> PAGE_SHIFT]);
    417     STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamHits);
     411    STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlRamHits);
    418412
    419413    /*
    420414     * pgmR0DynMapHCPageInlined with out stats.
    421415     */
    422     PPGMMAPSET pSet = &pPGMCPU->AutoSet;
     416    PPGMMAPSET pSet = &pVCpu->pgm.s.AutoSet;
    423417    Assert(!(HCPhys & PAGE_OFFSET_MASK));
    424418    Assert(pSet->cEntries <= RT_ELEMENTS(pSet->aEntries));
     
    430424    {
    431425        *ppv = (void *)((uintptr_t)pSet->aEntries[iEntry].pvPage | (PAGE_OFFSET_MASK & (uintptr_t)GCPhys));
    432         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlHits);
     426        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlHits);
    433427    }
    434428    else
    435429    {
    436         STAM_COUNTER_INC(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInlMisses);
    437         pgmR0DynMapHCPageCommon(pVM, pSet, HCPhys, ppv);
     430        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInlMisses);
     431        pgmR0DynMapHCPageCommon(pSet, HCPhys, ppv);
    438432        *ppv = (void *)((uintptr_t)*ppv | (PAGE_OFFSET_MASK & (uintptr_t)GCPhys));
    439433    }
    440434
    441     STAM_PROFILE_STOP(&pPGMCPU->CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
     435    STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapGCPageInl, a);
    442436    return VINF_SUCCESS;
    443437}
     
    453447 * @param   pPage       The page.
    454448 */
    455 DECLINLINE(void *) pgmPoolMapPageInlined(PPGM pPGM, PPGMPOOLPAGE pPage)
     449DECLINLINE(void *) pgmPoolMapPageInlined(PVM pVM, PPGMPOOLPAGE pPage)
    456450{
    457451    if (pPage->idx >= PGMPOOL_IDX_FIRST)
    458452    {
    459         Assert(pPage->idx < pPGM->CTX_SUFF(pPool)->cCurPages);
     453        Assert(pPage->idx < pVM->pgm.s.CTX_SUFF(pPool)->cCurPages);
    460454        void *pv;
    461455# ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    462         pgmR0DynMapHCPageInlined(pPGM, pPage->Core.Key, &pv);
     456        pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), pPage->Core.Key, &pv);
    463457# else
    464         PGMDynMapHCPage(PGM2VM(pPGM), pPage->Core.Key, &pv);
     458        PGMDynMapHCPage(pVM, pPage->Core.Key, &pv);
    465459# endif
    466460        return pv;
     
    477471 *
    478472 * @returns The address corresponding to HCPhys.
    479  * @param   pPGM        Pointer to the PVM instance data.
     473 * @param   pVM         The VM handle.
    480474 * @param   HCPhys      HC Physical address of the page.
    481475 */
    482 DECLINLINE(void *) pgmDynMapHCPageOff(PPGM pPGM, RTHCPHYS HCPhys)
     476DECLINLINE(void *) pgmDynMapHCPageOff(PVM pVM, RTHCPHYS HCPhys)
    483477{
    484478    void *pv;
    485479# ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    486     pgmR0DynMapHCPageInlined(pPGM, HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, &pv);
     480    pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, &pv);
    487481# else
    488     PGMDynMapHCPage(PGM2VM(pPGM), HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, &pv);
     482    PGMDynMapHCPage(pVM, HCPhys & ~(RTHCPHYS)PAGE_OFFSET_MASK, &pv);
    489483# endif
    490484    pv = (void *)((uintptr_t)pv | ((uintptr_t)HCPhys & PAGE_OFFSET_MASK));
     
    617611{
    618612#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    619     int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)ppPd);
     613    int rc = pgmR0DynMapGCPageInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)ppPd);
    620614    if (RT_FAILURE(rc))
    621615    {
     
    642636#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    643637    PX86PD pGuestPD = NULL;
    644     int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPD);
     638    int rc = pgmR0DynMapGCPageInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPD);
    645639    if (RT_FAILURE(rc))
    646640    {
     
    671665{
    672666#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    673     int rc = pgmR0DynMapGCPageOffInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)ppPdpt);
     667    int rc = pgmR0DynMapGCPageOffInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)ppPdpt);
    674668    if (RT_FAILURE(rc))
    675669    {
     
    715709#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    716710    PX86PDPT pGuestPDPT = NULL;
    717     int rc = pgmR0DynMapGCPageOffInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPDPT);
     711    int rc = pgmR0DynMapGCPageOffInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPDPT);
    718712    AssertRCReturn(rc, NULL);
    719713#else
     
    751745#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    752746            PX86PDPAE   pGuestPD = NULL;
    753             int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s,
     747            int rc = pgmR0DynMapGCPageInlined(pVCpu,
    754748                                              pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK,
    755749                                              (void **)&pGuestPD);
     
    803797#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    804798    PX86PDPAE   pGuestPD = NULL;
    805     int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s,
     799    int rc = pgmR0DynMapGCPageInlined(pVCpu,
    806800                                      pGuestPDPT->a[iPdpt].u & X86_PDPE_PG_MASK,
    807801                                      (void **)&pGuestPD);
     
    834828{
    835829#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    836     int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)ppPml4);
     830    int rc = pgmR0DynMapGCPageInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)ppPml4);
    837831    if (RT_FAILURE(rc))
    838832    {
     
    876870#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    877871    PX86PML4 pGuestPml4;
    878     int rc = pgmR0DynMapGCPageInlined(&pVCpu->CTX_SUFF(pVM)->pgm.s, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPml4);
     872    int rc = pgmR0DynMapGCPageInlined(pVCpu, pVCpu->pgm.s.GCPhysCR3, (void **)&pGuestPml4);
    879873    AssertRCReturn(rc, NULL);
    880874#else
     
    998992DECLINLINE(PX86PD) pgmShwGet32BitPDPtr(PVMCPU pVCpu)
    999993{
    1000     return (PX86PD)PGMPOOL_PAGE_2_PTR(pVCpu->CTX_SUFF(pVM), pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     994    return (PX86PD)PGMPOOL_PAGE_2_PTR_V2(pVCpu->CTX_SUFF(pVM), pVCpu, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
    1001995}
    1002996
     
    10491043DECLINLINE(PX86PDPT) pgmShwGetPaePDPTPtr(PVMCPU pVCpu)
    10501044{
    1051     return (PX86PDPT)PGMPOOL_PAGE_2_PTR(pVCpu->CTX_SUFF(pVM), pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     1045    return (PX86PDPT)PGMPOOL_PAGE_2_PTR_V2(pVCpu->CTX_SUFF(pVM), pVCpu, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
    10521046}
    10531047
     
    10731067    AssertReturn(pShwPde, NULL);
    10741068
    1075     return (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     1069    return (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    10761070}
    10771071
     
    10961090    AssertReturn(pShwPde, NULL);
    10971091
    1098     return (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     1092    return (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    10991093}
    11001094
     
    11481142DECLINLINE(PX86PML4) pgmShwGetLongModePML4Ptr(PVMCPU pVCpu)
    11491143{
    1150     return (PX86PML4)PGMPOOL_PAGE_2_PTR(pVCpu->CTX_SUFF(pVM), pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     1144    return (PX86PML4)PGMPOOL_PAGE_2_PTR_V2(pVCpu->CTX_SUFF(pVM), pVCpu, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
    11511145}
    11521146
  • trunk/src/VBox/VMM/PGMInternal.h

    r31167 r31170  
    241241#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    242242# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
    243      pgmR0DynMapHCPageInlined(&(pVM)->pgm.s, HCPhys, (void **)(ppv))
     243     pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), HCPhys, (void **)(ppv))
    244244#else
    245245# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
     
    264264#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    265265# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \
    266      pgmR0DynMapGCPageInlined(&(pVM)->pgm.s, GCPhys, (void **)(ppv))
     266     pgmR0DynMapGCPageInlined(VMMGetCpu(pVM), GCPhys, (void **)(ppv))
    267267#else
    268268# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \
     
    284284#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    285285# define PGM_GCPHYS_2_PTR_BY_VMCPU(pVCpu, GCPhys, ppv) \
    286      pgmR0DynMapGCPageInlined(&(pVCpu)->CTX_SUFF(pVM)->pgm.s, GCPhys, (void **)(ppv))
     286     pgmR0DynMapGCPageInlined(pVCpu, GCPhys, (void **)(ppv))
    287287#else
    288288# define PGM_GCPHYS_2_PTR_BY_VMCPU(pVCpu, GCPhys, ppv) \
    289289     PGM_GCPHYS_2_PTR((pVCpu)->CTX_SUFF(pVM), GCPhys, ppv)
    290 #endif
    291 
    292 /** @def PGM_GCPHYS_2_PTR_BY_PGMCPU
    293  * Maps a GC physical page address to a virtual address.
    294  *
    295  * @returns VBox status code.
    296  * @param   pPGM    Pointer to the PGM instance data.
    297  * @param   GCPhys  The GC physical address to map to a virtual one.
    298  * @param   ppv     Where to store the virtual address. No need to cast this.
    299  *
    300  * @remark  In GC this uses PGMGCDynMapGCPage(), so it will consume of the
    301  *          small page window employeed by that function. Be careful.
    302  * @remark  There is no need to assert on the result.
    303  */
    304 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    305 # define PGM_GCPHYS_2_PTR_BY_PGMCPU(pPGM, GCPhys, ppv) \
    306      pgmR0DynMapGCPageInlined(PGMCPU2PGM(pPGM), GCPhys, (void **)(ppv))
    307 #else
    308 # define PGM_GCPHYS_2_PTR_BY_PGMCPU(pPGM, GCPhys, ppv) \
    309      PGM_GCPHYS_2_PTR(PGMCPU2VM(pPGM), GCPhys, ppv)
    310290#endif
    311291
     
    21602140 */
    21612141#if defined(IN_RC)
    2162 # define PGMPOOL_PAGE_2_PTR(pVM, pPage)  pgmPoolMapPageInlined(&(pVM)->pgm.s, (pPage))
     2142# define PGMPOOL_PAGE_2_PTR(pVM, pPage)  pgmPoolMapPageInlined((pVM), (pPage))
    21632143#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    2164 # define PGMPOOL_PAGE_2_PTR(pVM, pPage)  pgmPoolMapPageInlined(&(pVM)->pgm.s, (pPage))
     2144# define PGMPOOL_PAGE_2_PTR(pVM, pPage)  pgmPoolMapPageInlined((pVM), (pPage))
    21652145#elif defined(VBOX_STRICT)
    21662146# define PGMPOOL_PAGE_2_PTR(pVM, pPage)  pgmPoolMapPageStrict(pPage)
     
    21722152#else
    21732153# define PGMPOOL_PAGE_2_PTR(pVM, pPage)  ((pPage)->pvPageR3)
     2154#endif
     2155
     2156
     2157/** @def PGMPOOL_PAGE_2_PTR_V2
     2158 * Maps a pool page pool into the current context, taking both VM and VMCPU.
     2159 *
     2160 * @returns VBox status code.
     2161 * @param   pVM     The VM handle.
     2162 * @param   pVCpu   The current CPU.
     2163 * @param   pPage   The pool page.
     2164 *
     2165 * @remark  In RC this uses PGMGCDynMapHCPage(), so it will consume of the
     2166 *          small page window employeed by that function. Be careful.
     2167 * @remark  There is no need to assert on the result.
     2168 */
     2169#if defined(IN_RC)
     2170# define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageInlined((pVM), (pPage))
     2171#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
     2172# define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   pgmPoolMapPageInlined((pVM), (pPage))
     2173#else
     2174# define PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPage)   PGMPOOL_PAGE_2_PTR((pVM), (pPage))
    21742175#endif
    21752176
     
    35813582#endif /* IN_RING3 */
    35823583#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    3583 int             pgmR0DynMapHCPageCommon(PVM pVM, PPGMMAPSET pSet, RTHCPHYS HCPhys, void **ppv);
     3584int             pgmR0DynMapHCPageCommon(PPGMMAPSET pSet, RTHCPHYS HCPhys, void **ppv);
    35843585#endif
    35853586int             pgmPoolAllocEx(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage, bool fLockPage = false);
  • trunk/src/VBox/VMM/PGMPool.cpp

    r30574 r31170  
    637637                    if (pPage->cPresent)
    638638                    {
    639                         void *pvShw = PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pPage);
     639                        void *pvShw = PGMPOOL_PAGE_2_PTR_V2(pPool->CTX_SUFF(pVM), pVCpu, pPage);
    640640                        STAM_PROFILE_START(&pPool->StatZeroPage, z);
    641641#if 0
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r31167 r31170  
    10011001        pgmPoolCacheUsed(pPool, pShwPage);
    10021002    }
    1003     *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1003    *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    10041004    return VINF_SUCCESS;
    10051005}
     
    11051105
    11061106    const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
    1107     PX86PDPT  pPdpt = (PX86PDPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1107    PX86PDPT  pPdpt = (PX86PDPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    11081108    PX86PDPE  pPdpe = &pPdpt->a[iPdPt];
    11091109
     
    11421142             | (uGstPdpe & ~(X86_PDPE_PG_MASK | X86_PDPE_AVL_MASK | X86_PDPE_PCD | X86_PDPE_PWT));
    11431143
    1144     *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1144    *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    11451145    return VINF_SUCCESS;
    11461146}
     
    11791179
    11801180    const unsigned  iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
    1181     PCX86PDPT       pPdpt = *ppPdpt = (PX86PDPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1181    PCX86PDPT       pPdpt = *ppPdpt = (PX86PDPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    11821182    if (!pPdpt->a[iPdPt].n.u1Present)
    11831183        return VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT;
     
    11861186    AssertReturn(pShwPage, VERR_INTERNAL_ERROR);
    11871187
    1188     *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1188    *ppPD = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    11891189    return VINF_SUCCESS;
    11901190}
     
    12141214    Assert(PGMIsLockOwner(pVM));
    12151215
    1216     pPml4 = (PEPTPML4)PGMPOOL_PAGE_2_PTR(pVM, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
     1216    pPml4 = (PEPTPML4)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3));
    12171217    Assert(pPml4);
    12181218
     
    12421242
    12431243    const unsigned iPdPt = (GCPtr >> EPT_PDPT_SHIFT) & EPT_PDPT_MASK;
    1244     PEPTPDPT  pPdpt = (PEPTPDPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1244    PEPTPDPT  pPdpt = (PEPTPDPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    12451245    PEPTPDPTE pPdpe = &pPdpt->a[iPdPt];
    12461246
     
    12701270    pPdpe->n.u1Execute  = 1;
    12711271
    1272     *ppPD = (PEPTPD)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1272    *ppPD = (PEPTPD)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    12731273    return VINF_SUCCESS;
    12741274}
     
    22892289            //Log(("PGMDynMapGCPage: GCPhys=%RGp pPage=%R[pgmpage]\n", GCPhys, pPage));
    22902290#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    2291             rc = pgmR0DynMapHCPageInlined(&pVM->pgm.s, PGM_PAGE_GET_HCPHYS(pPage), ppv);
     2291            rc = pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), PGM_PAGE_GET_HCPHYS(pPage), ppv);
    22922292#else
    22932293            rc = PGMDynMapHCPage(pVM, PGM_PAGE_GET_HCPHYS(pPage), ppv);
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r31167 r31170  
    10951095    Assert(pShwPde);
    10961096
    1097     pPDDst             = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     1097    pPDDst             = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    10981098    PX86PDEPAE pPdeDst = &pPDDst->a[iPDDst];
    10991099
     
    12321232# if 0 /* likely cause of a major performance regression; must be SyncPageWorkerTrackDeref then */
    12331233                const unsigned iPTEDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK;
    1234                 PSHWPT pPT = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1234                PSHWPT pPT = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    12351235                if (pPT->a[iPTEDst].n.u1Present)
    12361236                {
     
    17431743    Assert(pShwPde);
    17441744
    1745     pPDDst             = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     1745    pPDDst             = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    17461746    PX86PDEPAE pPdeDst = &pPDDst->a[iPDDst];
    17471747
     
    18201820        if (PdeSrc.n.u1Accessed)
    18211821        {
    1822             PSHWPT pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     1822            PSHWPT pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    18231823            if (!fBigPage)
    18241824            {
     
    21072107
    21082108    PPGMPOOLPAGE  pShwPage = pgmPoolGetPage(pPool, PdeDst.u & SHW_PDE_PG_MASK);
    2109     PSHWPT        pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     2109    PSHWPT        pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    21102110
    21112111    Assert(cPages == 1 || !(uErr & X86_TRAP_PF_P));
     
    23122312            if (pShwPage)
    23132313            {
    2314                 PSHWPT      pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     2314                PSHWPT      pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    23152315                PSHWPTE     pPteDst  = &pPTDst->a[(GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK];
    23162316                if (    pPteDst->n.u1Present
     
    23602360        if (pShwPage)
    23612361        {
    2362             PSHWPT      pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     2362            PSHWPT      pPTDst   = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    23632363            PSHWPTE     pPteDst  = &pPTDst->a[(GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK];
    23642364            if (pPteDst->n.u1Present)    /** @todo Optimize accessed bit emulation? */
     
    24972497    Assert(pShwPde);
    24982498
    2499     pPDDst  = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     2499    pPDDst  = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    25002500    pPdeDst = &pPDDst->a[iPDDst];
    25012501
     
    26122612        }
    26132613        if (rc == VINF_SUCCESS)
    2614             pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     2614            pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    26152615        else if (rc == VINF_PGM_CACHED_PAGE)
    26162616        {
     
    29512951    Assert(pShwPde);
    29522952
    2953     pPDDst  = (PX86PDPAE)PGMPOOL_PAGE_2_PTR(pVM, pShwPde);
     2953    pPDDst  = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPde);
    29542954    pPdeDst = &pPDDst->a[iPDDst];
    29552955
     
    30813081    if (    rc == VINF_SUCCESS
    30823082        ||  rc == VINF_PGM_CACHED_PAGE)
    3083         pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage);
     3083        pPTDst = (PSHWPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPage);
    30843084    else
    30853085        AssertMsgFailedReturn(("rc=%Rrc\n", rc), VERR_INTERNAL_ERROR);
     
    38213821                        continue;
    38223822                    }
    3823                     const SHWPT *pPTDst = (const SHWPT *)PGMPOOL_PAGE_2_PTR(pVM, pPoolPage);
     3823                    const SHWPT *pPTDst = (const SHWPT *)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pPoolPage);
    38243824
    38253825                    if (PdeDst.u & (X86_PDE4M_PWT | X86_PDE4M_PCD))
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r31167 r31170  
    426426            case PGMMODE_32_BIT:
    427427            {
    428                 PX86PD          pShw32BitPd = (PX86PD)PGMPOOL_PAGE_2_PTR(pVM, pShwPageCR3);
     428                PX86PD          pShw32BitPd = (PX86PD)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPageCR3);
    429429                AssertFatal(pShw32BitPd);
    430430
     
    439439                const unsigned  iPdpt     = iOldPDE / 256;      /* iOldPDE * 2 / 512; iOldPDE is in 4 MB pages */
    440440                unsigned        iPaePde   = iOldPDE * 2 % 512;
    441                 PX86PDPT        pShwPdpt  = (PX86PDPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPageCR3);
     441                PX86PDPT        pShwPdpt  = (PX86PDPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPageCR3);
    442442                PX86PDPAE       pShwPaePd = pgmShwGetPaePDPtr(pVCpu, pShwPdpt, (iPdpt << X86_PDPT_SHIFT));
    443443
     
    538538            case PGMMODE_32_BIT:
    539539            {
    540                 PCX86PD         pShw32BitPd = (PCX86PD)PGMPOOL_PAGE_2_PTR(pVM, pShwPageCR3);
     540                PCX86PD         pShw32BitPd = (PCX86PD)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu2, pShwPageCR3);
    541541                AssertFatal(pShw32BitPd);
    542542
     
    553553                const unsigned  iPdpt     = iPDE / 256;         /* iPDE * 2 / 512; iPDE is in 4 MB pages */
    554554                unsigned        iPaePDE   = iPDE * 2 % 512;
    555                 PX86PDPT        pShwPdpt  = (PX86PDPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPageCR3);
     555                PX86PDPT        pShwPdpt  = (PX86PDPT)PGMPOOL_PAGE_2_PTR_V2(pVM, pVCpu, pShwPageCR3);
    556556                PCX86PDPAE      pShwPaePd = pgmShwGetPaePDPtr(pVCpu, pShwPdpt, iPdpt << X86_PDPT_SHIFT);
    557557                AssertFatal(pShwPaePd);
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r31136 r31170  
    749749     * Map it by HCPhys.
    750750     */
    751     return pgmR0DynMapHCPageInlined(&pVM->pgm.s, HCPhys, ppv);
     751    return pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), HCPhys, ppv);
    752752
    753753#else
     
    826826    Assert(HCPhys != pVM->pgm.s.HCPhysZeroPg);
    827827# ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
    828     pgmR0DynMapHCPageInlined(&pVM->pgm.s, HCPhys, ppv);
     828    pgmR0DynMapHCPageInlined(VMMGetCpu(pVM), HCPhys, ppv);
    829829# else
    830830    PGMDynMapHCPage(pVM, HCPhys, ppv);
     
    11631163     */
    11641164#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    1165     *ppv = pgmDynMapHCPageOff(&pVM->pgm.s, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK));
     1165    *ppv = pgmDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK));
    11661166#else
    11671167    PPGMPAGEMAPTLBE pTlbe;
     
    12011201     */
    12021202#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    1203     *ppv = pgmDynMapHCPageOff(&pVM->pgm.s, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
     1203    *ppv = pgmDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
    12041204#else
    12051205    PPGMPAGEMAPTLBE pTlbe;
     
    12591259        if (RT_SUCCESS(rc))
    12601260        {
    1261             *ppv = pgmDynMapHCPageOff(&pVM->pgm.s, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
     1261            *ppv = pgmDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
    12621262# if 0
    12631263            pLock->pvMap = 0;
     
    13701370        else
    13711371        {
    1372             *ppv = pgmDynMapHCPageOff(&pVM->pgm.s, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
     1372            *ppv = pgmDynMapHCPageOff(pVM, PGM_PAGE_GET_HCPHYS(pPage) | (GCPhys & PAGE_OFFSET_MASK)); /** @todo add a read only flag? */
    13731373# if 0
    13741374            pLock->pvMap = 0;
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r31123 r31170  
    102102DECLINLINE(void *) PGMPOOL_PAGE_2_LOCKED_PTR(PVM pVM, PPGMPOOLPAGE pPage)
    103103{
    104     void *pv = pgmPoolMapPageInlined(&pVM->pgm.s, pPage);
     104    void *pv = pgmPoolMapPageInlined(pVM, pPage);
    105105
    106106    /* Make sure the dynamic mapping will not be reused. */
  • trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp

    r31126 r31170  
    8181#endif
    8282
     83/** Converts a PGMCPUM::AutoSet pointer into a PVMCPU. */
     84#define PGMR0DYNMAP_2_VMCPU(pSet)           (RT_FROM_MEMBER(pSet, VMCPU, pgm.s.AutoSet))
     85
     86/** Converts a PGMCPUM::AutoSet pointer into a PVM. */
     87#define PGMR0DYNMAP_2_VM(pSet)              (PGMR0DYNMAP_2_VMCPU(pSet)->CTX_SUFF(pVM))
     88
    8389
    8490/*******************************************************************************
     
    11791185 * @param   HCPhys      The address of the page to be mapped.
    11801186 * @param   iPage       The page index pgmR0DynMapPage hashed HCPhys to.
    1181  * @param   pVM         The shared VM structure, for statistics only.
    1182  */
    1183 static uint32_t pgmR0DynMapPageSlow(PPGMR0DYNMAP pThis, RTHCPHYS HCPhys, uint32_t iPage, PVM pVM)
     1187 */
     1188static uint32_t pgmR0DynMapPageSlow(PPGMR0DYNMAP pThis, RTHCPHYS HCPhys, uint32_t iPage)
    11841189{
    11851190#ifdef VBOX_WITH_STATISTICS
    1186     PVMCPU pVCpu = VMMGetCpu(pVM);
     1191    PVMCPU pVCpu = PGMR0DYNMAP_2_VMCPU(pThis);
    11871192#endif
    11881193    STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0DynMapPageSlow);
     
    12801285 * @param   HCPhys      The address of the page to be mapped.
    12811286 * @param   iRealCpu    The real cpu set index. (optimization)
    1282  * @param   pVM         The shared VM structure, for statistics only.
    12831287 * @param   ppvPage     Where to the page address.
    12841288 */
    1285 DECLINLINE(uint32_t) pgmR0DynMapPage(PPGMR0DYNMAP pThis, RTHCPHYS HCPhys, int32_t iRealCpu, PVM pVM, void **ppvPage)
     1289DECLINLINE(uint32_t) pgmR0DynMapPage(PPGMR0DYNMAP pThis, RTHCPHYS HCPhys, int32_t iRealCpu, void **ppvPage)
    12861290{
    12871291#ifdef VBOX_WITH_STATISTICS
    1288     PVMCPU              pVCpu   = VMMGetCpu(pVM);
     1292    PVMCPU              pVCpu   = PGMR0DYNMAP_2_VMCPU(pThis);
    12891293#endif
    12901294    RTSPINLOCKTMP       Tmp     = RTSPINLOCKTMP_INITIALIZER;
     
    13241328            else
    13251329            {
    1326                 iPage = pgmR0DynMapPageSlow(pThis, HCPhys, iPage, pVM);
     1330                iPage = pgmR0DynMapPageSlow(pThis, HCPhys, iPage);
    13271331                if (RT_UNLIKELY(iPage == UINT32_MAX))
    13281332                {
     
    18291833 *
    18301834 * @returns VINF_SUCCESS, bails out to ring-3 on failure.
    1831  * @param   pVM         The shared VM structure (for statistics).
    18321835 * @param   pSet        The set.
    18331836 * @param   HCPhys      The physical address of the page.
     
    18361839 * @remarks This is a very hot path.
    18371840 */
    1838 int pgmR0DynMapHCPageCommon(PVM pVM, PPGMMAPSET pSet, RTHCPHYS HCPhys, void **ppv)
    1839 {
    1840     LogFlow(("pgmR0DynMapHCPageCommon: pVM=%p pSet=%p HCPhys=%RHp ppv=%p\n",
    1841              pVM, pSet, HCPhys, ppv));
     1841int pgmR0DynMapHCPageCommon(PPGMMAPSET pSet, RTHCPHYS HCPhys, void **ppv)
     1842{
     1843    LogFlow(("pgmR0DynMapHCPageCommon: pSet=%p HCPhys=%RHp ppv=%p\n", pSet, HCPhys, ppv));
    18421844#ifdef VBOX_WITH_STATISTICS
    1843     PVMCPU pVCpu = VMMGetCpu(pVM);
     1845    PVMCPU pVCpu = PGMR0DYNMAP_2_VMCPU(pSet);
    18441846#endif
    18451847    AssertMsg(pSet->iCpu == RTMpCpuIdToSetIndex(RTMpCpuId()), ("%d %d(%d) efl=%#x\n", pSet->iCpu, RTMpCpuIdToSetIndex(RTMpCpuId()), RTMpCpuId(), ASMGetFlags()));
     
    18491851     */
    18501852    void *pvPage;
    1851     uint32_t const  iPage = pgmR0DynMapPage(g_pPGMR0DynMap, HCPhys, pSet->iCpu, pVM, &pvPage);
     1853    uint32_t const  iPage = pgmR0DynMapPage(g_pPGMR0DynMap, HCPhys, pSet->iCpu, &pvPage);
    18521854    if (RT_UNLIKELY(iPage == UINT32_MAX))
    18531855    {
     
    18551857                         g_pPGMR0DynMap->cLoad, g_pPGMR0DynMap->cMaxLoad, g_pPGMR0DynMap->cPages, g_pPGMR0DynMap->cGuardPages);
    18561858        if (!g_fPGMR0DynMapTestRunning)
    1857             VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_VM_R0_ASSERTION, 0);
     1859            VMMRZCallRing3NoCpu(PGMR0DYNMAP_2_VM(pSet), VMMCALLRING3_VM_R0_ASSERTION, 0);
    18581860        *ppv = NULL;
    18591861        return VERR_PGM_DYNMAP_FAILED;
     
    19511953                RTAssertMsg2Weak("PGMDynMapHCPage: set is full!\n");
    19521954                if (!g_fPGMR0DynMapTestRunning)
    1953                     VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_VM_R0_ASSERTION, 0);
     1955                    VMMRZCallRing3NoCpu(PGMR0DYNMAP_2_VM(pSet), VMMCALLRING3_VM_R0_ASSERTION, 0);
    19541956                *ppv = NULL;
    19551957                return VERR_PGM_DYNMAP_FULL_SET;
     
    19871989     * Call common code.
    19881990     */
    1989     int rc = pgmR0DynMapHCPageCommon(pVM, pSet, HCPhys, ppv);
     1991    int rc = pgmR0DynMapHCPageCommon(pSet, HCPhys, ppv);
    19901992
    19911993    STAM_PROFILE_STOP(&pVCpu->pgm.s.StatR0DynMapHCPage, a);
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