VirtualBox

Changeset 10021 in vbox


Ignore:
Timestamp:
Jun 30, 2008 3:13:44 PM (16 years ago)
Author:
vboxsync
Message:

Updates for amd64 nested paging.

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

Legend:

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

    r9982 r10021  
    12641264    AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[2] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[3]);
    12651265    pVM->pgm.s.pHCPaePDPT    = (PX86PDPT)MMR3PageAllocLow(pVM);
     1266    pVM->pgm.s.pHCNestedRoot = MMR3PageAllocLow(pVM);
     1267
    12661268    if (    !pVM->pgm.s.pHC32BitPD
    12671269        ||  !pVM->pgm.s.apHCPaePDs[0]
     
    12691271        ||  !pVM->pgm.s.apHCPaePDs[2]
    12701272        ||  !pVM->pgm.s.apHCPaePDs[3]
    1271         ||  !pVM->pgm.s.pHCPaePDPT)
     1273        ||  !pVM->pgm.s.pHCPaePDPT
     1274        ||  !pVM->pgm.s.pHCNestedRoot)
    12721275    {
    12731276        AssertMsgFailed(("Failed to allocate pages for the intermediate context!\n"));
     
    12831286    pVM->pgm.s.aHCPhysPaePDs[3] = MMPage2Phys(pVM, pVM->pgm.s.apHCPaePDs[3]);
    12841287    pVM->pgm.s.HCPhysPaePDPT    = MMPage2Phys(pVM, pVM->pgm.s.pHCPaePDPT);
     1288    pVM->pgm.s.HCPhysNestedRoot = MMPage2Phys(pVM, pVM->pgm.s.pHCNestedRoot);
    12851289
    12861290    /*
     
    12881292     */
    12891293    ASMMemZero32(pVM->pgm.s.pHC32BitPD, PAGE_SIZE);
    1290 
    12911294    ASMMemZero32(pVM->pgm.s.pHCPaePDPT, PAGE_SIZE);
     1295    ASMMemZero32(pVM->pgm.s.pHCNestedRoot, PAGE_SIZE);
    12921296    for (unsigned i = 0; i < ELEMENTS(pVM->pgm.s.apHCPaePDs); i++)
    12931297    {
  • trunk/src/VBox/VMM/PGMGst.h

    r8415 r10021  
    223223PGM_GST_DECL(int, Enter)(PVM pVM, RTGCPHYS GCPhysCR3)
    224224{
     225    Assert(!HWACCMIsNestedPagingActive(pVM));
    225226    /*
    226227     * Map and monitor CR3
     
    255256PGM_GST_DECL(int, Exit)(PVM pVM)
    256257{
     258    Assert(!HWACCMIsNestedPagingActive(pVM));
    257259    int rc = PGM_GST_NAME(UnmonitorCR3)(pVM);
    258260    if (VBOX_SUCCESS(rc))
  • trunk/src/VBox/VMM/PGMInternal.h

    r9990 r10021  
    20062006    /** @}*/
    20072007
     2008    /** @name Nested Shadow Paging
     2009     * @{ */
     2010    /** Root table; format depends on the host paging mode (AMD-V) or EPT */
     2011    R3R0PTRTYPE(void *)         pHCNestedRoot;
     2012    /** The Physical Address (HC) of the nested paging root. */
     2013    RTHCPHYS                    HCPhysNestedRoot;
     2014
    20082015    /** @name Function pointers for Shadow paging.
    20092016     * @{
  • trunk/src/VBox/VMM/PGMShw.h

    r9106 r10021  
    138138PGM_SHW_DECL(int, Enter)(PVM pVM)
    139139{
    140 #if PGM_SHW_MODE == PGM_MODE_AMD64
    141     /*
    142      * Set the RW, US and A flags for the fixed PDPEs.
    143      */
     140#if PGM_SHW_MODE == PGMMODE_NESTED
     141    Assert(HWACCMIsNestedPagingActive(pVM));
     142
     143    /* In non-nested mode we allocate the PML4 page on-demand; in nested mode we just use our fixed nested paging root. */
     144    pVM->pgm.s.pHCPaePML4 = (PX86PML4)pVM->pgm.s.pHCNestedRoot;
    144145#endif
    145146    return VINF_SUCCESS;
     
    169170PGM_SHW_DECL(int, Exit)(PVM pVM)
    170171{
    171 #if PGM_SHW_MODE == PGM_MODE_AMD64
    172     /*
    173      * Clear the RW, US and A flags for the fixed PDPEs.
    174      */
     172#if PGM_SHW_MODE == PGMMODE_NESTED
     173    Assert(HWACCMIsNestedPagingActive(pVM));
     174    pVM->pgm.s.pHCPaePML4 = 0;
    175175#endif
    176176
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r9999 r10021  
    824824    int            rc;
    825825
    826     Assert(!HWACCMIsNestedPagingActive(pVM));
    827826    AssertReturn(pVM->pgm.s.pHCPaePML4, VERR_INTERNAL_ERROR);
    828827
     
    902901    PPGMPOOLPAGE   pShwPage;
    903902
    904     Assert(!HWACCMIsNestedPagingActive(pVM));
    905903    AssertReturn(pVM->pgm.s.pHCPaePML4, VERR_INTERNAL_ERROR);
    906904
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r9990 r10021  
    408408PGM_GST_DECL(int, MapCR3)(PVM pVM, RTGCPHYS GCPhysCR3)
    409409{
     410    Assert(!HWACCMIsNestedPagingActive(pVM));
    410411#if PGM_GST_TYPE == PGM_TYPE_32BIT \
    411412 || PGM_GST_TYPE == PGM_TYPE_PAE \
     
    511512{
    512513    LogFlow(("UnmapCR3\n"));
     514    Assert(!HWACCMIsNestedPagingActive(pVM));
    513515
    514516    int rc = VINF_SUCCESS;
     
    561563{
    562564    Assert(!pVM->pgm.s.fMappingsFixed);
     565    Assert(!HWACCMIsNestedPagingActive(pVM));
    563566    int rc = VINF_SUCCESS;
    564567
     
    663666{
    664667    int rc = VINF_SUCCESS;
     668
     669    Assert(!HWACCMIsNestedPagingActive(pVM));
    665670
    666671    /*
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