VirtualBox

Changeset 8458 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 29, 2008 12:00:53 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30321
Message:

Finished up the Gst part of longmode paging

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

Legend:

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

    r8454 r8458  
    34013401    return 0ULL;
    34023402}
     3403
     3404/**
     3405 * Gets the page directory entry for the specified address.
     3406 *
     3407 * @returns Pointer to the page directory entry in question.
     3408 * @returns NULL if the page directory is not present or on an invalid page.
     3409 * @param   pPGM        Pointer to the PGM instance data.
     3410 * @param   GCPtr       The address.
     3411 */
     3412DECLINLINE(PX86PDEPAE) pgmGstGetLongModePDEPtr(PPGM pPGM, RTGCUINTPTR64 GCPtr)
     3413{
     3414    const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK;
     3415
     3416    if (pPGM->pHCPaePML4->a[iPml4e].n.u1Present)
     3417    {
     3418        PX86PDPT pPdptTemp;
     3419        int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pPGM->pHCPaePML4->a[iPml4e].u & X86_PML4E_PG_MASK, &pPdptTemp);
     3420        if (VBOX_FAILURE(rc))
     3421        {
     3422            AssertFailed();
     3423            return NULL;
     3424        }
     3425
     3426        const unsigned iPdPt  = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64;
     3427        if (pPdptTemp->a[iPdPt].n.u1Present)
     3428        {
     3429            PX86PDPAE pPD;
     3430
     3431            rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), pPdptTemp->a[iPdPt].u & X86_PDPE_PG_MASK, &pPD);
     3432            if (VBOX_FAILURE(rc))
     3433            {
     3434                AssertFailed();
     3435                return NULL;
     3436            }
     3437            const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK;
     3438            return &pPD->a[iPD];
     3439        }
     3440    }
     3441    return NULL;
     3442}
     3443
    34033444#endif /* !IN_GC */
    34043445
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r8455 r8458  
    271271 || PGM_GST_TYPE == PGM_TYPE_AMD64
    272272
    273 #if PGM_GST_TYPE == PGM_TYPE_AMD64
    274     /* later */
    275     /* check level 3 & 4 bits as well (r/w, u/s, nxe) */
    276     AssertFailed();
    277     return VERR_NOT_IMPLEMENTED;
    278 #endif
    279 
    280273    for (;;)
    281274    {
     
    285278#if PGM_GST_TYPE == PGM_TYPE_32BIT
    286279        PX86PDE pPde = &CTXSUFF(pVM->pgm.s.pGuestPD)->a[GCPtr >> X86_PD_SHIFT];
    287 #else /* PAE */
     280#elif PGM_GST_TYPE == PGM_TYPE_PAE
    288281        /* pgmGstGetPaePDEPtr will return 0 if the PDPTE is marked as not present
    289282         * All the other bits in the PDPTE are only valid in long mode (r/w, u/s, nx)
    290283         */
    291284        PX86PDEPAE pPde = pgmGstGetPaePDEPtr(&pVM->pgm.s, GCPtr);
     285        Assert(pPde);
     286        if (!pPde)
     287            return VERR_PAGE_TABLE_NOT_PRESENT;
     288#elif PGM_GST_TYPE == PGM_TYPE_AMD64
     289        /** @todo Setting the r/w, u/s & nx bits might have no effect depending on the pdpte & pml4 values */
     290        PX86PDEPAE pPde = pgmGstGetLongModePDEPtr(&pVM->pgm.s, GCPtr);
    292291        Assert(pPde);
    293292        if (!pPde)
     
    375374    Pde.u = pgmGstGetPaePDE(&pVM->pgm.s, GCPtr);
    376375# elif PGM_GST_TYPE == PGM_TYPE_AMD64
    377     X86PDEPAE    Pde;
     376    X86PDEPAE Pde;
    378377    Pde.u = pgmGstGetLongModePDE(&pVM->pgm.s, GCPtr);
    379378# endif
     
    731730        Pde.u = pgmGstGetPaePDE(&pState->pVM->pgm.s, GCPtr);
    732731#elif PGM_GST_TYPE == PGM_TYPE_AMD64
    733         X86PDEPAE    Pde;
     732        X86PDEPAE   Pde;
    734733        Pde.u = pgmGstGetLongModePDE(&pState->pVM->pgm.s, GCPtr);
    735734#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette