VirtualBox

Changeset 10026 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 30, 2008 4:37:01 PM (17 years ago)
Author:
vboxsync
Message:

Nested paging updates.

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

Legend:

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

    r10021 r10026  
    13691369    /** Shw: 64-bit page directory pointer table;   Gst: 64-bit page directory pointer table. */
    13701370    PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT,
     1371    /** Shw: 64-bit page directory pointer table; Gst: no paging  */
     1372    PGMPOOLKIND_64BIT_PDPT_FOR_PHYS,
    13711373    /** Shw: 64-bit page directory table;   Gst: 64-bit page directory table. */
    13721374    PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD,
     1375    /** Shw: 64-bit page directory table; Gst: no paging  */
     1376    PGMPOOLKIND_64BIT_PD_FOR_PHYS,
    13731377
    13741378    /** Shw: 64-bit PML4;   Gst: 64-bit PML4. */
    13751379    PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4,
     1380    /** Shw: 64-bit PML4; Gst: no paging  */
     1381    PGMPOOLKIND_64BIT_PML4_FOR_PHYS,
    13761382
    13771383    /** Shw: Root 32-bit page directory. */
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r10021 r10026  
    823823    PPGMPOOLPAGE   pShwPage;
    824824    int            rc;
    825 
    826     AssertReturn(pVM->pgm.s.pHCPaePML4, VERR_INTERNAL_ERROR);
     825    PGMPOOLKIND    enmPdpt, enmPd;
     826
     827    AssertReturn(pVM->pgm.s.pHCPaePML4 && pVM->pgm.s.pHCShwAmd64CR3, VERR_INTERNAL_ERROR);
     828
     829    if (HWACCMIsNestedPagingActive(pVM))
     830    {
     831        enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS;
     832        enmPd   = PGMPOOLKIND_64BIT_PD_FOR_PHYS;
     833    }
     834    else
     835    {
     836        enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT;
     837        enmPd   = PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD;
     838    }
    827839
    828840    Assert(pVM->pgm.s.pHCPaePML4);
     
    835847
    836848        Assert(!(pPml4e->u & X86_PML4E_PG_MASK));
    837         rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e, &pShwPage);
     849        rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, enmPdpt, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e, &pShwPage);
    838850        if (rc == VERR_PGM_POOL_FLUSHED)
    839851            return VINF_PGM_SYNC_CR3;
     
    865877        Assert(!(pPdpe->u & X86_PDPE_PG_MASK));
    866878        /* Create a reference back to the PDPT by using the index in its shadow page. */
    867         rc = pgmPoolAlloc(pVM, pPdptGst->a[iPdPt].u & X86_PDPE_PG_MASK, PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD, pShwPage->idx, iPdPt, &pShwPage);
     879        rc = pgmPoolAlloc(pVM, pPdptGst->a[iPdPt].u & X86_PDPE_PG_MASK, enmPd, pShwPage->idx, iPdPt, &pShwPage);
    868880        if (rc == VERR_PGM_POOL_FLUSHED)
    869881            return VINF_PGM_SYNC_CR3;
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r9993 r10026  
    10541054        case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    10551055        case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1056        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1057        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1058        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    10561059            return true;
    10571060
     
    10741077                case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    10751078                case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1079                case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1080                case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1081                case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    10761082                    return true;
    10771083                default:
     
    10971103                case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    10981104                case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1105                case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1106                case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1107                case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    10991108                    return true;
    11001109                default:
     
    13181327                case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    13191328                case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1329                case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1330                case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1331                case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    13201332                    break;
    13211333                default:
     
    13641376        case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    13651377        case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1378        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1379        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1380        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    13661381            /* Nothing to monitor here. */
    13671382            return VINF_SUCCESS;
     
    14461461        case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    14471462        case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1463        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     1464        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1465        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    14481466            /* Nothing to monitor here. */
    14491467            return VINF_SUCCESS;
     
    21342152        case PGMPOOLKIND_ROOT_PAE_PD:
    21352153        case PGMPOOLKIND_ROOT_PDPT:
     2154        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     2155        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     2156        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    21362157            return 8;
    21372158
     
    21752196        case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
    21762197        case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     2198        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     2199        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     2200        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    21772201            /** @todo can we return 0? (nobody is calling this...) */
     2202            AssertFailed();
    21782203            return 0;
    21792204
     
    31643189        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
    31653190        case PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD:
     3191        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
    31663192            pgmPoolTrackDerefPDPae(pPool, pPage, (PX86PDPAE)pvShw);
    31673193            break;
    31683194
     3195        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
    31693196        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    31703197            pgmPoolTrackDerefPDPT64Bit(pPool, pPage, (PX86PDPT)pvShw);
     
    31723199
    31733200        case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4:
     3201        case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:
    31743202            pgmPoolTrackDerefPML464Bit(pPool, pPage, (PX86PML4)pvShw);
    31753203            break;
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