VirtualBox

Changeset 12894 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Oct 2, 2008 8:02:05 AM (16 years ago)
Author:
vboxsync
Message:

Enabled some EPT paging code.

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

Legend:

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

    r12798 r12894  
    518518            LogRel(("HWACCM: MSR bitmap physaddr           = %VHp\n", pVM->hwaccm.s.vmx.pMSRBitmapPhys));
    519519
     520#ifdef HWACCM_VTX_WITH_EPT
     521            if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_EPT)
     522                pVM->hwaccm.s.fNestedPaging = pVM->hwaccm.s.fAllowNestedPaging;
     523#endif
     524
    520525            /* Only try once. */
    521526            pVM->hwaccm.s.fInitialized = true;
     
    553558#endif
    554559                LogRel(("HWACCM: VMX enabled!\n"));
     560                if (pVM->hwaccm.s.fNestedPaging)
     561                    LogRel(("HWACCM:    Enabled nested paging\n"));
    555562            }
    556563            else
  • trunk/src/VBox/VMM/PGM.cpp

    r12793 r12894  
    985985#undef PGM_SHW_NAME_R0_STR
    986986
    987 
    988 #ifdef PGM_WITH_EPT
    989987/*
    990988 * Shadow - EPT
     
    11011099#undef PGM_SHW_NAME_GC_STR
    11021100#undef PGM_SHW_NAME_R0_STR
    1103 #endif /* PGM_WITH_EPT */
    11041101
    11051102/**
     
    28112808    }
    28122809
    2813 #ifdef PGM_WITH_EPT
    28142810    /* Extended paging (EPT) / Intel VT-x */
    28152811    pModeData = &pVM->pgm.s.paModeData[pgmModeDataIndex(PGM_TYPE_EPT, PGM_TYPE_REAL)];
     
    28472843    rc = PGM_GST_NAME_AMD64(InitData)(      pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);
    28482844    rc = PGM_BTH_NAME_EPT_AMD64(InitData)(  pVM, pModeData, fResolveGCAndR0); AssertRCReturn(rc, rc);
    2849 #endif /* PGM_WITH_EPT */
    28502845    return VINF_SUCCESS;
    28512846}
     
    32223217                rc = PGM_SHW_NAME_NESTED(Enter)(pVM);
    32233218                break;
    3224 #ifdef PGM_WITH_EPT
    32253219            case PGMMODE_EPT:
    32263220                rc = PGM_SHW_NAME_EPT(Enter)(pVM);
    32273221                break;
    3228 #endif
    32293222            case PGMMODE_REAL:
    32303223            case PGMMODE_PROTECTED:
     
    32803273                    rc2 = PGM_BTH_NAME_NESTED_REAL(Enter)(pVM, NIL_RTGCPHYS);
    32813274                    break;
    3282 #ifdef PGM_WITH_EPT
    32833275                case PGMMODE_EPT:
    32843276                    rc2 = PGM_BTH_NAME_EPT_REAL(Enter)(pVM, NIL_RTGCPHYS);
    32853277                    break;
    3286 #endif
    32873278                case PGMMODE_AMD64:
    32883279                case PGMMODE_AMD64_NX:
     
    33063297                    rc2 = PGM_BTH_NAME_NESTED_PROT(Enter)(pVM, NIL_RTGCPHYS);
    33073298                    break;
    3308 #ifdef PGM_WITH_EPT
    33093299                case PGMMODE_EPT:
    33103300                    rc2 = PGM_BTH_NAME_EPT_PROT(Enter)(pVM, NIL_RTGCPHYS);
    33113301                    break;
    3312 #endif
    33133302                case PGMMODE_AMD64:
    33143303                case PGMMODE_AMD64_NX:
     
    33333322                    rc2 = PGM_BTH_NAME_NESTED_32BIT(Enter)(pVM, GCPhysCR3);
    33343323                    break;
    3335 #ifdef PGM_WITH_EPT
    33363324                case PGMMODE_EPT:
    33373325                    rc2 = PGM_BTH_NAME_EPT_32BIT(Enter)(pVM, GCPhysCR3);
    33383326                    break;
    3339 #endif
    33403327                case PGMMODE_AMD64:
    33413328                case PGMMODE_AMD64_NX:
     
    33733360                    rc2 = PGM_BTH_NAME_NESTED_PAE(Enter)(pVM, GCPhysCR3);
    33743361                    break;
    3375 #ifdef PGM_WITH_EPT
    33763362                case PGMMODE_EPT:
    33773363                    rc2 = PGM_BTH_NAME_EPT_PAE(Enter)(pVM, GCPhysCR3);
    33783364                    break;
    3379 #endif
    33803365                case PGMMODE_32_BIT:
    33813366                case PGMMODE_AMD64:
     
    34003385                    rc2 = PGM_BTH_NAME_NESTED_AMD64(Enter)(pVM, GCPhysCR3);
    34013386                    break;
    3402 #ifdef PGM_WITH_EPT
    34033387                case PGMMODE_EPT:
    34043388                    rc2 = PGM_BTH_NAME_EPT_AMD64(Enter)(pVM, GCPhysCR3);
    34053389                    break;
    3406 #endif
    34073390                case PGMMODE_32_BIT:
    34083391                case PGMMODE_PAE:
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r11477 r12894  
    287287#undef PGM_SHW_NAME
    288288
    289 
    290 #ifdef PGM_WITH_EPT
    291289/*
    292290 * Shadow - EPT
     
    359357#undef PGM_SHW_TYPE
    360358#undef PGM_SHW_NAME
    361 #endif /* PGM_WITH_EPT */
    362359
    363360#endif
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r12129 r12894  
    4444
    4545/* Filter out some illegal combinations of guest and shadow paging, so we can remove redundant checks inside functions. */
    46 #if      PGM_GST_TYPE == PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_NESTED
     46#if      PGM_GST_TYPE == PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_PAE && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    4747# error "Invalid combination; PAE guest implies PAE shadow"
    4848#endif
     
    7979{
    8080#if   (PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64) \
    81     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     81    && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    8282
    8383# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE != PGM_TYPE_PAE
     
    866866PGM_BTH_DECL(int, InvalidatePage)(PVM pVM, RTGCUINTPTR GCPtrPage)
    867867{
    868 #if    PGM_WITH_PAGING(PGM_GST_TYPE) \
    869     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     868#if    PGM_WITH_PAGING(PGM_GST_TYPE)   \
     869    && PGM_SHW_TYPE != PGM_TYPE_NESTED \
     870    && PGM_SHW_TYPE != PGM_TYPE_EPT
    870871    int rc;
    871872
     
    15241525    LogFlow(("SyncPage: GCPtrPage=%VGv cPages=%d uErr=%#x\n", GCPtrPage, cPages, uErr));
    15251526
    1526 #if    (   PGM_GST_TYPE == PGM_TYPE_32BIT \
    1527         || PGM_GST_TYPE == PGM_TYPE_PAE \
     1527#if    (   PGM_GST_TYPE == PGM_TYPE_32BIT  \
     1528        || PGM_GST_TYPE == PGM_TYPE_PAE    \
    15281529        || PGM_GST_TYPE == PGM_TYPE_AMD64) \
    1529     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     1530    && PGM_SHW_TYPE != PGM_TYPE_NESTED     \
     1531    && PGM_SHW_TYPE != PGM_TYPE_EPT
    15301532
    15311533# if PGM_WITH_NX(PGM_GST_TYPE)
     
    18031805
    18041806#elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \
    1805     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     1807    && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    18061808
    18071809# ifdef PGM_SYNC_N_PAGES
     
    22492251       || PGM_GST_TYPE == PGM_TYPE_PAE    \
    22502252       || PGM_GST_TYPE == PGM_TYPE_AMD64) \
    2251     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     2253    && PGM_SHW_TYPE != PGM_TYPE_NESTED    \
     2254    && PGM_SHW_TYPE != PGM_TYPE_EPT
    22522255
    22532256    int rc = VINF_SUCCESS;
     
    26422645
    26432646#elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \
    2644     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     2647    && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    26452648
    26462649    int     rc     = VINF_SUCCESS;
     
    27402743{
    27412744#if   (PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64) \
    2742     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     2745    && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    27432746    /*
    27442747     * Check that all Guest levels thru the PDE are present, getting the
     
    28252828    }
    28262829    return rc;
    2827 #elif PGM_SHW_TYPE == PGM_TYPE_NESTED
     2830#elif PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    28282831    return VINF_SUCCESS; /* ignore */
    28292832#endif
     
    28472850    Assert(!HWACCMIsNestedPagingActive(pVM));
    28482851#if   (PGM_GST_TYPE == PGM_TYPE_32BIT ||  PGM_GST_TYPE == PGM_TYPE_REAL ||  PGM_GST_TYPE == PGM_TYPE_PROT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_TYPE_AMD64) \
    2849     && PGM_SHW_TYPE != PGM_TYPE_NESTED
     2852    && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    28502853
    28512854# ifndef IN_RING0
     
    30433046        fGlobal = true; /* Change this CR3 reload to be a global one. */
    30443047
    3045 #if PGM_SHW_TYPE != PGM_TYPE_NESTED
     3048#if PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
    30463049    /*
    30473050     * Update page access handlers.
     
    30643067#endif
    30653068
    3066 #if PGM_SHW_TYPE == PGM_TYPE_NESTED
     3069#if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    30673070    /** @todo check if this is really necessary */
    30683071    HWACCMFlushTLB(pVM);
     
    35123515    return VINF_SUCCESS;
    35133516# endif
    3514 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     3517#endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    35153518}
    35163519
     
    35553558PGM_BTH_DECL(unsigned, AssertCR3)(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCUINTPTR GCPtr, RTGCUINTPTR cb)
    35563559{
    3557 #if PGM_SHW_TYPE == PGM_TYPE_NESTED
     3560#if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    35583561    return 0;
    35593562#else
     
    42954298    return cErrors;
    42964299
    4297 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     4300#endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    42984301}
    42994302#endif /* VBOX_STRICT */
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r11311 r12894  
    115115PGM_SHW_DECL(int, GetPage)(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)
    116116{
    117 #if PGM_SHW_TYPE == PGM_TYPE_NESTED
     117#if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    118118    return VERR_PAGE_TABLE_NOT_PRESENT;
    119119
    120 #else /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     120#else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    121121    /*
    122122     * Get the PDE.
     
    222222
    223223    return VINF_SUCCESS;
    224 #endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     224#endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    225225}
    226226
     
    242242PGM_SHW_DECL(int, ModifyPage)(PVM pVM, RTGCUINTPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)
    243243{
    244 # if PGM_SHW_TYPE == PGM_TYPE_NESTED
     244# if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT
    245245    return VERR_PAGE_TABLE_NOT_PRESENT;
    246246
    247 # else /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     247# else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    248248    int rc;
    249249
     
    320320        }
    321321    }
    322 # endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED */
     322# endif /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */
    323323}
    324324
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