VirtualBox

Changeset 14131 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 12, 2008 12:46:26 PM (16 years ago)
Author:
vboxsync
Message:

PGM: Prevent fixated mappings from crossing a PD boundrary (guest+shadow PAE).

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

Legend:

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

    r14075 r14131  
    356356
    357357    /*
     358     * In PAE / PAE mode, make sure we don't cross page directories.
     359     */
     360    if (    (   pVM->pgm.s.enmGuestMode  == PGMMODE_PAE
     361             || pVM->pgm.s.enmGuestMode  == PGMMODE_PAE_NX)
     362        &&  (   pVM->pgm.s.enmShadowMode == PGMMODE_PAE
     363             || pVM->pgm.s.enmShadowMode == PGMMODE_PAE_NX))
     364    {
     365        unsigned iPdptBase = GCPtrBase >> X86_PDPT_SHIFT;
     366        unsigned iPdptLast = (GCPtrBase + cb - 1) >> X86_PDPT_SHIFT;
     367        if (iPdptBase != iPdptLast)
     368        {
     369            LogRel(("PGMR3MappingsFix: Crosses PD boundrary; iPdptBase=%#x iPdptLast=%#x (GCPtrBase=%RGv cb=%#zx). The guest should retry.\n",
     370                    iPdptBase, iPdptLast, GCPtrBase, cb));
     371            return VERR_PGM_MAPPINGS_FIX_CONFLICT;
     372        }
     373    }
     374
     375    /*
    358376     * Loop the mappings and check that they all agree on their new locations.
    359377     */
     
    977995         * Note that we do not support mappings at the very end of the
    978996         * address space since that will break our GCPtrEnd assumptions.
     997         * Nor do we support mappings crossing page directories.
    979998         */
    980999        const unsigned  cPTs = pMapping->cb >> X86_PD_PAE_SHIFT;
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r14103 r14131  
    32803280                        /* It's fixed, just skip the mapping. */
    32813281                        const unsigned cPTs = pMapping->cb >> GST_PD_SHIFT;
     3282                        Assert(PGM_GST_TYPE == PGM_TYPE_32BIT || (iPD + cPTs - 1) / X86_PG_PAE_ENTRIES == iPD / X86_PG_PAE_ENTRIES);
    32823283                        iPD += cPTs - 1;
    32833284#   if PGM_SHW_TYPE != PGM_GST_TYPE /* SHW==PAE && GST==32BIT */
     
    32853286#   else
    32863287                        pPDEDst += cPTs;
    3287                         /** @todo Assert on / deal with  cross PD mappings in PAE/PAE mode! */
    32883288#   endif
    32893289                        pMapping = pMapping->CTX_SUFF(pNext);
     
    34913491
    34923492                /* advance. */
     3493                Assert(PGM_GST_TYPE == PGM_TYPE_32BIT || (iPD + cPTs - 1) / X86_PG_PAE_ENTRIES == iPD / X86_PG_PAE_ENTRIES);
    34933494                iPD += cPTs - 1;
    34943495#   if PGM_SHW_TYPE != PGM_GST_TYPE /* SHW==PAE && GST==32BIT */
     
    34963497#   else
    34973498                pPDEDst += cPTs;
    3498                 /** @todo Assert on / deal with  cross PD mappings in PAE/PAE mode! */
    34993499#   endif
    35003500#   if PGM_GST_TYPE != PGM_SHW_TYPE
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