VirtualBox

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


Ignore:
Timestamp:
Oct 2, 2008 11:48:49 AM (16 years ago)
Author:
vboxsync
Message:

Paging updates in preparation for EPT.

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

Legend:

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

    r12902 r12932  
    197197
    198198/** Macro for checking if the guest is using paging.
    199  * @param uType     PGM_TYPE_*
     199 * @param uGstType     PGM_TYPE_*
     200 * @param uShwType     PGM_TYPE_*
    200201 * @remark  ASSUMES certain order of the PGM_TYPE_* values.
    201202 */
    202 #define PGM_WITH_PAGING(uType)  ((uType) >= PGM_TYPE_32BIT && (uType) != PGM_TYPE_NESTED && (uType) != PGM_TYPE_EPT)
     203#define PGM_WITH_PAGING(uGstType, uShwType)  ((uGstType) >= PGM_TYPE_32BIT && (uShwType) != PGM_TYPE_NESTED && (uShwType) != PGM_TYPE_EPT)
    203204
    204205/** Macro for checking if the guest supports the NX bit.
    205  * @param uType     PGM_TYPE_*
     206 * @param uGstType     PGM_TYPE_*
     207 * @param uShwType     PGM_TYPE_*
    206208 * @remark  ASSUMES certain order of the PGM_TYPE_* values.
    207209 */
    208 #define PGM_WITH_NX(uType)  ((uType) >= PGM_TYPE_PAE && (uType) != PGM_TYPE_NESTED && (uType) != PGM_TYPE_EPT)
     210#define PGM_WITH_NX(uGstType, uShwType)  ((uGstType) >= PGM_TYPE_PAE && (uShwType) != PGM_TYPE_NESTED && (uShwType) != PGM_TYPE_EPT)
    209211
    210212
     
    13821384    /** Shw: 64-bit PML4;   Gst: 64-bit PML4. */
    13831385    PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4,
     1386
     1387    /** Shw: EPT page directory pointer table; Gst: no paging  */
     1388    PGMPOOLKIND_EPT_PDPT_FOR_PHYS,
     1389    /** Shw: EPT page directory table; Gst: no paging  */
     1390    PGMPOOLKIND_EPT_PD_FOR_PHYS,
     1391    /** Shw: EPT page table; Gst: no paging  */
     1392    PGMPOOLKIND_EPT_PT_FOR_PHYS,
    13841393
    13851394    /** Shw: Root 32-bit page directory. */
  • trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp

    r12702 r12932  
    140140HWACCMDECL(bool) HWACCMHasPendingIrq(PVM pVM)
    141141{
    142     return pVM->hwaccm.s.Event.fPending;
     142    return !!pVM->hwaccm.s.Event.fPending;
    143143}
    144144
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r12894 r12932  
    3737#include <VBox/em.h>
    3838#include <VBox/hwaccm.h>
     39#include <VBox/hwacc_vmx.h>
    3940#include "PGMInternal.h"
    4041#include <VBox/vm.h>
     
    227228#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    228229#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_REAL(name)
    229 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
    230 #include "PGMAllBth.h"
    231 #undef BTH_PGMPOOLKIND_PT_FOR_PT
     230#include "PGMAllBth.h"
    232231#undef PGM_BTH_NAME
    233232#undef PGM_GST_TYPE
     
    238237#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    239238#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_PROT(name)
    240 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
    241 #include "PGMAllBth.h"
    242 #undef BTH_PGMPOOLKIND_PT_FOR_PT
     239#include "PGMAllBth.h"
    243240#undef PGM_BTH_NAME
    244241#undef PGM_GST_TYPE
     
    249246#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    250247#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_32BIT(name)
    251 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_32BIT_PT
    252 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB
    253 #include "PGMAllBth.h"
    254 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
    255 #undef BTH_PGMPOOLKIND_PT_FOR_PT
     248#include "PGMAllBth.h"
    256249#undef PGM_BTH_NAME
    257250#undef PGM_GST_TYPE
     
    262255#define PGM_GST_NAME(name)          PGM_GST_NAME_PAE(name)
    263256#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_PAE(name)
    264 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    265 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_PAE_2MB
    266 #include "PGMAllBth.h"
    267 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
    268 #undef BTH_PGMPOOLKIND_PT_FOR_PT
     257#include "PGMAllBth.h"
    269258#undef PGM_BTH_NAME
    270259#undef PGM_GST_TYPE
     
    275264#define PGM_GST_NAME(name)          PGM_GST_NAME_AMD64(name)
    276265#define PGM_BTH_NAME(name)          PGM_BTH_NAME_NESTED_AMD64(name)
    277 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    278 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_PAE_2MB
    279 #include "PGMAllBth.h"
    280 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
    281 #undef BTH_PGMPOOLKIND_PT_FOR_PT
     266#include "PGMAllBth.h"
    282267#undef PGM_BTH_NAME
    283268#undef PGM_GST_TYPE
     
    298283#define PGM_GST_NAME(name)          PGM_GST_NAME_REAL(name)
    299284#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_REAL(name)
    300 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     285#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_EPT_PT_FOR_PHYS
    301286#include "PGMAllBth.h"
    302287#undef BTH_PGMPOOLKIND_PT_FOR_PT
     
    309294#define PGM_GST_NAME(name)          PGM_GST_NAME_PROT(name)
    310295#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_PROT(name)
    311 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PHYS
     296#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_EPT_PT_FOR_PHYS
    312297#include "PGMAllBth.h"
    313298#undef BTH_PGMPOOLKIND_PT_FOR_PT
     
    320305#define PGM_GST_NAME(name)          PGM_GST_NAME_32BIT(name)
    321306#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_32BIT(name)
    322 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_32BIT_PT
    323 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB
    324 #include "PGMAllBth.h"
    325 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
     307#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_EPT_PT_FOR_PHYS
     308#include "PGMAllBth.h"
    326309#undef BTH_PGMPOOLKIND_PT_FOR_PT
    327310#undef PGM_BTH_NAME
     
    333316#define PGM_GST_NAME(name)          PGM_GST_NAME_PAE(name)
    334317#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_PAE(name)
    335 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    336 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_PAE_2MB
    337 #include "PGMAllBth.h"
    338 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
     318#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_EPT_PT_FOR_PHYS
     319#include "PGMAllBth.h"
    339320#undef BTH_PGMPOOLKIND_PT_FOR_PT
    340321#undef PGM_BTH_NAME
     
    346327#define PGM_GST_NAME(name)          PGM_GST_NAME_AMD64(name)
    347328#define PGM_BTH_NAME(name)          PGM_BTH_NAME_EPT_AMD64(name)
    348 #define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    349 #define BTH_PGMPOOLKIND_PT_FOR_BIG  PGMPOOLKIND_PAE_PT_FOR_PAE_2MB
    350 #include "PGMAllBth.h"
    351 #undef BTH_PGMPOOLKIND_PT_FOR_BIG
     329#define BTH_PGMPOOLKIND_PT_FOR_PT   PGMPOOLKIND_EPT_PT_FOR_PHYS
     330#include "PGMAllBth.h"
    352331#undef BTH_PGMPOOLKIND_PT_FOR_PT
    353332#undef PGM_BTH_NAME
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r12894 r12932  
    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 && PGM_SHW_TYPE != PGM_TYPE_EPT
     81    && PGM_SHW_TYPE != PGM_TYPE_NESTED    \
     82    && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT)
    8283
    8384# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE != PGM_TYPE_PAE
     
    9798     */
    9899    int       rc;
    99 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     100# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    100101#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    101102    const unsigned  iPDSrc = (RTGCUINTPTR)pvFault >> GST_PD_SHIFT;
     
    174175# endif
    175176
    176 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     177# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    177178    /*
    178179     * If we successfully correct the write protection fault due to dirty bit
     
    192193
    193194    STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0ePD[iPDSrc]);
    194 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     195# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    195196
    196197    /*
     
    205206     *
    206207     */
    207 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     208# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    208209    GSTPDE PdeSrc = pPDSrc->a[iPDSrc];
    209210# else
     
    236237    }
    237238
    238 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     239# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    239240    /*
    240241     * Check if this address is within any of our mappings.
     
    304305        STAM_PROFILE_STOP(&pVM->pgm.s.StatMapping, a);
    305306    } /* pgmAreMappingsEnabled(&pVM->pgm.s) */
    306 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     307# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    307308
    308309    /*
     
    318319        RTGCPHYS    GCPhys = NIL_RTGCPHYS;
    319320
    320 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     321# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    321322#  if PGM_GST_TYPE == PGM_TYPE_AMD64
    322323        bool fBigPagesSupported = true;
     
    342343        /* No paging so the fault address is the physical address */
    343344        GCPhys = (RTGCPHYS)((RTGCUINTPTR)pvFault & ~PAGE_OFFSET_MASK);
    344 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     345# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    345346
    346347        /*
     
    411412                        }
    412413                    }
    413 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     414# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    414415                    else
    415416                    {
     
    502503                        }
    503504                    }
    504 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     505# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    505506
    506507                    /*
     
    543544                } /* if any kind of handler */
    544545
    545 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     546# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    546547                if (uErr & X86_TRAP_PF_P)
    547548                {
     
    580581                    }
    581582                }
    582 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     583# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    583584            }
    584585            else
     
    623624#  endif /* LOG_ENABLED */
    624625
    625 #  if PGM_WITH_PAGING(PGM_GST_TYPE) && !defined(IN_RING0)
     626#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0)
    626627                if (CPUMGetGuestCPL(pVM, pRegFrame) == 0)
    627628                {
     
    700701                    }
    701702                }
    702 #  endif /* PGM_WITH_PAGING(PGM_GST_TYPE) && !defined(IN_RING0) */
     703#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) && !defined(IN_RING0) */
    703704                rc = PGM_BTH_NAME(SyncPage)(pVM, PdeSrc, (RTGCUINTPTR)pvFault, PGM_SYNC_NR_PAGES, uErr);
    704705                if (VBOX_SUCCESS(rc))
     
    773774                }
    774775
    775 #  if PGM_WITH_PAGING(PGM_GST_TYPE)
     776#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    776777#   ifdef VBOX_STRICT
    777778                /*
     
    802803                    AssertMsgFailed(("PGMGCGetPage rc=%Vrc\n", rc));
    803804#   endif /* VBOX_STRICT */
    804 #  endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     805#  endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    805806            }
    806807            STAM_PROFILE_STOP(&pVM->pgm.s.StatOutOfSync, c);
     
    827828
    828829
    829 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     830# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    830831    /*
    831832     * Conclusion, this is a guest trap.
     
    837838    /* present, but not a monitored page; perhaps the guest is probing physical memory */
    838839    return VINF_EM_RAW_EMULATE_INSTR;
    839 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     840# endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    840841
    841842
     
    866867PGM_BTH_DECL(int, InvalidatePage)(PVM pVM, RTGCUINTPTR GCPtrPage)
    867868{
    868 #if    PGM_WITH_PAGING(PGM_GST_TYPE)   \
     869#if    PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)   \
    869870    && PGM_SHW_TYPE != PGM_TYPE_NESTED \
    870871    && PGM_SHW_TYPE != PGM_TYPE_EPT
     
    15311532    && PGM_SHW_TYPE != PGM_TYPE_EPT
    15321533
    1533 # if PGM_WITH_NX(PGM_GST_TYPE)
     1534# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    15341535    bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE);
    15351536# endif
     
    16031604        &&  (PdeSrc.n.u1User == PdeDst.n.u1User)
    16041605        &&  (PdeSrc.n.u1Write == PdeDst.n.u1Write || !PdeDst.n.u1Write)
    1605 # if PGM_WITH_NX(PGM_GST_TYPE)
     1606# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    16061607        &&  (!fNoExecuteBitValid || PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute)
    16071608# endif
     
    18051806
    18061807#elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \
    1807     && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
     1808    && PGM_SHW_TYPE != PGM_TYPE_NESTED \
     1809    && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT)
    18081810
    18091811# ifdef PGM_SYNC_N_PAGES
     
    18281830    Assert(pPDDst && pPdptDst);
    18291831    PdeDst = pPDDst->a[iPDDst];
     1832# elif PGM_SHW_TYPE == PGM_TYPE_EPT
     1833    const unsigned  iPDDst = GCPtrPage >> SHW_PD_SHIFT;
     1834    X86PDE          PdeDst = pVM->pgm.s.CTXMID(p,32BitPD)->a[iPDDst];
     1835    AssertFailed();
    18301836# endif
    18311837    Assert(PdeDst.n.u1Present);
     
    19131919
    19141920
    1915 #if PGM_WITH_PAGING(PGM_GST_TYPE)
     1921#if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    19161922
    19171923/**
     
    19361942    bool fBigPagesSupported = !!(CPUMGetGuestCR4(pVM) & X86_CR4_PSE);
    19371943# endif
    1938 # if PGM_WITH_NX(PGM_GST_TYPE)
     1944# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    19391945    bool fNoExecuteBitValid = !!(CPUMGetGuestEFER(pVM) & MSR_K6_EFER_NXE);
    19401946# endif
     
    19962002    if (    (uErr & X86_TRAP_PF_RSVD)
    19972003        ||  !pPdeSrc->n.u1Present
    1998 # if PGM_WITH_NX(PGM_GST_TYPE)
     2004# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    19992005        ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) && pPdeSrc->n.u1NoExecute)
    20002006# endif
     
    20592065        const GSTPTE   PteSrc = *pPteSrc;
    20602066        if (    !PteSrc.n.u1Present
    2061 #  if PGM_WITH_NX(PGM_GST_TYPE)
     2067#  if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    20622068            ||  (fNoExecuteBitValid && (uErr & X86_TRAP_PF_ID) && PteSrc.n.u1NoExecute)
    20632069#  endif
     
    22262232}
    22272233
    2228 #endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     2234#endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    22292235
    22302236
     
    26452651
    26462652#elif (PGM_GST_TYPE == PGM_TYPE_REAL || PGM_GST_TYPE == PGM_TYPE_PROT) \
    2647     && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT
     2653    && PGM_SHW_TYPE != PGM_TYPE_NESTED \
     2654    && (PGM_SHW_TYPE != PGM_TYPE_EPT || PGM_GST_TYPE == PGM_TYPE_PROT)
    26482655
    26492656    int     rc     = VINF_SUCCESS;
     
    26742681    PPGMPOOLPAGE pShwPde = pgmPoolGetPageByHCPhys(pVM, pPdptDst->a[iPdpte].u & X86_PDPE_PG_MASK);
    26752682    Assert(pShwPde);
     2683# elif PGM_SHW_TYPE == PGM_TYPE_EPT
     2684    const unsigned  iPDDst = GCPtrPage >> SHW_PD_SHIFT;
     2685    PEPTPD          pPDDst = NULL;
     2686
     2687    AssertFailed();
    26762688# endif
    26772689    PSHWPDE         pPdeDst = &pPDDst->a[iPDDst];
     
    27132725    PdeDst.n.u1Present  = 1;
    27142726    PdeDst.n.u1Write    = 1;
     2727# if PGM_SHW_TYPE != PGM_TYPE_EPT
    27152728    PdeDst.n.u1User     = 1;
    27162729    PdeDst.n.u1Accessed = 1;
     2730# endif
    27172731    *pPdeDst = PdeDst;
    27182732
     
    27492763     */
    27502764    int             rc      = VINF_SUCCESS;
    2751 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     2765# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    27522766#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    27532767    const unsigned  iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT;
     
    28672881     */
    28682882
    2869 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     2883# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    28702884#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    28712885    const unsigned  iPDSrc = (RTGCUINTPTR)GCPtrPage >> GST_PD_SHIFT;
     
    29372951    }
    29382952
    2939 # if PGM_WITH_PAGING(PGM_GST_TYPE)
     2953# if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    29402954    /* Check for dirty bit fault */
    29412955    rc = PGM_BTH_NAME(CheckPageFault)(pVM, uErr, pPdeDst, &pPDSrc->a[iPDSrc], GCPtrPage);
     
    29542968        PdeSrc.n.u1User     = 1;
    29552969
    2956 #endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */
     2970#endif /* PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) */
    29572971        Assert(rc != VINF_EM_RAW_GUEST_TRAP);
    29582972        if (uErr & X86_TRAP_PF_US)
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r11713 r12932  
    237237            *pfFlags = (Pte.u & ~GST_PTE_PG_MASK)
    238238                     & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US));
    239 # if PGM_WITH_NX(PGM_GST_TYPE)
     239# if PGM_WITH_NX(PGM_GST_TYPE, PGM_GST_TYPE)
    240240            /* The NX bit is determined by a bitwise OR between the PT and PD */
    241241            if (fNoExecuteBitValid)
     
    255255            *pfFlags = (Pde.u & ~(GST_PTE_PG_MASK | X86_PTE_PAT))
    256256                     | ((Pde.u & X86_PDE4M_PAT) >> X86_PDE4M_PAT_SHIFT);
    257 # if PGM_WITH_NX(PGM_GST_TYPE)
     257# if PGM_WITH_NX(PGM_GST_TYPE, PGM_GST_TYPE)
    258258            /* The NX bit is determined by a bitwise OR between the PT and PD */
    259259            if (fNoExecuteBitValid)
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r12204 r12932  
    26492649            /* GCPhys >> PAGE_SHIFT is the index here */
    26502650            break;
     2651        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     2652        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     2653            Assert(pUser->iUserTable < X86_PG_PAE_ENTRIES);
     2654            break;
    26512655        case PGMPOOLKIND_ROOT_NESTED:
    26522656            Assert(pUser->iUserTable < X86_PG_PAE_ENTRIES);
     
    26702674
    26712675        /* 64-bit entries */
    2672         case PGMPOOLKIND_ROOT_PAE_PD:
    2673         case PGMPOOLKIND_ROOT_PDPT:
    26742676        case PGMPOOLKIND_PAE_PD_FOR_32BIT_PD:
    26752677        case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:
     
    26772679        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
    26782680        case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4:
     2681        case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:
     2682        case PGMPOOLKIND_64BIT_PD_FOR_PHYS:
     2683        case PGMPOOLKIND_ROOT_PAE_PD:
     2684        case PGMPOOLKIND_ROOT_PDPT:
    26792685        case PGMPOOLKIND_ROOT_NESTED:
    26802686            u.pau64[pUser->iUserTable] = 0;
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r12894 r12932  
    6060# define SHW_PT_MASK            X86_PT_MASK
    6161# define SHW_POOL_ROOT_IDX      PGMPOOL_IDX_PD
     62#elif PGM_SHW_TYPE == PGM_TYPE_EPT
     63# define SHWPT                  EPTPT
     64# define PSHWPT                 PEPTPT
     65# define SHWPTE                 EPTPTE
     66# define PSHWPTE                PEPTPTE
     67# define SHWPD                  EPTPD
     68# define PSHWPD                 PEPTPD
     69# define SHWPDE                 EPTPDE
     70# define PSHWPDE                PEPTPDE
     71# define SHW_PDE_PG_MASK        EPT_PDE_PG_MASK
     72# define SHW_PD_SHIFT           EPT_PD_SHIFT
     73# define SHW_PD_MASK            EPT_PD_MASK
     74# define SHW_PTE_PG_MASK        EPT_PTE_PG_MASK
     75# define SHW_PT_SHIFT           EPT_PT_SHIFT
     76# define SHW_PT_MASK            EPT_PT_MASK
     77# define SHW_PDPT_SHIFT         EPT_PDPT_SHIFT
     78# define SHW_PDPT_MASK          EPT_PDPT_MASK
     79# define SHW_PDPE_PG_MASK       EPT_PDPE_PG_MASK
     80# define SHW_TOTAL_PD_ENTRIES   (EPT_PG_AMD64_ENTRIES*EPT_PG_AMD64_PDPE_ENTRIES)
     81# define SHW_POOL_ROOT_IDX      PGMPOOL_IDX_NESTED_ROOT      /* do not use! exception is real mode & protected mode without paging. */
    6282#else
    6383# define SHWPT                  X86PTPAE
     
    211231        *pfFlags = (Pte.u & ~SHW_PTE_PG_MASK)
    212232                 & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US));
    213 # if PGM_WITH_NX(PGM_SHW_TYPE)
     233# if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE)
    214234        /* The NX bit is determined by a bitwise OR between the PT and PD */
    215235        if (fNoExecuteBitValid)
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