VirtualBox

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


Ignore:
Timestamp:
Feb 22, 2010 5:48:23 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57914
Message:

Large page changes

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

Legend:

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

    r26152 r26685  
    338338    return !!pVCpu->hwaccm.s.Event.fPending;
    339339}
    340 
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r26277 r26685  
    21082108
    21092109/**
     2110 * Enable or disable large page usage
     2111 *
     2112 * @param   pVM             The VM to operate on.
     2113 * @param   fUseLargePages  Use/not use large pages
     2114 */
     2115VMMDECL(void) PGMSetLargePageUsage(PVM pVM, bool fUseLargePages)
     2116{
     2117      pVM->fUseLargePages = fUseLargePages;
     2118}
     2119
     2120/**
    21102121 * Acquire the PGM lock.
    21112122 *
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r26635 r26685  
    29372937    Assert(!PdeDst.n.u1Present); /* We're only supposed to call SyncPT on PDE!P and conflicts.*/
    29382938
    2939 # if (PGM_SHW_TYPE == PGM_TYPE_EPT) && (HC_ARCH_BITS == 64) && defined(RT_OS_WINDOWS) && defined(DEBUG_sandervl)
     2939# if (PGM_SHW_TYPE == PGM_TYPE_EPT) && (HC_ARCH_BITS == 64) && defined(RT_OS_WINDOWS)
     2940    if (PGMIsUsingLargePages(pVM))
    29402941    {
    29412942        RTHCPHYS HCPhys;
    29422943        rc = pgmPhysAllocLargePage(pVM, GCPtrPage & SHW_PDE_PG_MASK, &HCPhys);
    29432944        if (RT_SUCCESS(rc))
    2944         {   
     2945        {
    29452946            PdeDst.u &= X86_PDE_AVL_MASK;
    29462947            PdeDst.u |= HCPhys;
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r26679 r26685  
    368368    Assert(!PGM_PAGE_IS_MMIO(pPage));
    369369
     370    if (PGMIsUsingLargePages(pVM))
     371    {
     372        RTHCPHYS HCPhysDummy;
     373
     374        int rc = pgmPhysAllocLargePage(pVM, GCPhys, &HCPhysDummy);
     375        if (rc == VINF_SUCCESS)
     376            return rc;
     377
     378        /* fall back to 4kb pages. */
     379    }
    370380
    371381    /*
     
    471481     */
    472482    Assert(PGMIsLocked(pVM));
     483    Assert(PGMIsUsingLargePages(pVM));
    473484    Assert((GCPhys & X86_PD_PAE_MASK) == 0);
    474485    AssertPtr(pHCPhys);
     
    540551                }
    541552                LogFlow(("pgmPhysAllocLargePage failed with %Rrc\n", rc));
     553
     554                /* If we fail once, it most likely means the host's memory is too fragmented; don't bother trying again. */
     555                PGMSetLargePageUsage(pVM, false);
    542556                return rc;
    543557            }
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