VirtualBox

Changeset 16172 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jan 22, 2009 3:09:31 PM (16 years ago)
Author:
vboxsync
Message:

Moved amd64 paging data to unified shadow paging section.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r15990 r16172  
    931931             *        trustworthy? (Remove pgmGstGetLongModePML4E if pGstPml4e and pGstPdpe
    932932             *        are fine.) */
    933             Assert(pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));
     933            Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    934934            Pml4eGst = pgmGstGetLongModePML4E(&pVM->pgm.s, iPml4);
    935935
    936936            rc = pgmPoolAlloc(pVM, Pml4eGst.u & X86_PML4E_PG_MASK,
    937                               PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->idx, iPml4, &pShwPage);
     937                              PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage);
    938938        }
    939939        else
     
    12751275        case PGMMODE_AMD64:
    12761276        case PGMMODE_AMD64_NX:
    1277             return pVM->pgm.s.HCPhysShwPaePml4;
     1277            return pVM->pgm.s.HCPhysShwCR3;
    12781278
    12791279        case PGMMODE_EPT:
     
    13081308        case PGMMODE_AMD64:
    13091309        case PGMMODE_AMD64_NX:
    1310             return pVM->pgm.s.HCPhysShwPaePml4;
     1310            return pVM->pgm.s.HCPhysShwCR3;
    13111311
    13121312        default:
     
    13571357VMMDECL(RTHCPHYS) PGMGetHyperAmd64CR3(PVM pVM)
    13581358{
    1359     return pVM->pgm.s.HCPhysShwPaePml4;
     1359    return pVM->pgm.s.HCPhysShwCR3;
    13601360}
    13611361
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r15410 r16172  
    910910# else /* PGM_SHW_TYPE == PGM_TYPE_AMD64 */
    911911    /* PML4 */
    912     AssertReturn(pVM->pgm.s.pShwPaePml4R3, VERR_INTERNAL_ERROR);
     912    AssertReturn(CTX_SUFF(pVM->pgm.s.pShwRoot), VERR_INTERNAL_ERROR);
    913913
    914914    const unsigned  iPml4     = (GCPtrPage >> X86_PML4_SHIFT) & X86_PML4_MASK;
     
    10211021        LogFlow(("InvalidatePage: Out-of-sync PML4E (P/GCPhys) at %RGv GCPhys=%RGp vs %RGp Pml4eSrc=%RX64 Pml4eDst=%RX64\n",
    10221022                 GCPtrPage, pShwPdpt->GCPhys, GCPhysPdpt, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));
    1023         pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->idx, iPml4);
     1023        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);
    10241024        pPml4eDst->u = 0;
    10251025        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));
     
    10351035        LogFlow(("InvalidatePage: Out-of-sync PML4E at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n",
    10361036                 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));
    1037         pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->idx, iPml4);
     1037        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);
    10381038        pPml4eDst->u = 0;
    10391039        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));
     
    10471047        LogFlow(("InvalidatePage: Out-of-sync PML4E (A) at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n",
    10481048                 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));
    1049         pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->idx, iPml4);
     1049        pgmPoolFreeByPage(pPool, pShwPdpt, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);
    10501050        pPml4eDst->u = 0;
    10511051        STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r15410 r16172  
    517517                /** @todo Move this into PGMAllBth.h. */
    518518                PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    519                 if (pVM->pgm.s.CTX_SUFF(pShwAmd64CR3))
     519                if (pVM->pgm.s.CTX_SUFF(pShwPageCR3))
    520520                {
    521521                    /* It might have been freed already by a pool flush (see e.g. PGMR3MappingsUnfix). */
    522522                    /** @todo Coordinate this better with the pool. */
    523                     if (pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->enmKind != PGMPOOLKIND_FREE)
    524                         pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->GCPhys >> PAGE_SHIFT);
    525                     pVM->pgm.s.pShwAmd64CR3R3  = 0;
    526                     pVM->pgm.s.pShwAmd64CR3R0  = 0;
    527                     pVM->pgm.s.pShwPaePml4R3    = 0;
     523                    if (pVM->pgm.s.CTX_SUFF(pShwPageCR3)->enmKind != PGMPOOLKIND_FREE)
     524                        pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->GCPhys >> PAGE_SHIFT);
     525                    pVM->pgm.s.pShwPageCR3R3 = 0;
     526                    pVM->pgm.s.pShwPageCR3R0 = 0;
     527                    pVM->pgm.s.pShwRootR3    = 0;
    528528#  ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
    529                     pVM->pgm.s.pShwPaePml4R0    = 0;
     529                    pVM->pgm.s.pShwRootR0    = 0;
    530530#  endif
    531                     pVM->pgm.s.HCPhysShwPaePml4 = 0;
     531                    pVM->pgm.s.HCPhysShwCR3 = 0;
    532532                }
    533533
    534534                Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32)));
    535                 rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, PGMPOOL_IDX_AMD64_CR3, GCPhysCR3 >> PAGE_SHIFT, &pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));
     535                rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, PGMPOOL_IDX_AMD64_CR3, GCPhysCR3 >> PAGE_SHIFT, &pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    536536                if (rc == VERR_PGM_POOL_FLUSHED)
    537537                {
     
    542542                AssertRCReturn(rc, rc);
    543543#  ifdef IN_RING0
    544                 pVM->pgm.s.pShwAmd64CR3R3 = MMHyperCCToR3(pVM, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));
     544                pVM->pgm.s.pShwPageCR3R3 = MMHyperCCToR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    545545#  else
    546                 pVM->pgm.s.pShwAmd64CR3R0 = MMHyperCCToR0(pVM, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));
     546                pVM->pgm.s.pShwPageCR3R0 = MMHyperCCToR0(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    547547#  endif
    548                 pVM->pgm.s.pShwPaePml4R3 = (R3PTRTYPE(PX86PML4))pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->pvPageR3;
    549                 Assert(pVM->pgm.s.pShwPaePml4R3);
     548                pVM->pgm.s.pShwRootR3    = (R3PTRTYPE(void *))pVM->pgm.s.CTX_SUFF(pShwPageCR3)->pvPageR3;
     549                Assert(pVM->pgm.s.pShwRootR3);
    550550#  ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
    551                 pVM->pgm.s.pShwPaePml4R0 = (R0PTRTYPE(PX86PML4))PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pVM->pgm.s.CTX_SUFF(pShwAmd64CR3));
     551                pVM->pgm.s.pShwRootR0    = (R0PTRTYPE(void *))PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    552552#  endif
    553                 pVM->pgm.s.HCPhysShwPaePml4 = pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->Core.Key;
     553                pVM->pgm.s.HCPhysShwCR3  = pVM->pgm.s.CTX_SUFF(pShwPageCR3)->Core.Key;
    554554                rc = VINF_SUCCESS; /* clear it - pgmPoolAlloc returns hints. */
    555555            }
     
    611611    if (!HWACCMIsNestedPagingActive(pVM))
    612612    {
    613         pVM->pgm.s.pShwPaePml4R3 = 0;
     613        pVM->pgm.s.pShwRootR3 = 0;
    614614# ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
    615         pVM->pgm.s.pShwPaePml4R0 = 0;
    616 # endif
    617         pVM->pgm.s.HCPhysShwPaePml4 = 0;
    618         if (pVM->pgm.s.CTX_SUFF(pShwAmd64CR3))
     615        pVM->pgm.s.pShwRootR0 = 0;
     616# endif
     617        pVM->pgm.s.HCPhysShwCR3 = 0;
     618        if (pVM->pgm.s.CTX_SUFF(pShwPageCR3))
    619619        {
    620620            PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    621             pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwAmd64CR3)->GCPhys >> PAGE_SHIFT);
    622             pVM->pgm.s.pShwAmd64CR3R3 = 0;
    623             pVM->pgm.s.pShwAmd64CR3R0 = 0;
     621            pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), PGMPOOL_IDX_AMD64_CR3, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->GCPhys >> PAGE_SHIFT);
     622            pVM->pgm.s.pShwPageCR3R3 = 0;
     623            pVM->pgm.s.pShwPageCR3R0 = 0;
    624624        }
    625625    }
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