VirtualBox

Changeset 17547 in vbox


Ignore:
Timestamp:
Mar 9, 2009 2:48:02 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43983
Message:

GMM: executed the GMM_GCPHYS_LAST todo, fixed GMM_GCPHYS_UNSHAREABLE, and make sure the RAM isn't above GMM_GCPHYS_LAST.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/gmm.h

    r17432 r17547  
    108108
    109109
     110/** @def GMM_GCPHYS_LAST
     111 * The last of the valid guest physical address as it applies to GMM pages.
     112 *
     113 * This must reflect the constraints imposed by the RTGCPHYS type and
     114 * the guest page frame number used internally in GMMPAGE.
     115 *
     116 * @note    Note this corresponds to GMM_PAGE_PFN_LAST. */
     117#if HC_ARCH_BITS == 64
     118# define GMM_GCPHYS_LAST            UINT64_C(0x00000fffffff0000)    /* 2^44 (16TB) - 0x10000 */
     119#else
     120# define GMM_GCPHYS_LAST            UINT64_C(0x0000000fffff0000)    /* 2^36 (64GB) - 0x10000 */
     121#endif
     122
    110123/**
    111124 * Over-commitment policy.
     
    241254typedef GMMPAGEDESC *PGMMPAGEDESC;
    242255
    243 /** GMMPAGEDESC::HCPhysGCPhys value that indicates that the page is shared. */
    244 #define GMM_GCPHYS_UNSHAREABLE  (RTHCPHYS)(0xfffffff0)
     256/** GMMPAGEDESC::HCPhysGCPhys value that indicates that the page is unsharable.
     257 * @note    This corresponds to GMM_PAGE_PFN_UNSHAREABLE. */
     258#if HC_ARCH_BITS == 64
     259# define GMM_GCPHYS_UNSHAREABLE     UINT64_C(0x00000fffffff1000)
     260#else
     261# define GMM_GCPHYS_UNSHAREABLE     UINT64_C(0x0000000fffff1000)
     262#endif
    245263
    246264GMMR0DECL(int)  GMMR0Init(void);
  • trunk/src/VBox/VMM/MM.cpp

    r17541 r17547  
    313313    else
    314314        AssertMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamSize\", rc=%Rrc.\n", rc), rc);
    315     AssertLogRelMsg(!(cbRam & ~X86_PTE_PAE_PG_MASK), ("%RGp\n", cbRam));
     315    AssertLogRelMsg(!(cbRam & ~X86_PTE_PAE_PG_MASK), ("%RGp X86_PTE_PAE_PG_MASK=%RX64\n", cbRam, X86_PTE_PAE_PG_MASK));
     316    AssertLogRelMsgReturn(cbRam <= GMM_GCPHYS_LAST, ("cbRam=%RGp GMM_GCPHYS_LAST=%RX64\n", cbRam, GMM_GCPHYS_LAST), VERR_OUT_OF_RANGE);
    316317    cbRam &= X86_PTE_PAE_PG_MASK;
    317318    pVM->mm.s.cbRamBase = cbRam;
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r17431 r17547  
    327327#define GMM_PAGE_IS_FREE(pPage)     ( (pPage)->Common.u2State == GMM_PAGE_STATE_FREE )
    328328
    329 /** @def GMM_PAGE_PFN_END
    330  * The end of the valid guest pfn range, {0..GMM_PAGE_PFN_END-1}.
    331  * @remark Some of the values outside the range has special meaning, see related \#defines.
     329/** @def GMM_PAGE_PFN_LAST
     330 * The last valid guest pfn range.
     331 * @remark Some of the values outside the range has special meaning,
     332 *         see GMM_PAGE_PFN_UNSHAREABLE.
    332333 */
    333334#if HC_ARCH_BITS == 64
    334 # define GMM_PAGE_PFN_END           UINT32_C(0xfffffff0)
     335# define GMM_PAGE_PFN_LAST           UINT32_C(0xfffffff0)
    335336#else
    336 # define GMM_PAGE_PFN_END           UINT32_C(0x00fffff0)
     337# define GMM_PAGE_PFN_LAST           UINT32_C(0x00fffff0)
    337338#endif
     339AssertCompile(GMM_PAGE_PFN_LAST        == (GMM_GCPHYS_LAST >> PAGE_SHIFT));
    338340
    339341/** @def GMM_PAGE_PFN_UNSHAREABLE
     
    345347# define GMM_PAGE_PFN_UNSHAREABLE   UINT32_C(0x00fffff1)
    346348#endif
    347 
    348 /** @def GMM_GCPHYS_LAST
    349  * The last of the valid guest physical address as it applies to GMM pages.
    350  *
    351  * This must reflect the constraints imposed by the RTGCPHYS type and
    352  * the guest page frame number used internally in GMMPAGE. */
    353 #if 1
    354 # define GMM_GCPHYS_LAST            UINT32_C(0xfffff000)            /* 2^32 (4GB)  - 0x1000 */
    355 #else /** @todo enable this after changing NIL_RTHCPHYS to ~(RTHCPHYS)0! */
    356 #if HC_ARCH_BITS == 64
    357 # define GMM_GCPHYS_LAST            UINT64_C(0x00000fffffff0000)    /* 2^44 (16TB) - 0x10000 */
    358 #else
    359 # define GMM_GCPHYS_LAST            UINT64_C(0x0000000fffff0000)    /* 2^36 (64GB) - 0x10000 */
    360 #endif
    361 #endif
     349AssertCompile(GMM_PAGE_PFN_UNSHAREABLE == (GMM_GCPHYS_UNSHAREABLE >> PAGE_SHIFT));
    362350
    363351
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