VirtualBox

Changeset 13919 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 6, 2008 2:11:41 PM (16 years ago)
Author:
vboxsync
Message:

VMM: 3 R3R0PTRTYPE members down (a bunch left to go).

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

Legend:

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

    r13841 r13919  
    18841884    AssertMsg(pVM->pgm.s.pGC32BitPD, ("Init order, no relocation before paging is initialized!\n"));
    18851885    pVM->pgm.s.pGC32BitPD    += offDelta;
    1886     pVM->pgm.s.pGuestPDGC    += offDelta;
     1886    pVM->pgm.s.pGuestPDRC    += offDelta;
    18871887    AssertCompile(RT_ELEMENTS(pVM->pgm.s.apGCPaePDs) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsGC));
    18881888    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apGCPaePDs); i++)
     
    25922592     * Get page directory addresses.
    25932593     */
    2594     PX86PD     pPDSrc = pVM->pgm.s.pGuestPDHC;
     2594    PX86PD     pPDSrc = pVM->pgm.s.pGuestPDR3;
    25952595    Assert(pPDSrc);
    25962596    Assert(PGMPhysGCPhys2HCPtrAssert(pVM, (RTGCPHYS)(CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK), sizeof(*pPDSrc)) == pPDSrc);
  • trunk/src/VBox/VMM/PGMGst.h

    r13840 r13919  
    300300        const unsigned      iPD2 = (offPD + cbBuf - 1) / sizeof(X86PDE);
    301301        Assert(iPD1 - iPD2 <= 1);
    302         if (    (   pVM->pgm.s.pGuestPDHC->a[iPD1].n.u1Present
     302        if (    (   pVM->pgm.s.pGuestPDR3->a[iPD1].n.u1Present
    303303                 && pgmGetMapping(pVM, iPD1 << X86_PD_SHIFT) )
    304304            ||  (   iPD1 != iPD2
    305                  && pVM->pgm.s.pGuestPDHC->a[iPD2].n.u1Present
     305                 && pVM->pgm.s.pGuestPDR3->a[iPD2].n.u1Present
    306306                 && pgmGetMapping(pVM, iPD2 << X86_PD_SHIFT) )
    307307           )
  • trunk/src/VBox/VMM/PGMInternal.h

    r13832 r13919  
    19901990    /** @name 32-bit Guest Paging.
    19911991     * @{ */
    1992     /** The guest's page directory, HC pointer. */
    1993 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    1994     R3PTRTYPE(PX86PD)               pGuestPDHC;
    1995 #else
    1996     R3R0PTRTYPE(PX86PD)             pGuestPDHC;
    1997 #endif
    1998     /** The guest's page directory, static GC mapping. */
    1999     RCPTRTYPE(PX86PD)               pGuestPDGC;
     1992    /** The guest's page directory, R3 pointer. */
     1993    R3PTRTYPE(PX86PD)               pGuestPDR3;
     1994#ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
     1995    /** The guest's page directory, R0 pointer. */
     1996    R0PTRTYPE(PX86PD)               pGuestPDR0;
     1997#endif
     1998    /** The guest's page directory, static RC mapping. */
     1999    RCPTRTYPE(PX86PD)               pGuestPDRC;
    20002000    /** @} */
    20012001
     
    23462346    {
    23472347        /** The chunk tree, ordered by chunk id. */
    2348 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
     2348#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    23492349        R3PTRTYPE(PAVLU32NODECORE)  pTree;
    23502350#else
     
    32883288
    32893289/**
     3290 * Gets the page directory entry for the specified address (32-bit paging).
     3291 *
     3292 * @returns The page directory entry in question.
     3293 * @param   pPGM        Pointer to the PGM instance data.
     3294 * @param   GCPtr       The address.
     3295 */
     3296DECLINLINE(X86PGUINT) pgmGstGet32bitPDE(PPGM pPGM, RTGCPTR GCPtr)
     3297{
     3298#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
     3299    PCX86PD pGuestPD = 0;
     3300    int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD);
     3301    AssertRCReturn(rc, 0);
     3302    return pGuestPD->a[GCPtr >> X86_PD_SHIFT].u;
     3303#else
     3304    return pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT].u;
     3305#endif
     3306}
     3307
     3308
     3309/**
     3310 * Gets the address of a specific page directory entry (32-bit paging).
     3311 *
     3312 * @returns Pointer the page directory entry in question.
     3313 * @param   pPGM        Pointer to the PGM instance data.
     3314 * @param   GCPtr       The address.
     3315 */
     3316DECLINLINE(PX86PDE) pgmGstGet32bitPDEPtr(PPGM pPGM, RTGCPTR GCPtr)
     3317{
     3318#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
     3319    PX86PD pGuestPD = 0;
     3320    int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD);
     3321    AssertRCReturn(rc, 0);
     3322    return &pGuestPD->a[GCPtr >> X86_PD_SHIFT];
     3323#else
     3324    return &pPGM->CTX_SUFF(pGuestPD)->a[GCPtr >> X86_PD_SHIFT];
     3325#endif
     3326}
     3327
     3328
     3329/**
     3330 * Gets the address the guest page directory (32-bit paging).
     3331 *
     3332 * @returns Pointer the page directory entry in question.
     3333 * @param   pPGM        Pointer to the PGM instance data.
     3334 */
     3335DECLINLINE(PX86PD) pgmGstGet32bitPDPtr(PPGM pPGM)
     3336{
     3337#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0
     3338    PX86PD pGuestPD = 0;
     3339    int rc = PGMDynMapGCPage(PGM2VM(pPGM), pPGM->GCPhysCR3, (void **)pGuestPD);
     3340    AssertRCReturn(rc, 0);
     3341    return pGuestPD;
     3342#else
     3343    return pPGM->CTX_SUFF(pGuestPD);
     3344#endif
     3345}
     3346
     3347
     3348/**
    32903349 * Gets the page directory for the specified address.
    32913350 *
  • trunk/src/VBox/VMM/PGMMap.cpp

    r13824 r13919  
    10571057         * Resolve the page directory.
    10581058         */
    1059         PX86PD pPD = pVM->pgm.s.pGuestPDHC;
     1059        PX86PD pPD = pVM->pgm.s.pGuestPDR3;
    10601060        Assert(pPD);
    10611061        Assert(pPD == (PX86PD)PGMPhysGCPhys2HCPtrAssert(pVM, cr3 & X86_CR3_PAGE_MASK, sizeof(*pPD)));
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r13832 r13919  
    103103#   if PGM_GST_TYPE == PGM_TYPE_32BIT
    104104    const unsigned  iPDSrc = (RTGCUINTPTR)pvFault >> GST_PD_SHIFT;
    105     PGSTPD          pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
     105    PGSTPD          pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    106106
    107107#   elif PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64
     
    953953     */
    954954# if PGM_GST_TYPE == PGM_TYPE_32BIT
    955     PX86PD          pPDSrc      = CTXSUFF(pVM->pgm.s.pGuestPD);
     955    PGSTPD          pPDSrc      = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    956956    const unsigned  iPDSrc      = GCPtrPage >> GST_PD_SHIFT;
    957957    GSTPDE          PdeSrc      = pPDSrc->a[iPDSrc];
     
    28102810#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    28112811    const unsigned  iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT;
    2812     PGSTPD          pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
     2812    PGSTPD          pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    28132813#  elif PGM_GST_TYPE == PGM_TYPE_PAE
    28142814    unsigned        iPDSrc;
     
    29292929#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    29302930    const unsigned  iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT;
    2931     PGSTPD          pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
     2931    PGSTPD          pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    29322932#  elif PGM_GST_TYPE == PGM_TYPE_PAE
    29332933    unsigned        iPDSrc;
     
    31583158
    31593159#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    3160     PGSTPD          pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
     3160    PGSTPD      pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    31613161    Assert(pPDSrc);
    31623162#   ifndef IN_RC
     
    36533653# if !defined(IN_RING0) && PGM_GST_TYPE != PGM_TYPE_AMD64
    36543654#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    3655     rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGuestPDGC, NULL, &HCPhysShw);
     3655    rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGuestPDRC, NULL, &HCPhysShw);
    36563656#  else
    36573657    rc = PGMShwGetPage(pVM, (RTGCPTR)pPGM->pGstPaePDPTGC, NULL, &HCPhysShw);
     
    36633663#  if PGM_GST_TYPE == PGM_TYPE_32BIT && defined(IN_RING3)
    36643664    RTGCPHYS GCPhys;
    3665     rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGuestPDHC, &GCPhys);
     3665    rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGuestPDR3, &GCPhys);
    36663666    AssertRCReturn(rc, 1);
    36673667    AssertMsgReturn((cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false);
     
    38333833# endif
    38343834# if PGM_GST_TYPE == PGM_TYPE_32BIT
    3835             const GSTPD    *pPDSrc = CTXSUFF(pPGM->pGuestPD);
     3835            GSTPD const    *pPDSrc = pgmGstGet32bitPDPtr(&pVM->pgm.s);
    38363836#  if PGM_SHW_TYPE == PGM_TYPE_32BIT
    38373837            PCX86PD         pPDDst = pPGM->CTXMID(p,32BitPD);
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r13824 r13919  
    179179     */
    180180# if PGM_GST_TYPE == PGM_TYPE_32BIT
    181     const X86PDE Pde = CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> X86_PD_SHIFT];
     181    X86PDE Pde;
     182    Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr);
     183
    182184#elif PGM_GST_TYPE == PGM_TYPE_PAE
    183185    X86PDEPAE    Pde;
     
    188190     */
    189191    Pde.u = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr);
     192
    190193#elif PGM_GST_TYPE == PGM_TYPE_AMD64
    191194    PX86PML4E    pPml4e;
     
    299302         */
    300303# if PGM_GST_TYPE == PGM_TYPE_32BIT
    301         PX86PDE pPde = &CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> X86_PD_SHIFT];
     304        PX86PDE pPde = pgmGstGet32bitPDEPtr(&pVM->pgm.s, GCPtr);
     305
    302306# elif PGM_GST_TYPE == PGM_TYPE_PAE
    303307        /* pgmGstGetPaePDEPtr will return 0 if the PDPTE is marked as not present
     
    398402# if PGM_GST_TYPE == PGM_TYPE_32BIT
    399403    X86PDE    Pde;
    400     Pde   = CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> GST_PD_SHIFT];
     404    Pde.u = pgmGstGet32bitPDE(&pVM->pgm.s, GCPtr);
    401405# elif PGM_GST_TYPE == PGM_TYPE_PAE
    402406    X86PDEPAE Pde;
     
    448452            PGM_INVL_PG(pVM->pgm.s.GCPtrCR3Mapping);
    449453# if PGM_GST_TYPE == PGM_TYPE_32BIT
    450             pVM->pgm.s.pGuestPDHC = (R3R0PTRTYPE(PX86PD))HCPtrGuestCR3;
    451             pVM->pgm.s.pGuestPDGC = (RCPTRTYPE(PX86PD))pVM->pgm.s.GCPtrCR3Mapping;
     454            pVM->pgm.s.pGuestPDR3 = (R3PTRTYPE(PX86PD))HCPtrGuestCR3;
     455#  ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
     456            pVM->pgm.s.pGuestPDR0 = (R0PTRTYPE(PX86PD))HCPtrGuestCR3;
     457#  endif
     458            pVM->pgm.s.pGuestPDRC = (RCPTRTYPE(PX86PD))pVM->pgm.s.GCPtrCR3Mapping;
    452459
    453460# elif PGM_GST_TYPE == PGM_TYPE_PAE
     
    546553
    547554#if PGM_GST_TYPE == PGM_TYPE_32BIT
    548     pVM->pgm.s.pGuestPDHC = 0;
    549     pVM->pgm.s.pGuestPDGC = 0;
     555    pVM->pgm.s.pGuestPDR3 = 0;
     556#ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
     557    pVM->pgm.s.pGuestPDR0 = 0;
     558#endif
     559    pVM->pgm.s.pGuestPDRC = 0;
    550560
    551561#elif PGM_GST_TYPE == PGM_TYPE_PAE
     
    777787
    778788#if PGM_GST_TYPE == PGM_TYPE_32BIT
    779     PX86PD          pPDSrc = pState->pVM->pgm.s.CTXSUFF(pGuestPD);
     789    PX86PD          pPDSrc = pgmGstGet32bitPDPtr(&pState->pVM->pgm.s);
    780790#endif
    781791
     
    10051015
    10061016        Assert(cb > 0 && cb <= 8);
    1007         Assert(iPD1 < RT_ELEMENTS(pVM->pgm.s.CTXSUFF(pGuestPD)->a)); /// @todo R3/R0 separation.
    1008         Assert(iPD2 < RT_ELEMENTS(pVM->pgm.s.CTXSUFF(pGuestPD)->a));
     1017        Assert(iPD1 < RT_ELEMENTS(pVM->pgm.s.CTX_SUFF(pGuestPD)->a)); /// @todo R3/R0 separation.
     1018        Assert(iPD2 < RT_ELEMENTS(pVM->pgm.s.CTX_SUFF(pGuestPD)->a));
    10091019
    10101020#ifdef DEBUG
     
    10161026        if (!pVM->pgm.s.fMappingsFixed)
    10171027        {
    1018             PX86PD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD);
     1028            PX86PD pPDSrc = pVM->pgm.s.CTX_SUFF(pGuestPD);
    10191029            if (    (   pPDSrc->a[iPD1].n.u1Present
    10201030                     && pgmGetMapping(pVM, (RTGCPTR)(iPD1 << X86_PD_SHIFT)) )
  • trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp

    r13832 r13919  
    396396    GEN_CHECK_OFF(PGM, GCPtrCR3Mapping);
    397397    GEN_CHECK_OFF(PGM, GCPhysGstCR3Monitored);
    398     GEN_CHECK_OFF(PGM, pGuestPDHC);
    399     GEN_CHECK_OFF(PGM, pGuestPDGC);
     398    GEN_CHECK_OFF(PGM, pGuestPDR3);
     399#ifndef VBOX_WITH_2X_4GB_ADDR_SPACE
     400    GEN_CHECK_OFF(PGM, pGuestPDR0);
     401#endif
     402    GEN_CHECK_OFF(PGM, pGuestPDRC);
    400403    GEN_CHECK_OFF(PGM, pGstPaePDPTHC);
    401404    GEN_CHECK_OFF(PGM, pGstPaePDPTGC);
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