VirtualBox

Changeset 16579 in vbox for trunk


Ignore:
Timestamp:
Feb 9, 2009 12:07:16 PM (16 years ago)
Author:
vboxsync
Message:

VBOX_WITH_PGMPOOL_PAGING_ONLY: More updates

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

Legend:

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

    r16575 r16579  
    142142    Assert(!HWACCMIsNestedPagingActive(pVM));
    143143    /* We only need shadow paging in real and protected mode for VT-x and AMD-V (excluding nested paging/EPT modes) */
    144     if (HWACCMR3IsActive(pVM))
     144    if (HWACCMIsEnabled(pVM))
    145145    {
    146146        /* Free the previous root mapping if still active. */
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r16428 r16579  
    872872DECLINLINE(int) pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD)
    873873{
    874     const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE;
    875     PX86PDPT       pPdpt = pgmShwGetPaePDPTPtr(&pVM->pgm.s);
    876     PX86PDPE       pPdpe = &pPdpt->a[iPdPt];
    877     PPGMPOOL       pPool         = pVM->pgm.s.CTX_SUFF(pPool);
    878     bool           fNestedPaging = HWACCMIsNestedPagingActive(pVM);
    879     bool           fPaging       = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG);
     874    const unsigned iPdPt    = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE;
     875    PX86PDPT       pPdpt    = pgmShwGetPaePDPTPtr(&pVM->pgm.s);
     876    PX86PDPE       pPdpe    = &pPdpt->a[iPdPt];
     877    PPGMPOOL       pPool    = pVM->pgm.s.CTX_SUFF(pPool);
    880878    PPGMPOOLPAGE   pShwPage;
    881879    int            rc;
     
    885883        &&  !(pPdpe->u & X86_PDPE_PG_MASK))
    886884    {
    887         if (!fNestedPaging)
     885        bool        fNestedPaging = HWACCMIsNestedPagingActive(pVM);
     886        bool        fPaging       = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG);
     887        RTGCPTR64   GCPdPt;
     888        PGMPOOLKIND enmKind;
     889
     890        if (fNestedPaging || !fPaging)
     891        {
     892            /* AMD-V nested paging or real/protected mode without paging */
     893            GCPdPt  = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT;
     894            enmKind = PGMPOOLKIND_PAE_PD_PHYS;
     895        }
     896        else
    888897        {
    889898            Assert(pGstPdpe);
    890             Assert(!(pPdpe->u & X86_PDPE_PG_MASK));
    891             /* Create a reference back to the PDPT by using the index in its shadow page. */
    892             rc = pgmPoolAlloc(pVM, pGstPdpe->u & X86_PDPE_PG_MASK, PGMPOOLKIND_PAE_PD_FOR_PAE_PD, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage);
    893         }
    894         else
    895         {
    896             /* AMD-V nested paging or real/protected mode without paging */
    897             RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT;
    898 
    899             rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_PAE_PD_PHYS, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage);
    900         }
    901 
     899
     900            GCPdPt  = pGstPdpe->u & X86_PDPE_PG_MASK;
     901            enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD;
     902        }
     903
     904        /* Create a reference back to the PDPT by using the index in its shadow page. */
     905        rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage);
    902906        if (rc == VERR_PGM_POOL_FLUSHED)
    903907        {
     
    971975    PX86PML4E      pPml4e        = pgmShwGetLongModePML4EPtr(pPGM, iPml4);
    972976    bool           fNestedPaging = HWACCMIsNestedPagingActive(pVM);
     977#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     978    bool           fPaging      = !!(CPUMGetGuestCR0(pVM) & X86_CR0_PG);
     979#endif
    973980    PPGMPOOLPAGE   pShwPage;
    974981    int            rc;
     
    978985        &&  !(pPml4e->u & X86_PML4E_PG_MASK))
    979986    {
    980         Assert(!(pPml4e->u & X86_PML4E_PG_MASK));
     987#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     988        RTGCPTR64   GCPml4;
     989        PGMPOOLKIND enmKind;
     990
     991        Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     992
     993        if (fNestedPaging || !fPaging)
     994        {
     995            /* AMD-V nested paging or real/protected mode without paging */
     996            GCPml4  = (RTGCPTR64)iPml4 << X86_PML4_SHIFT;
     997            enmKind = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS;
     998        }
     999        else
     1000        {
     1001            Assert(pGstPml4e && pGstPdpe);
     1002
     1003            GCPml4  = pGstPml4e->u & X86_PML4E_PG_MASK;
     1004            enmKind = PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT;
     1005        }
     1006
     1007        /* Create a reference back to the PDPT by using the index in its shadow page. */
     1008        rc = pgmPoolAlloc(pVM, GCPml4, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage);
     1009#else
    9811010        if (!fNestedPaging)
    9821011        {
     
    9941023                              PGMPOOLKIND_64BIT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage);
    9951024        }
    996 
     1025#endif
    9971026        if (rc == VERR_PGM_POOL_FLUSHED)
    9981027        {
     
    10211050        &&  !(pPdpe->u & X86_PDPE_PG_MASK))
    10221051    {
     1052#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1053        RTGCPTR64   GCPdPt;
     1054        PGMPOOLKIND enmKind;
     1055
     1056        if (fNestedPaging || !fPaging)
     1057        {
     1058            /* AMD-V nested paging or real/protected mode without paging */
     1059            GCPdPt  = (RTGCPTR64)iPdPt << X86_PDPT_SHIFT;
     1060            enmKind = PGMPOOLKIND_64BIT_PD_FOR_PHYS;
     1061        }
     1062        else
     1063        {
     1064            Assert(pGstPdpe);
     1065
     1066            GCPdPt  = pGstPdpe->u & X86_PDPE_PG_MASK;
     1067            enmKind = PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD;
     1068        }
     1069
     1070        /* Create a reference back to the PDPT by using the index in its shadow page. */
     1071        rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage);
     1072#else
    10231073        if (!fNestedPaging)
    10241074        {
     
    10351085            rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage);
    10361086        }
    1037 
     1087#endif
    10381088        if (rc == VERR_PGM_POOL_FLUSHED)
    10391089        {
     
    11341184        RTGCPTR64 GCPml4 = (RTGCPTR64)iPml4 << EPT_PML4_SHIFT;
    11351185
     1186#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1187        rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage);
     1188#else
    11361189        rc = pgmPoolAlloc(pVM, GCPml4 + RT_BIT_64(63) /* hack: make the address unique */, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage);
     1190#endif
    11371191        if (rc == VERR_PGM_POOL_FLUSHED)
    11381192        {
     
    11681222        RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT;
    11691223
     1224#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1225        rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage);
     1226#else
    11701227        rc = pgmPoolAlloc(pVM, GCPdPt + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage);
     1228#endif
    11711229        if (rc == VERR_PGM_POOL_FLUSHED)
    11721230        {
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r16428 r16579  
    12721272         */
    12731273        case PGMPOOLKIND_32BIT_PT_FOR_PHYS:
     1274        case PGMPOOLKIND_32BIT_PD_PHYS:
    12741275        case PGMPOOLKIND_PAE_PT_FOR_PHYS:
     1276        case PGMPOOLKIND_PAE_PD_PHYS:
     1277        case PGMPOOLKIND_PAE_PDPT_PHYS:
    12751278        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
    12761279        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     1280        case PGMPOOLKIND_EPT_PT_FOR_PHYS:
     1281        case PGMPOOLKIND_EPT_PD_FOR_PHYS:
    12771282        case PGMPOOLKIND_EPT_PDPT_FOR_PHYS:
    1278         case PGMPOOLKIND_EPT_PD_FOR_PHYS:
    1279         case PGMPOOLKIND_EPT_PT_FOR_PHYS:
    1280         case PGMPOOLKIND_PAE_PD_PHYS:
    1281         case PGMPOOLKIND_PAE_PDPT_PHYS:
    1282         case PGMPOOLKIND_32BIT_PD_PHYS:
     1283#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     1284            return false;
     1285#else
    12831286            return true;
     1287#endif
    12841288
    12851289        /*
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