VirtualBox

Changeset 13236 in vbox for trunk/src


Ignore:
Timestamp:
Oct 13, 2008 9:25:50 PM (16 years ago)
Author:
vboxsync
Message:

#1865: More polish.

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

Legend:

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

    r13087 r13236  
    6868# define GST_PT_MASK                X86_PT_MASK
    6969# define GST_CR3_PAGE_MASK          X86_CR3_PAGE_MASK
     70
    7071#elif   PGM_GST_TYPE == PGM_TYPE_PAE \
    7172     || PGM_GST_TYPE == PGM_TYPE_AMD64
     
    140141
    141142    /* Ring-3 */
    142     pModeData->pfnR3GstRelocate        = PGM_GST_NAME(Relocate);
    143     pModeData->pfnR3GstExit            = PGM_GST_NAME(Exit);
    144     pModeData->pfnR3GstGetPDE          = PGM_GST_NAME(GetPDE);
    145     pModeData->pfnR3GstGetPage         = PGM_GST_NAME(GetPage);
    146     pModeData->pfnR3GstModifyPage      = PGM_GST_NAME(ModifyPage);
    147     pModeData->pfnR3GstMapCR3          = PGM_GST_NAME(MapCR3);
    148     pModeData->pfnR3GstUnmapCR3        = PGM_GST_NAME(UnmapCR3);
    149     pModeData->pfnR3GstMonitorCR3      = PGM_GST_NAME(MonitorCR3);
    150     pModeData->pfnR3GstUnmonitorCR3    = PGM_GST_NAME(UnmonitorCR3);
     143    pModeData->pfnR3GstRelocate           = PGM_GST_NAME(Relocate);
     144    pModeData->pfnR3GstExit               = PGM_GST_NAME(Exit);
     145    pModeData->pfnR3GstGetPDE             = PGM_GST_NAME(GetPDE);
     146    pModeData->pfnR3GstGetPage            = PGM_GST_NAME(GetPage);
     147    pModeData->pfnR3GstModifyPage         = PGM_GST_NAME(ModifyPage);
     148    pModeData->pfnR3GstMapCR3             = PGM_GST_NAME(MapCR3);
     149    pModeData->pfnR3GstUnmapCR3           = PGM_GST_NAME(UnmapCR3);
     150    pModeData->pfnR3GstMonitorCR3         = PGM_GST_NAME(MonitorCR3);
     151    pModeData->pfnR3GstUnmonitorCR3       = PGM_GST_NAME(UnmonitorCR3);
    151152
    152153#if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE
     
    168169#if PGM_SHW_TYPE != PGM_TYPE_AMD64 /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
    169170        /* GC */
    170         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPage),          &pModeData->pfnRCGstGetPage);
     171        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(GetPage),          &pModeData->pfnRCGstGetPage);
    171172        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(GetPage),  rc), rc);
    172         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(ModifyPage),       &pModeData->pfnRCGstModifyPage);
     173        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(ModifyPage),       &pModeData->pfnRCGstModifyPage);
    173174        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(ModifyPage),  rc), rc);
    174         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPDE),           &pModeData->pfnRCGstGetPDE);
     175        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(GetPDE),           &pModeData->pfnRCGstGetPDE);
    175176        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(GetPDE), rc), rc);
    176         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(MonitorCR3),       &pModeData->pfnRCGstMonitorCR3);
     177        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(MonitorCR3),       &pModeData->pfnRCGstMonitorCR3);
    177178        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(MonitorCR3), rc), rc);
    178         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(UnmonitorCR3),     &pModeData->pfnRCGstUnmonitorCR3);
     179        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(UnmonitorCR3),     &pModeData->pfnRCGstUnmonitorCR3);
    179180        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(UnmonitorCR3), rc), rc);
    180         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(MapCR3),           &pModeData->pfnRCGstMapCR3);
     181        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(MapCR3),           &pModeData->pfnRCGstMapCR3);
    181182        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(MapCR3), rc), rc);
    182         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(UnmapCR3),         &pModeData->pfnRCGstUnmapCR3);
     183        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(UnmapCR3),         &pModeData->pfnRCGstUnmapCR3);
    183184        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(UnmapCR3), rc), rc);
    184185# if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE
    185         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstWriteHandlerCR3);
     186        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstWriteHandlerCR3);
    186187        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(WriteHandlerCR3), rc), rc);
    187         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstPAEWriteHandlerCR3);
    188         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(PAEWriteHandlerCR3), rc), rc);
     188        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_GST_NAME_RC_STR(WriteHandlerCR3),  &pModeData->pfnRCGstPAEWriteHandlerCR3);
     189        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(WriteHandlerCR3), rc), rc);
    189190# endif
    190191#endif /* Not AMD64 shadow paging. */
    191192
    192193        /* Ring-0 */
    193         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(GetPage),          &pModeData->pfnR0GstGetPage);
     194        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(GetPage),          &pModeData->pfnR0GstGetPage);
    194195        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(GetPage),  rc), rc);
    195         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(ModifyPage),       &pModeData->pfnR0GstModifyPage);
     196        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(ModifyPage),       &pModeData->pfnR0GstModifyPage);
    196197        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(ModifyPage),  rc), rc);
    197         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(GetPDE),           &pModeData->pfnR0GstGetPDE);
     198        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(GetPDE),           &pModeData->pfnR0GstGetPDE);
    198199        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(GetPDE), rc), rc);
    199         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(MonitorCR3),       &pModeData->pfnR0GstMonitorCR3);
     200        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(MonitorCR3),       &pModeData->pfnR0GstMonitorCR3);
    200201        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(MonitorCR3), rc), rc);
    201         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(UnmonitorCR3),     &pModeData->pfnR0GstUnmonitorCR3);
     202        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(UnmonitorCR3),     &pModeData->pfnR0GstUnmonitorCR3);
    202203        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(UnmonitorCR3), rc), rc);
    203         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(MapCR3),           &pModeData->pfnR0GstMapCR3);
     204        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(MapCR3),           &pModeData->pfnR0GstMapCR3);
    204205        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(MapCR3), rc), rc);
    205         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(UnmapCR3),         &pModeData->pfnR0GstUnmapCR3);
     206        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(UnmapCR3),         &pModeData->pfnR0GstUnmapCR3);
    206207        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(UnmapCR3), rc), rc);
    207208#if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE
    208         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(WriteHandlerCR3),  &pModeData->pfnR0GstWriteHandlerCR3);
     209        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(WriteHandlerCR3),  &pModeData->pfnR0GstWriteHandlerCR3);
    209210        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(WriteHandlerCR3), rc), rc);
    210         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(WriteHandlerCR3),  &pModeData->pfnR0GstPAEWriteHandlerCR3);
    211         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(PAEWriteHandlerCR3), rc), rc);
     211        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_GST_NAME_R0_STR(WriteHandlerCR3),  &pModeData->pfnR0GstPAEWriteHandlerCR3);
     212        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(WriteHandlerCR3), rc), rc);
    212213#endif
    213214    }
     
    317318#endif /* 32BIT */
    318319
    319 
    320320#if PGM_GST_TYPE == PGM_TYPE_PAE
     321
    321322/**
    322323 * Physical write access handler for the Guest CR3 in PAE mode.
     
    443444}
    444445# endif
     446
    445447#endif /* PAE */
    446448
  • trunk/src/VBox/VMM/PGMHandler.cpp

    r13062 r13236  
    212212
    213213
    214 
    215214/**
    216215 * Register a access handler for a virtual range.
     
    221220 * @param   GCPtr           Start address.
    222221 * @param   GCPtrLast       Last address (inclusive).
    223  * @param   pfnInvalidateHC The HC invalidate callback (can be 0)
    224  * @param   pfnHandlerHC    The HC handler.
    225  * @param   pszHandlerGC    The GC handler symbol name.
    226  * @param   pszModGC        The GC handler module.
     222 * @param   pfnInvalidateR3 The R3 invalidate callback (can be 0)
     223 * @param   pfnHandlerR3    The R3 handler.
     224 * @param   pszHandlerRC    The RC handler symbol name.
     225 * @param   pszModRC        The RC handler module.
    227226 * @param   pszDesc         Pointer to description string. This must not be freed.
    228227 */
    229 /** @todo rename this function to PGMR3HandlerVirtualRegister */
    230228VMMR3DECL(int) PGMR3HandlerVirtualRegister(PVM pVM, PGMVIRTHANDLERTYPE enmType, RTGCPTR GCPtr, RTGCPTR GCPtrLast,
    231                                            PFNPGMR3VIRTINVALIDATE pfnInvalidateHC,
    232                                            PFNPGMR3VIRTHANDLER pfnHandlerHC,
    233                                            const char *pszHandlerGC, const char *pszModGC,
     229                                           PFNPGMR3VIRTINVALIDATE pfnInvalidateR3,
     230                                           PFNPGMR3VIRTHANDLER pfnHandlerR3,
     231                                           const char *pszHandlerRC, const char *pszModRC,
    234232                                           const char *pszDesc)
    235233{
    236     LogFlow(("PGMR3HandlerVirtualRegisterEx: enmType=%d GCPtr=%VGv GCPtrLast=%VGv pszHandlerGC=%p:{%s} pszModGC=%p:{%s} pszDesc=%s\n",
    237              enmType, GCPtr, GCPtrLast, pszHandlerGC, pszHandlerGC, pszModGC, pszModGC, pszDesc));
     234    LogFlow(("PGMR3HandlerVirtualRegisterEx: enmType=%d GCPtr=%VGv GCPtrLast=%VGv pszHandlerRC=%p:{%s} pszModRC=%p:{%s} pszDesc=%s\n",
     235             enmType, GCPtr, GCPtrLast, pszHandlerRC, pszHandlerRC, pszModRC, pszModRC, pszDesc));
    238236
    239237    /*
    240238     * Validate input.
    241239     */
    242     if (!pszModGC)
    243         pszModGC = VMMGC_MAIN_MODULE_NAME;
    244     if (!pszModGC || !*pszModGC || !pszHandlerGC || !*pszHandlerGC)
    245     {
    246         AssertMsgFailed(("pfnHandlerGC or/and pszModGC is missing\n"));
     240    if (!pszModRC)
     241        pszModRC = VMMGC_MAIN_MODULE_NAME;
     242    if (!pszModRC || !*pszModRC || !pszHandlerRC || !*pszHandlerRC)
     243    {
     244        AssertMsgFailed(("pfnHandlerGC or/and pszModRC is missing\n"));
    247245        return VERR_INVALID_PARAMETER;
    248246    }
     
    252250     */
    253251    RTGCPTR32 pfnHandlerGC;
    254     int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModGC, pszHandlerGC, &pfnHandlerGC);
     252    int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerGC);
    255253    if (VBOX_SUCCESS(rc))
    256         return PGMHandlerVirtualRegisterEx(pVM, enmType, GCPtr, GCPtrLast, pfnInvalidateHC, pfnHandlerHC, pfnHandlerGC, pszDesc);
    257 
    258     AssertMsgFailed(("Failed to resolve %s.%s, rc=%Vrc.\n", pszModGC, pszHandlerGC, rc));
     254        return PGMR3HandlerVirtualRegisterEx(pVM, enmType, GCPtr, GCPtrLast, pfnInvalidateR3, pfnHandlerR3, pfnHandlerGC, pszDesc);
     255
     256    AssertMsgFailed(("Failed to resolve %s.%s, rc=%Vrc.\n", pszModRC, pszHandlerRC, rc));
    259257    return rc;
    260258}
     
    275273 * @thread  EMT
    276274 */
    277 /** @todo rename this to PGMR3HandlerVirtualRegisterEx. */
    278275/** @todo create a template for virtual handlers (see async i/o), we're wasting space
    279276 * duplicating the function pointers now. (Or we will once we add the missing callbacks.) */
    280 VMMDECL(int) PGMHandlerVirtualRegisterEx(PVM pVM, PGMVIRTHANDLERTYPE enmType, RTGCPTR GCPtr, RTGCPTR GCPtrLast,
    281                                          R3PTRTYPE(PFNPGMR3VIRTINVALIDATE) pfnInvalidateR3,
    282                                          R3PTRTYPE(PFNPGMR3VIRTHANDLER) pfnHandlerR3,
    283                                          RCPTRTYPE(PFNPGMRCVIRTHANDLER) pfnHandlerRC,
    284                                          R3PTRTYPE(const char *) pszDesc)
     277VMMDECL(int) PGMR3HandlerVirtualRegisterEx(PVM pVM, PGMVIRTHANDLERTYPE enmType, RTGCPTR GCPtr, RTGCPTR GCPtrLast,
     278                                           R3PTRTYPE(PFNPGMR3VIRTINVALIDATE) pfnInvalidateR3,
     279                                           R3PTRTYPE(PFNPGMR3VIRTHANDLER) pfnHandlerR3,
     280                                           RCPTRTYPE(PFNPGMRCVIRTHANDLER) pfnHandlerRC,
     281                                           R3PTRTYPE(const char *) pszDesc)
    285282{
    286283    Log(("PGMR3HandlerVirtualRegister: enmType=%d GCPtr=%RGv GCPtrLast=%RGv pfnInvalidateR3=%RHv pfnHandlerR3=%RHv pfnHandlerRC=%RGv pszDesc=%s\n",
  • trunk/src/VBox/VMM/PGMInternal.h

    r13235 r13236  
    7676 * causes a lot of unnecessary extents and also is slower than taking more \#PFs.
    7777 */
    78 #define PGM_SYNC_NR_PAGES         8
     78#define PGM_SYNC_NR_PAGES               8
    7979
    8080/**
    8181 * Number of PGMPhysRead/Write cache entries (must be <= sizeof(uint64_t))
    8282 */
    83 #define PGM_MAX_PHYSCACHE_ENTRIES 64
    84 #define PGM_MAX_PHYSCACHE_ENTRIES_MASK (PGM_MAX_PHYSCACHE_ENTRIES-1)
     83#define PGM_MAX_PHYSCACHE_ENTRIES       64
     84#define PGM_MAX_PHYSCACHE_ENTRIES_MASK  (PGM_MAX_PHYSCACHE_ENTRIES-1)
    8585
    8686/**
     
    134134 * The maximum number of pages to add to the pool in one go.
    135135 */
    136 #define PGMPOOL_CFG_MAX_GROW    (_256K >> PAGE_SHIFT)
     136#define PGMPOOL_CFG_MAX_GROW            (_256K >> PAGE_SHIFT)
    137137
    138138/** @def VBOX_STRICT_PGM_HANDLER_VIRTUAL
     
    151151/** The entry is a permanent one and it's must always be present.
    152152 * Never free such an entry. */
    153 #define PGM_PLXFLAGS_PERMANENT      RT_BIT_64(10)
     153#define PGM_PLXFLAGS_PERMANENT          RT_BIT_64(10)
    154154/** Mapping (hypervisor allocated pagetable). */
    155 #define PGM_PLXFLAGS_MAPPING        RT_BIT_64(11)
     155#define PGM_PLXFLAGS_MAPPING            RT_BIT_64(11)
    156156/** @} */
    157157
     
    161161 * @{ */
    162162/** Mapping (hypervisor allocated pagetable). */
    163 #define PGM_PDFLAGS_MAPPING         RT_BIT_64(10)
     163#define PGM_PDFLAGS_MAPPING             RT_BIT_64(10)
    164164/** Made read-only to facilitate dirty bit tracking. */
    165 #define PGM_PDFLAGS_TRACK_DIRTY     RT_BIT_64(11)
     165#define PGM_PDFLAGS_TRACK_DIRTY         RT_BIT_64(11)
    166166/** @} */
    167167
     
    171171 * @{ */
    172172/** Made read-only to facilitate dirty bit tracking. */
    173 #define PGM_PTFLAGS_TRACK_DIRTY     RT_BIT_64(9)
     173#define PGM_PTFLAGS_TRACK_DIRTY         RT_BIT_64(9)
    174174
    175175#ifndef PGM_PTFLAGS_CSAM_VALIDATED
     
    177177 * NOTE: Must be identical to the one defined in CSAMInternal.h!!
    178178 * @todo Move PGM_PTFLAGS_* and PGM_PDFLAGS_* to VBox/pgm.h. */
    179 #define PGM_PTFLAGS_CSAM_VALIDATED  RT_BIT_64(11)
     179#define PGM_PTFLAGS_CSAM_VALIDATED      RT_BIT_64(11)
    180180#endif
    181181/** @} */
     
    183183/** @name Defines used to indicate the shadow and guest paging in the templates.
    184184 * @{ */
    185 #define PGM_TYPE_REAL       1
    186 #define PGM_TYPE_PROT       2
    187 #define PGM_TYPE_32BIT      3
    188 #define PGM_TYPE_PAE        4
    189 #define PGM_TYPE_AMD64      5
    190 #define PGM_TYPE_NESTED     6
    191 #define PGM_TYPE_EPT        7
    192 #define PGM_TYPE_MAX        PGM_TYPE_EPT
     185#define PGM_TYPE_REAL                   1
     186#define PGM_TYPE_PROT                   2
     187#define PGM_TYPE_32BIT                  3
     188#define PGM_TYPE_PAE                    4
     189#define PGM_TYPE_AMD64                  5
     190#define PGM_TYPE_NESTED                 6
     191#define PGM_TYPE_EPT                    7
     192#define PGM_TYPE_MAX                    PGM_TYPE_EPT
    193193/** @} */
    194194
     
    198198 * @remark  ASSUMES certain order of the PGM_TYPE_* values.
    199199 */
    200 #define PGM_WITH_PAGING(uGstType, uShwType)  ((uGstType) >= PGM_TYPE_32BIT && (uShwType) != PGM_TYPE_NESTED && (uShwType) != PGM_TYPE_EPT)
     200#define PGM_WITH_PAGING(uGstType, uShwType)  \
     201    (   (uGstType) >= PGM_TYPE_32BIT \
     202     && (uShwType) != PGM_TYPE_NESTED \
     203     && (uShwType) != PGM_TYPE_EPT)
    201204
    202205/** Macro for checking if the guest supports the NX bit.
     
    205208 * @remark  ASSUMES certain order of the PGM_TYPE_* values.
    206209 */
    207 #define PGM_WITH_NX(uGstType, uShwType)  ((uGstType) >= PGM_TYPE_PAE && (uShwType) != PGM_TYPE_NESTED && (uShwType) != PGM_TYPE_EPT)
     210#define PGM_WITH_NX(uGstType, uShwType)  \
     211    (   (uGstType) >= PGM_TYPE_PAE \
     212     && (uShwType) != PGM_TYPE_NESTED \
     213     && (uShwType) != PGM_TYPE_EPT)
    208214
    209215
     
    221227 */
    222228#if defined(IN_GC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    223 # define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) PGMDynMapHCPage(pVM, HCPhys, (void **)(ppv))
     229# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
     230     PGMDynMapHCPage(pVM, HCPhys, (void **)(ppv))
    224231#else
    225 # define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) MMPagePhys2PageEx(pVM, HCPhys, (void **)(ppv))
     232# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) \
     233     MMPagePhys2PageEx(pVM, HCPhys, (void **)(ppv))
    226234#endif
    227235
     
    239247 */
    240248#if defined(IN_GC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    241 # define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) PGMDynMapGCPage(pVM, GCPhys, (void **)(ppv))
     249# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \
     250     PGMDynMapGCPage(pVM, GCPhys, (void **)(ppv))
    242251#else
    243 # define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) PGMPhysGCPhys2HCPtr(pVM, GCPhys, 1 /* one page only */, (void **)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
     252# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) \
     253     PGMPhysGCPhys2HCPtr(pVM, GCPhys, 1 /* one page only */, (void **)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
    244254#endif
    245255
     
    257267 */
    258268#if defined(IN_GC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    259 # define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) PGMDynMapGCPageOff(pVM, GCPhys, (void **)(ppv))
     269# define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) \
     270     PGMDynMapGCPageOff(pVM, GCPhys, (void **)(ppv))
    260271#else
    261 # define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) PGMPhysGCPhys2HCPtr(pVM, GCPhys, 1 /* one page only */, (void **)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
     272# define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) \
     273     PGMPhysGCPhys2HCPtr(pVM, GCPhys, 1 /* one page only */, (void **)(ppv)) /** @todo this isn't asserting, use PGMRamGCPhys2HCPtr! */
    262274#endif
    263275
     
    268280 */
    269281#ifdef IN_GC
    270 # define PGM_INVL_PG(GCVirt)        ASMInvalidatePage((void *)(GCVirt))
     282# define PGM_INVL_PG(GCVirt)            ASMInvalidatePage((void *)(GCVirt))
    271283#elif defined(IN_RING0)
    272 # define PGM_INVL_PG(GCVirt)        HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))
     284# define PGM_INVL_PG(GCVirt)            HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))
    273285#else
    274 # define PGM_INVL_PG(GCVirt)        HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))
     286# define PGM_INVL_PG(GCVirt)            HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))
    275287#endif
    276288
     
    281293 */
    282294#ifdef IN_GC
    283 # define PGM_INVL_BIG_PG(GCVirt)    ASMReloadCR3()
     295# define PGM_INVL_BIG_PG(GCVirt)        ASMReloadCR3()
    284296#elif defined(IN_RING0)
    285 # define PGM_INVL_BIG_PG(GCVirt)    HWACCMFlushTLB(pVM)
     297# define PGM_INVL_BIG_PG(GCVirt)        HWACCMFlushTLB(pVM)
    286298#else
    287 # define PGM_INVL_BIG_PG(GCVirt)    HWACCMFlushTLB(pVM)
     299# define PGM_INVL_BIG_PG(GCVirt)        HWACCMFlushTLB(pVM)
    288300#endif
    289301
     
    292304 */
    293305#ifdef IN_GC
    294 # define PGM_INVL_GUEST_TLBS()      ASMReloadCR3()
     306# define PGM_INVL_GUEST_TLBS()          ASMReloadCR3()
    295307#elif defined(IN_RING0)
    296 # define PGM_INVL_GUEST_TLBS()      HWACCMFlushTLB(pVM)
     308# define PGM_INVL_GUEST_TLBS()          HWACCMFlushTLB(pVM)
    297309#else
    298 # define PGM_INVL_GUEST_TLBS()      HWACCMFlushTLB(pVM)
     310# define PGM_INVL_GUEST_TLBS()          HWACCMFlushTLB(pVM)
    299311#endif
    300312
     
    308320{
    309321    /** Pointer to next entry. */
    310     R3PTRTYPE(struct PGMMAPPING *)  pNextR3;
     322    R3PTRTYPE(struct PGMMAPPING *)      pNextR3;
    311323    /** Pointer to next entry. */
    312     R0PTRTYPE(struct PGMMAPPING *)  pNextR0;
     324    R0PTRTYPE(struct PGMMAPPING *)      pNextR0;
    313325    /** Pointer to next entry. */
    314     RCPTRTYPE(struct PGMMAPPING *)  pNextRC;
     326    RCPTRTYPE(struct PGMMAPPING *)      pNextRC;
    315327#if GC_ARCH_BITS == 64
    316     RTRCPTR                         padding0;
     328    RTRCPTR                             padding0;
    317329#endif
    318330    /** Start Virtual address. */
    319     RTGCUINTPTR                     GCPtr;
     331    RTGCUINTPTR                         GCPtr;
    320332    /** Last Virtual address (inclusive). */
    321     RTGCUINTPTR                     GCPtrLast;
     333    RTGCUINTPTR                         GCPtrLast;
    322334    /** Range size (bytes). */
    323     RTGCUINTPTR                     cb;
     335    RTGCUINTPTR                         cb;
    324336    /** Pointer to relocation callback function. */
    325     R3PTRTYPE(PFNPGMRELOCATE)       pfnRelocate;
     337    R3PTRTYPE(PFNPGMRELOCATE)           pfnRelocate;
    326338    /** User argument to the callback. */
    327     R3PTRTYPE(void *)               pvUser;
     339    R3PTRTYPE(void *)                   pvUser;
    328340    /** Mapping description / name. For easing debugging. */
    329     R3PTRTYPE(const char *)         pszDesc;
     341    R3PTRTYPE(const char *)             pszDesc;
    330342    /** Number of page tables. */
    331     RTUINT                          cPTs;
     343    RTUINT                              cPTs;
    332344#if HC_ARCH_BITS != GC_ARCH_BITS || GC_ARCH_BITS == 64
    333     RTUINT                          uPadding1; /**< Alignment padding. */
     345    RTUINT                              uPadding1; /**< Alignment padding. */
    334346#endif
    335347    /** Array of page table mapping data. Each entry
     
    340352    {
    341353        /** The HC physical address of the page table. */
    342         RTHCPHYS                HCPhysPT;
     354        RTHCPHYS                        HCPhysPT;
    343355        /** The HC physical address of the first PAE page table. */
    344         RTHCPHYS                HCPhysPaePT0;
     356        RTHCPHYS                        HCPhysPaePT0;
    345357        /** The HC physical address of the second PAE page table. */
    346         RTHCPHYS                HCPhysPaePT1;
     358        RTHCPHYS                        HCPhysPaePT1;
    347359        /** The HC virtual address of the 32-bit page table. */
    348         R3PTRTYPE(PX86PT)       pPTR3;
     360        R3PTRTYPE(PX86PT)               pPTR3;
    349361        /** The HC virtual address of the two PAE page table. (i.e 1024 entries instead of 512) */
    350         R3PTRTYPE(PX86PTPAE)    paPaePTsR3;
     362        R3PTRTYPE(PX86PTPAE)            paPaePTsR3;
    351363        /** The GC virtual address of the 32-bit page table. */
    352         RCPTRTYPE(PX86PT)       pPTRC;
     364        RCPTRTYPE(PX86PT)               pPTRC;
    353365        /** The GC virtual address of the two PAE page table. */
    354         RCPTRTYPE(PX86PTPAE)    paPaePTsRC;
     366        RCPTRTYPE(PX86PTPAE)            paPaePTsRC;
    355367        /** The GC virtual address of the 32-bit page table. */
    356         R0PTRTYPE(PX86PT)       pPTR0;
     368        R0PTRTYPE(PX86PT)               pPTR0;
    357369        /** The GC virtual address of the two PAE page table. */
    358         R0PTRTYPE(PX86PTPAE)    paPaePTsR0;
     370        R0PTRTYPE(PX86PTPAE)            paPaePTsR0;
    359371    } aPTs[1];
    360372} PGMMAPPING;
     
    710722#ifdef VBOX_WITH_NEW_PHYS_CODE
    711723#define PGM_PAGE_SET_TYPE(pPage, _enmType) \
    712                                         do { (pPage)->u3Type = (_enmType); } while (0)
     724    do { (pPage)->u3Type = (_enmType); } while (0)
    713725#else
    714726#define PGM_PAGE_SET_TYPE(pPage, _enmType) \
     
    838850 * @param   pPage       Pointer to the physical guest page tracking structure.
    839851 */
    840 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage)     ( (pPage)->u2HandlerVirtStateX )
     852#define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->u2HandlerVirtStateX )
    841853
    842854/**
     
    9911003{
    9921004    /** Pointer to the next range - R3. */
    993     R3PTRTYPE(struct PGMROMRANGE *) pNextR3;
     1005    R3PTRTYPE(struct PGMROMRANGE *)     pNextR3;
    9941006    /** Pointer to the next range - R0. */
    995     R0PTRTYPE(struct PGMROMRANGE *) pNextR0;
     1007    R0PTRTYPE(struct PGMROMRANGE *)     pNextR0;
    9961008    /** Pointer to the next range - RC. */
    997     RCPTRTYPE(struct PGMROMRANGE *) pNextRC;
     1009    RCPTRTYPE(struct PGMROMRANGE *)     pNextRC;
    9981010    /** Pointer alignment */
    999     RTRCPTR                         GCPtrAlignment;
     1011    RTRCPTR                             GCPtrAlignment;
    10001012    /** Address of the range. */
    1001     RTGCPHYS                        GCPhys;
     1013    RTGCPHYS                            GCPhys;
    10021014    /** Address of the last byte in the range. */
    1003     RTGCPHYS                        GCPhysLast;
     1015    RTGCPHYS                            GCPhysLast;
    10041016    /** Size of the range. */
    1005     RTGCPHYS                        cb;
     1017    RTGCPHYS                            cb;
    10061018    /** The flags (PGMPHYS_ROM_FLAG_*). */
    1007     uint32_t                        fFlags;
     1019    uint32_t                            fFlags;
    10081020    /** Alignment padding ensuring that aPages is sizeof(PGMROMPAGE) aligned. */
    1009     uint32_t                        au32Alignemnt[HC_ARCH_BITS == 32 ? 7 : 3];
     1021    uint32_t                            au32Alignemnt[HC_ARCH_BITS == 32 ? 7 : 3];
    10101022    /** Pointer to the original bits when PGMPHYS_ROM_FLAG_PERMANENT_BINARY was specified.
    10111023     * This is used for strictness checks. */
    1012     R3PTRTYPE(const void *)         pvOriginal;
     1024    R3PTRTYPE(const void *)             pvOriginal;
    10131025    /** The ROM description. */
    1014     R3PTRTYPE(const char *)         pszDesc;
     1026    R3PTRTYPE(const char *)             pszDesc;
    10151027    /** The per page tracking structures. */
    1016     PGMROMPAGE                      aPages[1];
     1028    PGMROMPAGE                          aPages[1];
    10171029} PGMROMRANGE;
    10181030/** Pointer to a ROM range. */
     
    10671079{
    10681080    /** R3 pointer to physical page. */
    1069     R3PTRTYPE(uint8_t *)            pbR3;
     1081    R3PTRTYPE(uint8_t *)                pbR3;
    10701082    /** GC Physical address for cache entry */
    1071     RTGCPHYS                        GCPhys;
     1083    RTGCPHYS                            GCPhys;
    10721084#if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32
    1073     RTGCPHYS                        u32Padding0; /**< alignment padding. */
     1085    RTGCPHYS                            u32Padding0; /**< alignment padding. */
    10741086#endif
    10751087} PGMPHYSCACHEENTRY;
     
    10811093{
    10821094    /** Bitmap of valid cache entries */
    1083     uint64_t                        aEntries;
     1095    uint64_t                            aEntries;
    10841096    /** Cache entries */
    1085     PGMPHYSCACHEENTRY               Entry[PGM_MAX_PHYSCACHE_ENTRIES];
     1097    PGMPHYSCACHEENTRY                   Entry[PGM_MAX_PHYSCACHE_ENTRIES];
    10861098} PGMPHYSCACHE;
    10871099
     
    11011113{
    11021114    /** The key is the chunk id. */
    1103     AVLU32NODECORE      Core;
     1115    AVLU32NODECORE                      Core;
    11041116    /** The key is the ageing sequence number. */
    1105     AVLLU32NODECORE     AgeCore;
     1117    AVLLU32NODECORE                     AgeCore;
    11061118    /** The current age thingy. */
    1107     uint32_t            iAge;
     1119    uint32_t                            iAge;
    11081120    /** The current reference count. */
    1109     uint32_t volatile   cRefs;
     1121    uint32_t volatile                   cRefs;
    11101122    /** The current permanent reference count. */
    1111     uint32_t volatile   cPermRefs;
     1123    uint32_t volatile                   cPermRefs;
    11121124    /** The mapping address. */
    1113     void               *pv;
     1125    void                               *pv;
    11141126} PGMCHUNKR3MAP;
    11151127
     
    11521164 *
    11531165 * @todo    Generalize this TLB + AVL stuff, shouldn't be all that
    1154  *          difficult when we switch to inlined AVL trees (from kStuff).
     1166 *          difficult when we switch to the new inlined AVL trees (from kStuff).
    11551167 */
    11561168typedef struct PGMCHUNKR3MAPTLB
     
    12501262 * Pointer to a page mapper unit pointer for current context. */
    12511263#ifdef IN_GC
    1252 // typedef PPGMPAGEGCMAPTLB       PPGMPAGEMAPTLB;
    1253 // typedef PPGMPAGEGCMAPTLBE      PPGMPAGEMAPTLBE;
    1254 // typedef PPGMPAGEGCMAPTLBE     *PPPGMPAGEMAPTLBE;
    1255 # define PGM_PAGEMAPTLB_ENTRIES     PGM_PAGEGCMAPTLB_ENTRIES
    1256 # define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGEGCMAPTLB_IDX(GCPhys)
    1257  typedef void *                 PPGMPAGEMAP;
    1258  typedef void **                PPPGMPAGEMAP;
     1264// typedef PPGMPAGEGCMAPTLB               PPGMPAGEMAPTLB;
     1265// typedef PPGMPAGEGCMAPTLBE              PPGMPAGEMAPTLBE;
     1266// typedef PPGMPAGEGCMAPTLBE             *PPPGMPAGEMAPTLBE;
     1267# define PGM_PAGEMAPTLB_ENTRIES         PGM_PAGEGCMAPTLB_ENTRIES
     1268# define PGM_PAGEMAPTLB_IDX(GCPhys)     PGM_PAGEGCMAPTLB_IDX(GCPhys)
     1269 typedef void *                         PPGMPAGEMAP;
     1270 typedef void **                        PPPGMPAGEMAP;
    12591271//#elif IN_RING0
    1260 // typedef PPGMPAGER0MAPTLB       PPGMPAGEMAPTLB;
    1261 // typedef PPGMPAGER0MAPTLBE      PPGMPAGEMAPTLBE;
    1262 // typedef PPGMPAGER0MAPTLBE     *PPPGMPAGEMAPTLBE;
    1263 //# define PGM_PAGEMAPTLB_ENTRIES     PGM_PAGER0MAPTLB_ENTRIES
    1264 //# define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGER0MAPTLB_IDX(GCPhys)
    1265 // typedef PPGMCHUNKR0MAP         PPGMPAGEMAP;
    1266 // typedef PPPGMCHUNKR0MAP        PPPGMPAGEMAP;
     1272// typedef PPGMPAGER0MAPTLB               PPGMPAGEMAPTLB;
     1273// typedef PPGMPAGER0MAPTLBE              PPGMPAGEMAPTLBE;
     1274// typedef PPGMPAGER0MAPTLBE             *PPPGMPAGEMAPTLBE;
     1275//# define PGM_PAGEMAPTLB_ENTRIES         PGM_PAGER0MAPTLB_ENTRIES
     1276//# define PGM_PAGEMAPTLB_IDX(GCPhys)     PGM_PAGER0MAPTLB_IDX(GCPhys)
     1277// typedef PPGMCHUNKR0MAP                 PPGMPAGEMAP;
     1278// typedef PPPGMCHUNKR0MAP                PPPGMPAGEMAP;
    12671279#else
    1268  typedef PPGMPAGER3MAPTLB       PPGMPAGEMAPTLB;
    1269  typedef PPGMPAGER3MAPTLBE      PPGMPAGEMAPTLBE;
    1270  typedef PPGMPAGER3MAPTLBE     *PPPGMPAGEMAPTLBE;
    1271 # define PGM_PAGEMAPTLB_ENTRIES     PGM_PAGER3MAPTLB_ENTRIES
    1272 # define PGM_PAGEMAPTLB_IDX(GCPhys) PGM_PAGER3MAPTLB_IDX(GCPhys)
    1273  typedef PPGMCHUNKR3MAP         PPGMPAGEMAP;
    1274  typedef PPPGMCHUNKR3MAP        PPPGMPAGEMAP;
     1280 typedef PPGMPAGER3MAPTLB               PPGMPAGEMAPTLB;
     1281 typedef PPGMPAGER3MAPTLBE              PPGMPAGEMAPTLBE;
     1282 typedef PPGMPAGER3MAPTLBE             *PPPGMPAGEMAPTLBE;
     1283# define PGM_PAGEMAPTLB_ENTRIES         PGM_PAGER3MAPTLB_ENTRIES
     1284# define PGM_PAGEMAPTLB_IDX(GCPhys)     PGM_PAGER3MAPTLB_IDX(GCPhys)
     1285 typedef PPGMCHUNKR3MAP                 PPGMPAGEMAP;
     1286 typedef PPPGMCHUNKR3MAP                PPPGMPAGEMAP;
    12751287#endif
    12761288/** @} */
     
    12811293 * @{ */
    12821294/** NIL page pool IDX. */
    1283 #define NIL_PGMPOOL_IDX         0
     1295#define NIL_PGMPOOL_IDX                 0
    12841296/** The first normal index. */
    1285 #define PGMPOOL_IDX_FIRST_SPECIAL 1
     1297#define PGMPOOL_IDX_FIRST_SPECIAL       1
    12861298/** Page directory (32-bit root). */
    1287 #define PGMPOOL_IDX_PD          1
     1299#define PGMPOOL_IDX_PD                  1
    12881300/** The extended PAE page directory (2048 entries, works as root currently). */
    1289 #define PGMPOOL_IDX_PAE_PD      2
     1301#define PGMPOOL_IDX_PAE_PD              2
    12901302/** PAE Page Directory Table 0. */
    1291 #define PGMPOOL_IDX_PAE_PD_0    3
     1303#define PGMPOOL_IDX_PAE_PD_0            3
    12921304/** PAE Page Directory Table 1. */
    1293 #define PGMPOOL_IDX_PAE_PD_1    4
     1305#define PGMPOOL_IDX_PAE_PD_1            4
    12941306/** PAE Page Directory Table 2. */
    1295 #define PGMPOOL_IDX_PAE_PD_2    5
     1307#define PGMPOOL_IDX_PAE_PD_2            5
    12961308/** PAE Page Directory Table 3. */
    1297 #define PGMPOOL_IDX_PAE_PD_3    6
     1309#define PGMPOOL_IDX_PAE_PD_3            6
    12981310/** Page Directory Pointer Table (PAE root, not currently used). */
    1299 #define PGMPOOL_IDX_PDPT        7
     1311#define PGMPOOL_IDX_PDPT                7
    13001312/** AMD64 CR3 level index.*/
    1301 #define PGMPOOL_IDX_AMD64_CR3   8
     1313#define PGMPOOL_IDX_AMD64_CR3           8
    13021314/** Nested paging root.*/
    1303 #define PGMPOOL_IDX_NESTED_ROOT 9
     1315#define PGMPOOL_IDX_NESTED_ROOT         9
    13041316/** The first normal index. */
    1305 #define PGMPOOL_IDX_FIRST       10
     1317#define PGMPOOL_IDX_FIRST               10
    13061318/** The last valid index. (inclusive, 14 bits) */
    1307 #define PGMPOOL_IDX_LAST        0x3fff
     1319#define PGMPOOL_IDX_LAST                0x3fff
    13081320/** @} */
    13091321
    13101322/** The NIL index for the parent chain. */
    1311 #define NIL_PGMPOOL_USER_INDEX  ((uint16_t)0xffff)
     1323#define NIL_PGMPOOL_USER_INDEX          ((uint16_t)0xffff)
    13121324
    13131325/**
     
    13291341
    13301342/** The NIL index for the phys ext chain. */
    1331 #define NIL_PGMPOOL_PHYSEXT_INDEX  ((uint16_t)0xffff)
     1343#define NIL_PGMPOOL_PHYSEXT_INDEX       ((uint16_t)0xffff)
    13321344
    13331345/**
     
    13561368    PGMPOOLKIND_FREE,
    13571369
    1358     /** Shw: 32-bit page table; Gst: no paging  */
     1370    /** Shw: 32-bit page table;     Gst: no paging  */
    13591371    PGMPOOLKIND_32BIT_PT_FOR_PHYS,
    1360     /** Shw: 32-bit page table; Gst: 32-bit page table.  */
     1372    /** Shw: 32-bit page table;     Gst: 32-bit page table.  */
    13611373    PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT,
    1362     /** Shw: 32-bit page table; Gst: 4MB page.  */
     1374    /** Shw: 32-bit page table;     Gst: 4MB page.  */
    13631375    PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB,
    1364     /** Shw: PAE page table; Gst: no paging  */
     1376    /** Shw: PAE page table;        Gst: no paging  */
    13651377    PGMPOOLKIND_PAE_PT_FOR_PHYS,
    1366     /** Shw: PAE page table;    Gst: 32-bit page table. */
     1378    /** Shw: PAE page table;        Gst: 32-bit page table. */
    13671379    PGMPOOLKIND_PAE_PT_FOR_32BIT_PT,
    1368     /** Shw: PAE page table;    Gst: Half of a 4MB page.  */
     1380    /** Shw: PAE page table;        Gst: Half of a 4MB page.  */
    13691381    PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB,
    1370     /** Shw: PAE page table;    Gst: PAE page table. */
     1382    /** Shw: PAE page table;        Gst: PAE page table. */
    13711383    PGMPOOLKIND_PAE_PT_FOR_PAE_PT,
    1372     /** Shw: PAE page table;    Gst: 2MB page.  */
     1384    /** Shw: PAE page table;        Gst: 2MB page.  */
    13731385    PGMPOOLKIND_PAE_PT_FOR_PAE_2MB,
    13741386
     
    13801392    /** Shw: 64-bit page directory pointer table;   Gst: 64-bit page directory pointer table. */
    13811393    PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT,
    1382     /** Shw: 64-bit page directory pointer table; Gst: no paging  */
     1394    /** Shw: 64-bit page directory pointer table;   Gst: no paging  */
    13831395    PGMPOOLKIND_64BIT_PDPT_FOR_PHYS,
    1384     /** Shw: 64-bit page directory table;   Gst: 64-bit page directory table. */
     1396    /** Shw: 64-bit page directory table;           Gst: 64-bit page directory table. */
    13851397    PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD,
    1386     /** Shw: 64-bit page directory table; Gst: no paging  */
     1398    /** Shw: 64-bit page directory table;           Gst: no paging  */
    13871399    PGMPOOLKIND_64BIT_PD_FOR_PHYS,
    13881400
    1389     /** Shw: 64-bit PML4;   Gst: 64-bit PML4. */
     1401    /** Shw: 64-bit PML4;                           Gst: 64-bit PML4. */
    13901402    PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4,
    13911403
    1392     /** Shw: EPT page directory pointer table; Gst: no paging  */
     1404    /** Shw: EPT page directory pointer table;      Gst: no paging  */
    13931405    PGMPOOLKIND_EPT_PDPT_FOR_PHYS,
    1394     /** Shw: EPT page directory table; Gst: no paging  */
     1406    /** Shw: EPT page directory table;              Gst: no paging  */
    13951407    PGMPOOLKIND_EPT_PD_FOR_PHYS,
    1396     /** Shw: EPT page table; Gst: no paging  */
     1408    /** Shw: EPT page table;                        Gst: no paging  */
    13971409    PGMPOOLKIND_EPT_PT_FOR_PHYS,
    13981410
     
    15031515{
    15041516    /** The VM handle - R3 Ptr. */
    1505     PVMR3           pVMR3;
     1517    PVMR3                       pVMR3;
    15061518    /** The VM handle - R0 Ptr. */
    1507     PVMR0           pVMR0;
     1519    PVMR0                       pVMR0;
    15081520    /** The VM handle - RC Ptr. */
    1509     PVMRC           pVMRC;
     1521    PVMRC                       pVMRC;
    15101522    /** The max pool size. This includes the special IDs.  */
    1511     uint16_t        cMaxPages;
     1523    uint16_t                    cMaxPages;
    15121524    /** The current pool size. */
    1513     uint16_t        cCurPages;
     1525    uint16_t                    cCurPages;
    15141526    /** The head of the free page list. */
    1515     uint16_t        iFreeHead;
     1527    uint16_t                    iFreeHead;
    15161528    /* Padding. */
    1517     uint16_t        u16Padding;
     1529    uint16_t                    u16Padding;
    15181530#ifdef PGMPOOL_WITH_USER_TRACKING
    15191531    /** Head of the chain of free user nodes. */
    1520     uint16_t        iUserFreeHead;
     1532    uint16_t                    iUserFreeHead;
    15211533    /** The number of user nodes we've allocated. */
    1522     uint16_t        cMaxUsers;
     1534    uint16_t                    cMaxUsers;
    15231535    /** The number of present page table entries in the entire pool. */
    1524     uint32_t        cPresent;
     1536    uint32_t                    cPresent;
    15251537    /** Pointer to the array of user nodes - RC pointer. */
    1526     RCPTRTYPE(PPGMPOOLUSER) paUsersRC;
     1538    RCPTRTYPE(PPGMPOOLUSER)     paUsersRC;
    15271539    /** Pointer to the array of user nodes - R3 pointer. */
    1528     R3PTRTYPE(PPGMPOOLUSER) paUsersR3;
     1540    R3PTRTYPE(PPGMPOOLUSER)     paUsersR3;
    15291541    /** Pointer to the array of user nodes - R0 pointer. */
    1530     R0PTRTYPE(PPGMPOOLUSER) paUsersR0;
     1542    R0PTRTYPE(PPGMPOOLUSER)     paUsersR0;
    15311543#endif /* PGMPOOL_WITH_USER_TRACKING */
    15321544#ifdef PGMPOOL_WITH_GCPHYS_TRACKING
    15331545    /** Head of the chain of free phys ext nodes. */
    1534     uint16_t        iPhysExtFreeHead;
     1546    uint16_t                    iPhysExtFreeHead;
    15351547    /** The number of user nodes we've allocated. */
    1536     uint16_t        cMaxPhysExts;
     1548    uint16_t                    cMaxPhysExts;
    15371549    /** Pointer to the array of physical xref extent - RC pointer. */
    1538     RCPTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsRC;
     1550    RCPTRTYPE(PPGMPOOLPHYSEXT)  paPhysExtsRC;
    15391551    /** Pointer to the array of physical xref extent nodes - R3 pointer. */
    1540     R3PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR3;
     1552    R3PTRTYPE(PPGMPOOLPHYSEXT)  paPhysExtsR3;
    15411553    /** Pointer to the array of physical xref extent nodes - R0 pointer. */
    1542     R0PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR0;
     1554    R0PTRTYPE(PPGMPOOLPHYSEXT)  paPhysExtsR0;
    15431555#endif /* PGMPOOL_WITH_GCPHYS_TRACKING */
    15441556#ifdef PGMPOOL_WITH_CACHE
    15451557    /** Hash table for GCPhys addresses. */
    1546     uint16_t        aiHash[PGMPOOL_HASH_SIZE];
     1558    uint16_t                    aiHash[PGMPOOL_HASH_SIZE];
    15471559    /** The head of the age list. */
    1548     uint16_t        iAgeHead;
     1560    uint16_t                    iAgeHead;
    15491561    /** The tail of the age list. */
    1550     uint16_t        iAgeTail;
     1562    uint16_t                    iAgeTail;
    15511563    /** Set if the cache is enabled. */
    1552     bool            fCacheEnabled;
     1564    bool                        fCacheEnabled;
    15531565#endif /* PGMPOOL_WITH_CACHE */
    15541566#ifdef PGMPOOL_WITH_MONITORING
    15551567    /** Head of the list of modified pages. */
    1556     uint16_t        iModifiedHead;
     1568    uint16_t                    iModifiedHead;
    15571569    /** The current number of modified pages. */
    1558     uint16_t        cModifiedPages;
     1570    uint16_t                    cModifiedPages;
    15591571    /** Access handler, RC. */
    15601572    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnAccessHandlerRC;
     
    15671579#endif /* PGMPOOL_WITH_MONITORING */
    15681580    /** The number of pages currently in use. */
    1569     uint16_t        cUsedPages;
     1581    uint16_t                    cUsedPages;
    15701582#ifdef VBOX_WITH_STATISTICS
    15711583    /** The high wather mark for cUsedPages. */
    1572     uint16_t        cUsedPagesHigh;
    1573     uint32_t        Alignment1;         /**< Align the next member on a 64-bit boundrary. */
     1584    uint16_t                    cUsedPagesHigh;
     1585    uint32_t                    Alignment1;         /**< Align the next member on a 64-bit boundrary. */
    15741586    /** Profiling pgmPoolAlloc(). */
    1575     STAMPROFILEADV  StatAlloc;
     1587    STAMPROFILEADV              StatAlloc;
    15761588    /** Profiling pgmPoolClearAll(). */
    1577     STAMPROFILE     StatClearAll;
     1589    STAMPROFILE                 StatClearAll;
    15781590    /** Profiling pgmPoolFlushAllInt(). */
    1579     STAMPROFILE     StatFlushAllInt;
     1591    STAMPROFILE                 StatFlushAllInt;
    15801592    /** Profiling pgmPoolFlushPage(). */
    1581     STAMPROFILE     StatFlushPage;
     1593    STAMPROFILE                 StatFlushPage;
    15821594    /** Profiling pgmPoolFree(). */
    1583     STAMPROFILE     StatFree;
     1595    STAMPROFILE                 StatFree;
    15841596    /** Profiling time spent zeroing pages. */
    1585     STAMPROFILE     StatZeroPage;
     1597    STAMPROFILE                 StatZeroPage;
    15861598# ifdef PGMPOOL_WITH_USER_TRACKING
    15871599    /** Profiling of pgmPoolTrackDeref. */
    1588     STAMPROFILE     StatTrackDeref;
     1600    STAMPROFILE                 StatTrackDeref;
    15891601    /** Profiling pgmTrackFlushGCPhysPT. */
    1590     STAMPROFILE     StatTrackFlushGCPhysPT;
     1602    STAMPROFILE                 StatTrackFlushGCPhysPT;
    15911603    /** Profiling pgmTrackFlushGCPhysPTs. */
    1592     STAMPROFILE     StatTrackFlushGCPhysPTs;
     1604    STAMPROFILE                 StatTrackFlushGCPhysPTs;
    15931605    /** Profiling pgmTrackFlushGCPhysPTsSlow. */
    1594     STAMPROFILE     StatTrackFlushGCPhysPTsSlow;
     1606    STAMPROFILE                 StatTrackFlushGCPhysPTsSlow;
    15951607    /** Number of times we've been out of user records. */
    1596     STAMCOUNTER     StatTrackFreeUpOneUser;
     1608    STAMCOUNTER                 StatTrackFreeUpOneUser;
    15971609# endif
    15981610# ifdef PGMPOOL_WITH_GCPHYS_TRACKING
    15991611    /** Profiling deref activity related tracking GC physical pages. */
    1600     STAMPROFILE     StatTrackDerefGCPhys;
     1612    STAMPROFILE                 StatTrackDerefGCPhys;
    16011613    /** Number of linear searches for a HCPhys in the ram ranges. */
    1602     STAMCOUNTER     StatTrackLinearRamSearches;
     1614    STAMCOUNTER                 StatTrackLinearRamSearches;
    16031615    /** The number of failing pgmPoolTrackPhysExtAlloc calls. */
    1604     STAMCOUNTER     StamTrackPhysExtAllocFailures;
     1616    STAMCOUNTER                 StamTrackPhysExtAllocFailures;
    16051617# endif
    16061618# ifdef PGMPOOL_WITH_MONITORING
    16071619    /** Profiling the RC/R0 access handler. */
    1608     STAMPROFILE     StatMonitorRZ;
     1620    STAMPROFILE                 StatMonitorRZ;
    16091621    /** Times we've failed interpreting the instruction. */
    1610     STAMCOUNTER     StatMonitorRZEmulateInstr;
     1622    STAMCOUNTER                 StatMonitorRZEmulateInstr;
    16111623    /** Profiling the pgmPoolFlushPage calls made from the RC/R0 access handler. */
    1612     STAMPROFILE     StatMonitorRZFlushPage;
     1624    STAMPROFILE                 StatMonitorRZFlushPage;
    16131625    /** Times we've detected fork(). */
    1614     STAMCOUNTER     StatMonitorRZFork;
     1626    STAMCOUNTER                 StatMonitorRZFork;
    16151627    /** Profiling the RC/R0 access we've handled (except REP STOSD). */
    1616     STAMPROFILE     StatMonitorRZHandled;
     1628    STAMPROFILE                 StatMonitorRZHandled;
    16171629    /** Times we've failed interpreting a patch code instruction. */
    1618     STAMCOUNTER     StatMonitorRZIntrFailPatch1;
     1630    STAMCOUNTER                 StatMonitorRZIntrFailPatch1;
    16191631    /** Times we've failed interpreting a patch code instruction during flushing. */
    1620     STAMCOUNTER     StatMonitorRZIntrFailPatch2;
     1632    STAMCOUNTER                 StatMonitorRZIntrFailPatch2;
    16211633    /** The number of times we've seen rep prefixes we can't handle. */
    1622     STAMCOUNTER     StatMonitorRZRepPrefix;
     1634    STAMCOUNTER                 StatMonitorRZRepPrefix;
    16231635    /** Profiling the REP STOSD cases we've handled. */
    1624     STAMPROFILE     StatMonitorRZRepStosd;
     1636    STAMPROFILE                 StatMonitorRZRepStosd;
    16251637
    16261638    /** Profiling the R3 access handler. */
    1627     STAMPROFILE     StatMonitorR3;
     1639    STAMPROFILE                 StatMonitorR3;
    16281640    /** Times we've failed interpreting the instruction. */
    1629     STAMCOUNTER     StatMonitorR3EmulateInstr;
     1641    STAMCOUNTER                 StatMonitorR3EmulateInstr;
    16301642    /** Profiling the pgmPoolFlushPage calls made from the R3 access handler. */
    1631     STAMPROFILE     StatMonitorR3FlushPage;
     1643    STAMPROFILE                 StatMonitorR3FlushPage;
    16321644    /** Times we've detected fork(). */
    1633     STAMCOUNTER     StatMonitorR3Fork;
     1645    STAMCOUNTER                 StatMonitorR3Fork;
    16341646    /** Profiling the R3 access we've handled (except REP STOSD). */
    1635     STAMPROFILE     StatMonitorR3Handled;
     1647    STAMPROFILE                 StatMonitorR3Handled;
    16361648    /** The number of times we've seen rep prefixes we can't handle. */
    1637     STAMCOUNTER     StatMonitorR3RepPrefix;
     1649    STAMCOUNTER                 StatMonitorR3RepPrefix;
    16381650    /** Profiling the REP STOSD cases we've handled. */
    1639     STAMPROFILE     StatMonitorR3RepStosd;
     1651    STAMPROFILE                 StatMonitorR3RepStosd;
    16401652    /** The number of times we're called in an async thread an need to flush. */
    1641     STAMCOUNTER     StatMonitorR3Async;
     1653    STAMCOUNTER                 StatMonitorR3Async;
    16421654    /** The high wather mark for cModifiedPages. */
    1643     uint16_t        cModifiedPagesHigh;
    1644     uint16_t        Alignment2[3];      /**< Align the next member on a 64-bit boundrary. */
     1655    uint16_t                    cModifiedPagesHigh;
     1656    uint16_t                    Alignment2[3];      /**< Align the next member on a 64-bit boundrary. */
    16451657# endif
    16461658# ifdef PGMPOOL_WITH_CACHE
    16471659    /** The number of cache hits. */
    1648     STAMCOUNTER     StatCacheHits;
     1660    STAMCOUNTER                 StatCacheHits;
    16491661    /** The number of cache misses. */
    1650     STAMCOUNTER     StatCacheMisses;
     1662    STAMCOUNTER                 StatCacheMisses;
    16511663    /** The number of times we've got a conflict of 'kind' in the cache. */
    1652     STAMCOUNTER     StatCacheKindMismatches;
     1664    STAMCOUNTER                 StatCacheKindMismatches;
    16531665    /** Number of times we've been out of pages. */
    1654     STAMCOUNTER     StatCacheFreeUpOne;
     1666    STAMCOUNTER                 StatCacheFreeUpOne;
    16551667    /** The number of cacheable allocations. */
    1656     STAMCOUNTER     StatCacheCacheable;
     1668    STAMCOUNTER                 StatCacheCacheable;
    16571669    /** The number of uncacheable allocations. */
    1658     STAMCOUNTER     StatCacheUncacheable;
     1670    STAMCOUNTER                 StatCacheUncacheable;
    16591671# endif
    16601672#elif HC_ARCH_BITS == 64
    1661     uint32_t        Alignment3;         /**< Align the next member on a 64-bit boundrary. */
     1673    uint32_t                    Alignment3;         /**< Align the next member on a 64-bit boundrary. */
    16621674#endif
    16631675    /** The AVL tree for looking up a page by its HC physical address. */
    1664     AVLOHCPHYSTREE  HCPhysTree;
    1665     uint32_t        Alignment4;         /**< Align the next member on a 64-bit boundrary. */
     1676    AVLOHCPHYSTREE              HCPhysTree;
     1677    uint32_t                    Alignment4;         /**< Align the next member on a 64-bit boundrary. */
    16661678    /** Array of pages. (cMaxPages in length)
    16671679     * The Id is the index into thist array.
    16681680     */
    1669     PGMPOOLPAGE     aPages[PGMPOOL_IDX_FIRST];
     1681    PGMPOOLPAGE                 aPages[PGMPOOL_IDX_FIRST];
    16701682} PGMPOOL, *PPGMPOOL, **PPPGMPOOL;
    16711683
     
    18321844{
    18331845    /** The guest mode type. */
    1834     uint32_t    uGstType;
     1846    uint32_t                        uGstType;
    18351847    /** The shadow mode type. */
    1836     uint32_t    uShwType;
     1848    uint32_t                        uShwType;
    18371849
    18381850    /** @name Function pointers for Shadow paging.
    18391851     * @{
    18401852     */
    1841     DECLR3CALLBACKMEMBER(int,  pfnR3ShwRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    1842     DECLR3CALLBACKMEMBER(int,  pfnR3ShwExit,(PVM pVM));
    1843     DECLR3CALLBACKMEMBER(int,  pfnR3ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    1844     DECLR3CALLBACKMEMBER(int,  pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1845 
    1846     DECLRCCALLBACKMEMBER(int,  pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    1847     DECLRCCALLBACKMEMBER(int,  pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1848 
    1849     DECLR0CALLBACKMEMBER(int,  pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    1850     DECLR0CALLBACKMEMBER(int,  pfnR0ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1853    DECLR3CALLBACKMEMBER(int,       pfnR3ShwRelocate,(PVM pVM, RTGCUINTPTR offDelta));
     1854    DECLR3CALLBACKMEMBER(int,       pfnR3ShwExit,(PVM pVM));
     1855    DECLR3CALLBACKMEMBER(int,       pfnR3ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     1856    DECLR3CALLBACKMEMBER(int,       pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1857
     1858    DECLRCCALLBACKMEMBER(int,       pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     1859    DECLRCCALLBACKMEMBER(int,       pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1860
     1861    DECLR0CALLBACKMEMBER(int,       pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     1862    DECLR0CALLBACKMEMBER(int,       pfnR0ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    18511863    /** @} */
    18521864
     
    18541866     * @{
    18551867     */
    1856     DECLR3CALLBACKMEMBER(int,  pfnR3GstRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    1857     DECLR3CALLBACKMEMBER(int,  pfnR3GstExit,(PVM pVM));
    1858     DECLR3CALLBACKMEMBER(int,  pfnR3GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    1859     DECLR3CALLBACKMEMBER(int,  pfnR3GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1860     DECLR3CALLBACKMEMBER(int,  pfnR3GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    1861     DECLR3CALLBACKMEMBER(int,  pfnR3GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1862     DECLR3CALLBACKMEMBER(int,  pfnR3GstUnmonitorCR3,(PVM pVM));
    1863     DECLR3CALLBACKMEMBER(int,  pfnR3GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1864     DECLR3CALLBACKMEMBER(int,  pfnR3GstUnmapCR3,(PVM pVM));
     1868    DECLR3CALLBACKMEMBER(int,       pfnR3GstRelocate,(PVM pVM, RTGCUINTPTR offDelta));
     1869    DECLR3CALLBACKMEMBER(int,       pfnR3GstExit,(PVM pVM));
     1870    DECLR3CALLBACKMEMBER(int,       pfnR3GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     1871    DECLR3CALLBACKMEMBER(int,       pfnR3GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1872    DECLR3CALLBACKMEMBER(int,       pfnR3GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     1873    DECLR3CALLBACKMEMBER(int,       pfnR3GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1874    DECLR3CALLBACKMEMBER(int,       pfnR3GstUnmonitorCR3,(PVM pVM));
     1875    DECLR3CALLBACKMEMBER(int,       pfnR3GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1876    DECLR3CALLBACKMEMBER(int,       pfnR3GstUnmapCR3,(PVM pVM));
    18651877    R3PTRTYPE(PFNPGMR3PHYSHANDLER)  pfnR3GstWriteHandlerCR3;
    18661878    R3PTRTYPE(const char *)         pszR3GstWriteHandlerCR3;
     
    18681880    R3PTRTYPE(const char *)         pszR3GstPAEWriteHandlerCR3;
    18691881
    1870     DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    1871     DECLRCCALLBACKMEMBER(int,  pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1872     DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    1873     DECLRCCALLBACKMEMBER(int,  pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1874     DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmonitorCR3,(PVM pVM));
    1875     DECLRCCALLBACKMEMBER(int,  pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1876     DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmapCR3,(PVM pVM));
     1882    DECLRCCALLBACKMEMBER(int,       pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     1883    DECLRCCALLBACKMEMBER(int,       pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1884    DECLRCCALLBACKMEMBER(int,       pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     1885    DECLRCCALLBACKMEMBER(int,       pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1886    DECLRCCALLBACKMEMBER(int,       pfnRCGstUnmonitorCR3,(PVM pVM));
     1887    DECLRCCALLBACKMEMBER(int,       pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1888    DECLRCCALLBACKMEMBER(int,       pfnRCGstUnmapCR3,(PVM pVM));
    18771889    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstWriteHandlerCR3;
    18781890    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstPAEWriteHandlerCR3;
    18791891
    1880     DECLR0CALLBACKMEMBER(int,  pfnR0GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    1881     DECLR0CALLBACKMEMBER(int,  pfnR0GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    1882     DECLR0CALLBACKMEMBER(int,  pfnR0GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    1883     DECLR0CALLBACKMEMBER(int,  pfnR0GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1884     DECLR0CALLBACKMEMBER(int,  pfnR0GstUnmonitorCR3,(PVM pVM));
    1885     DECLR0CALLBACKMEMBER(int,  pfnR0GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    1886     DECLR0CALLBACKMEMBER(int,  pfnR0GstUnmapCR3,(PVM pVM));
     1892    DECLR0CALLBACKMEMBER(int,       pfnR0GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     1893    DECLR0CALLBACKMEMBER(int,       pfnR0GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     1894    DECLR0CALLBACKMEMBER(int,       pfnR0GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     1895    DECLR0CALLBACKMEMBER(int,       pfnR0GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1896    DECLR0CALLBACKMEMBER(int,       pfnR0GstUnmonitorCR3,(PVM pVM));
     1897    DECLR0CALLBACKMEMBER(int,       pfnR0GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     1898    DECLR0CALLBACKMEMBER(int,       pfnR0GstUnmapCR3,(PVM pVM));
    18871899    R0PTRTYPE(PFNPGMRCPHYSHANDLER)  pfnR0GstWriteHandlerCR3;
    18881900    R0PTRTYPE(PFNPGMRCPHYSHANDLER)  pfnR0GstPAEWriteHandlerCR3;
     
    19401952{
    19411953    /** Offset to the VM structure. */
    1942     RTINT                       offVM;
     1954    RTINT                           offVM;
    19431955
    19441956    /*
     
    19521964
    19531965    /** Pointer to the page table entries for the dynamic page mapping area - GCPtr. */
    1954     RCPTRTYPE(PX86PTE)          paDynPageMap32BitPTEsGC;
     1966    RCPTRTYPE(PX86PTE)              paDynPageMap32BitPTEsGC;
    19551967    /** Pointer to the page table entries for the dynamic page mapping area - GCPtr. */
    1956     RCPTRTYPE(PX86PTEPAE)       paDynPageMapPaePTEsGC;
     1968    RCPTRTYPE(PX86PTEPAE)           paDynPageMapPaePTEsGC;
    19571969
    19581970    /** The host paging mode. (This is what SUPLib reports.) */
    1959     SUPPAGINGMODE               enmHostMode;
     1971    SUPPAGINGMODE                   enmHostMode;
    19601972    /** The shadow paging mode. */
    1961     PGMMODE                     enmShadowMode;
     1973    PGMMODE                         enmShadowMode;
    19621974    /** The guest paging mode. */
    1963     PGMMODE                     enmGuestMode;
     1975    PGMMODE                         enmGuestMode;
    19641976
    19651977    /** The current physical address representing in the guest CR3 register. */
    1966     RTGCPHYS                    GCPhysCR3;
     1978    RTGCPHYS                        GCPhysCR3;
    19671979    /** Pointer to the 5 page CR3 content mapping.
    19681980     * The first page is always the CR3 (in some form) while the 4 other pages
    19691981     * are used of the PDs in PAE mode. */
    1970     RTGCPTR                     GCPtrCR3Mapping;
     1982    RTGCPTR                         GCPtrCR3Mapping;
    19711983#if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32
    1972     uint32_t                    u32Alignment;
     1984    uint32_t                        u32Alignment;
    19731985#endif
    19741986    /** The physical address of the currently monitored guest CR3 page.
    19751987     * When this value is NIL_RTGCPHYS no page is being monitored. */
    1976     RTGCPHYS                    GCPhysGstCR3Monitored;
     1988    RTGCPHYS                        GCPhysGstCR3Monitored;
    19771989
    19781990    /** @name 32-bit Guest Paging.
     
    19801992    /** The guest's page directory, HC pointer. */
    19811993#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    1982     R3PTRTYPE(PX86PD)           pGuestPDHC;
     1994    R3PTRTYPE(PX86PD)               pGuestPDHC;
    19831995#else
    1984     R3R0PTRTYPE(PX86PD)         pGuestPDHC;
     1996    R3R0PTRTYPE(PX86PD)             pGuestPDHC;
    19851997#endif
    19861998    /** The guest's page directory, static GC mapping. */
    1987     RCPTRTYPE(PX86PD)           pGuestPDGC;
     1999    RCPTRTYPE(PX86PD)               pGuestPDGC;
    19882000    /** @} */
    19892001
     
    19912003     * @{ */
    19922004    /** The guest's page directory pointer table, static GC mapping. */
    1993     RCPTRTYPE(PX86PDPT)         pGstPaePDPTGC;
     2005    RCPTRTYPE(PX86PDPT)             pGstPaePDPTGC;
    19942006    /** The guest's page directory pointer table, HC pointer. */
    19952007#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    1996     R3PTRTYPE(PX86PDPT)         pGstPaePDPTHC;
     2008    R3PTRTYPE(PX86PDPT)             pGstPaePDPTHC;
    19972009#else
    1998     R3R0PTRTYPE(PX86PDPT)       pGstPaePDPTHC;
     2010    R3R0PTRTYPE(PX86PDPT)           pGstPaePDPTHC;
    19992011#endif
    20002012    /** The guest's page directories, HC pointers.
     
    20022014     * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */
    20032015#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2004     R3PTRTYPE(PX86PDPAE)        apGstPaePDsHC[4];
     2016    R3PTRTYPE(PX86PDPAE)            apGstPaePDsHC[4];
    20052017#else
    2006     R3R0PTRTYPE(PX86PDPAE)      apGstPaePDsHC[4];
     2018    R3R0PTRTYPE(PX86PDPAE)          apGstPaePDsHC[4];
    20072019#endif
    20082020    /** The guest's page directories, static GC mapping.
    20092021     * Unlike the HC array the first entry can be accessed as a 2048 entry PD.
    20102022     * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */
    2011     RCPTRTYPE(PX86PDPAE)        apGstPaePDsGC[4];
     2023    RCPTRTYPE(PX86PDPAE)            apGstPaePDsGC[4];
    20122024    /** The physical addresses of the guest page directories (PAE) pointed to by apGstPagePDsHC/GC. */
    2013     RTGCPHYS                    aGCPhysGstPaePDs[4];
     2025    RTGCPHYS                        aGCPhysGstPaePDs[4];
    20142026    /** The physical addresses of the monitored guest page directories (PAE). */
    2015     RTGCPHYS                    aGCPhysGstPaePDsMonitored[4];
     2027    RTGCPHYS                        aGCPhysGstPaePDsMonitored[4];
    20162028    /** @} */
    20172029
     
    20202032    /** The guest's page directory pointer table, HC pointer. */
    20212033#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2022     R3R0PTRTYPE(PX86PML4)       pGstPaePML4HC;
     2034    R3R0PTRTYPE(PX86PML4)           pGstPaePML4HC;
    20232035#else
    2024     R3R0PTRTYPE(PX86PML4)       pGstPaePML4HC;
     2036    R3R0PTRTYPE(PX86PML4)           pGstPaePML4HC;
    20252037#endif
    20262038    /** @} */
     
    20302042    /** The 32-Bit PD - HC Ptr. */
    20312043#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2032     R3PTRTYPE(PX86PD)           pHC32BitPD;
     2044    R3PTRTYPE(PX86PD)               pHC32BitPD;
    20332045#else
    2034     R3R0PTRTYPE(PX86PD)         pHC32BitPD;
     2046    R3R0PTRTYPE(PX86PD)             pHC32BitPD;
    20352047#endif
    20362048    /** The 32-Bit PD - GC Ptr. */
    2037     RCPTRTYPE(PX86PD)           pGC32BitPD;
     2049    RCPTRTYPE(PX86PD)               pGC32BitPD;
    20382050#if HC_ARCH_BITS == 64
    2039     uint32_t                    u32Padding1; /**< alignment padding. */
     2051    uint32_t                        u32Padding1; /**< alignment padding. */
    20402052#endif
    20412053    /** The Physical Address (HC) of the 32-Bit PD. */
    2042     RTHCPHYS                    HCPhys32BitPD;
     2054    RTHCPHYS                        HCPhys32BitPD;
    20432055    /** @} */
    20442056
     
    20492061     * Thus, it's possible to walk the 2048 entries starting where apHCPaePDs[0] points. */
    20502062#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2051     R3PTRTYPE(PX86PDPAE)        apHCPaePDs[4];
     2063    R3PTRTYPE(PX86PDPAE)            apHCPaePDs[4];
    20522064#else
    2053     R3R0PTRTYPE(PX86PDPAE)      apHCPaePDs[4];
     2065    R3R0PTRTYPE(PX86PDPAE)          apHCPaePDs[4];
    20542066#endif
    20552067    /** The four PDs for the low 4GB - GC Ptr.
    20562068     * Same kind of mapping as apHCPaePDs. */
    2057     RCPTRTYPE(PX86PDPAE)        apGCPaePDs[4];
     2069    RCPTRTYPE(PX86PDPAE)            apGCPaePDs[4];
    20582070    /** The Physical Address (HC) of the four PDs for the low 4GB.
    20592071     * These are *NOT* 4 contiguous pages. */
    2060     RTHCPHYS                    aHCPhysPaePDs[4];
     2072    RTHCPHYS                        aHCPhysPaePDs[4];
    20612073    /** The PAE PDP - HC Ptr. */
    2062     R3R0PTRTYPE(PX86PDPT)       pHCPaePDPT;
     2074    R3R0PTRTYPE(PX86PDPT)           pHCPaePDPT;
    20632075    /** The Physical Address (HC) of the PAE PDPT. */
    2064     RTHCPHYS                    HCPhysPaePDPT;
     2076    RTHCPHYS                        HCPhysPaePDPT;
    20652077    /** The PAE PDPT - GC Ptr. */
    2066     RCPTRTYPE(PX86PDPT)         pGCPaePDPT;
     2078    RCPTRTYPE(PX86PDPT)             pGCPaePDPT;
    20672079    /** @} */
    20682080
     
    20712083     * @{ */
    20722084#if HC_ARCH_BITS == 64
    2073     RTRCPTR                    alignment5; /**< structure size alignment. */
     2085    RTRCPTR                         alignment5; /**< structure size alignment. */
    20742086#endif
    20752087    /** The Page Map Level 4 table - HC Ptr. */
    20762088#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2077     R3PTRTYPE(PX86PML4)         pHCPaePML4;
     2089    R3PTRTYPE(PX86PML4)             pHCPaePML4;
    20782090#else
    2079     R3R0PTRTYPE(PX86PML4)       pHCPaePML4;
     2091    R3R0PTRTYPE(PX86PML4)           pHCPaePML4;
    20802092#endif
    20812093    /** The Physical Address (HC) of the Page Map Level 4 table. */
    2082     RTHCPHYS                    HCPhysPaePML4;
     2094    RTHCPHYS                        HCPhysPaePML4;
    20832095    /** The pgm pool page descriptor for the current active CR3. */
    20842096#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2085     R3PTRTYPE(PPGMPOOLPAGE)     pHCShwAmd64CR3;
     2097    R3PTRTYPE(PPGMPOOLPAGE)         pHCShwAmd64CR3;
    20862098#else
    2087     R3R0PTRTYPE(PPGMPOOLPAGE)   pHCShwAmd64CR3;
     2099    R3R0PTRTYPE(PPGMPOOLPAGE)       pHCShwAmd64CR3;
    20882100#endif
    20892101
     
    20942106    /** Root table; format depends on the host paging mode (AMD-V) or EPT */
    20952107#if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE
    2096     R3PTRTYPE(void *)           pHCNestedRoot;
     2108    R3PTRTYPE(void *)               pHCNestedRoot;
    20972109#else
    2098     R3R0PTRTYPE(void *)         pHCNestedRoot;
     2110    R3R0PTRTYPE(void *)             pHCNestedRoot;
    20992111#endif
    21002112    /** The Physical Address (HC) of the nested paging root. */
    2101     RTHCPHYS                    HCPhysNestedRoot;
     2113    RTHCPHYS                        HCPhysNestedRoot;
    21022114
    21032115    /** @name Function pointers for Shadow paging.
    21042116     * @{
    21052117     */
    2106     DECLR3CALLBACKMEMBER(int,  pfnR3ShwRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    2107     DECLR3CALLBACKMEMBER(int,  pfnR3ShwExit,(PVM pVM));
    2108     DECLR3CALLBACKMEMBER(int,  pfnR3ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    2109     DECLR3CALLBACKMEMBER(int,  pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2110 
    2111     DECLRCCALLBACKMEMBER(int,  pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    2112     DECLRCCALLBACKMEMBER(int,  pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2113 
    2114     DECLR0CALLBACKMEMBER(int,  pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
    2115     DECLR0CALLBACKMEMBER(int,  pfnR0ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2118    DECLR3CALLBACKMEMBER(int,       pfnR3ShwRelocate,(PVM pVM, RTGCUINTPTR offDelta));
     2119    DECLR3CALLBACKMEMBER(int,       pfnR3ShwExit,(PVM pVM));
     2120    DECLR3CALLBACKMEMBER(int,       pfnR3ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     2121    DECLR3CALLBACKMEMBER(int,       pfnR3ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2122
     2123    DECLRCCALLBACKMEMBER(int,       pfnRCShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     2124    DECLRCCALLBACKMEMBER(int,       pfnRCShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2125
     2126    DECLR0CALLBACKMEMBER(int,       pfnR0ShwGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));
     2127    DECLR0CALLBACKMEMBER(int,       pfnR0ShwModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    21162128
    21172129    /** @} */
     
    21202132     * @{
    21212133     */
    2122     DECLR3CALLBACKMEMBER(int,  pfnR3GstRelocate,(PVM pVM, RTGCUINTPTR offDelta));
    2123     DECLR3CALLBACKMEMBER(int,  pfnR3GstExit,(PVM pVM));
    2124     DECLR3CALLBACKMEMBER(int,  pfnR3GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    2125     DECLR3CALLBACKMEMBER(int,  pfnR3GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2126     DECLR3CALLBACKMEMBER(int,  pfnR3GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    2127     DECLR3CALLBACKMEMBER(int,  pfnR3GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2128     DECLR3CALLBACKMEMBER(int,  pfnR3GstUnmonitorCR3,(PVM pVM));
    2129     DECLR3CALLBACKMEMBER(int,  pfnR3GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2130     DECLR3CALLBACKMEMBER(int,  pfnR3GstUnmapCR3,(PVM pVM));
     2134    DECLR3CALLBACKMEMBER(int,       pfnR3GstRelocate,(PVM pVM, RTGCUINTPTR offDelta));
     2135    DECLR3CALLBACKMEMBER(int,       pfnR3GstExit,(PVM pVM));
     2136    DECLR3CALLBACKMEMBER(int,       pfnR3GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     2137    DECLR3CALLBACKMEMBER(int,       pfnR3GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2138    DECLR3CALLBACKMEMBER(int,       pfnR3GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     2139    DECLR3CALLBACKMEMBER(int,       pfnR3GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2140    DECLR3CALLBACKMEMBER(int,       pfnR3GstUnmonitorCR3,(PVM pVM));
     2141    DECLR3CALLBACKMEMBER(int,       pfnR3GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2142    DECLR3CALLBACKMEMBER(int,       pfnR3GstUnmapCR3,(PVM pVM));
    21312143    R3PTRTYPE(PFNPGMR3PHYSHANDLER)  pfnR3GstWriteHandlerCR3;
    21322144    R3PTRTYPE(const char *)         pszR3GstWriteHandlerCR3;
     
    21342146    R3PTRTYPE(const char *)         pszR3GstPAEWriteHandlerCR3;
    21352147
    2136     DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    2137     DECLRCCALLBACKMEMBER(int,  pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2138     DECLRCCALLBACKMEMBER(int,  pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    2139     DECLRCCALLBACKMEMBER(int,  pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2140     DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmonitorCR3,(PVM pVM));
    2141     DECLRCCALLBACKMEMBER(int,  pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2142     DECLRCCALLBACKMEMBER(int,  pfnRCGstUnmapCR3,(PVM pVM));
     2148    DECLRCCALLBACKMEMBER(int,       pfnRCGstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     2149    DECLRCCALLBACKMEMBER(int,       pfnRCGstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2150    DECLRCCALLBACKMEMBER(int,       pfnRCGstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     2151    DECLRCCALLBACKMEMBER(int,       pfnRCGstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2152    DECLRCCALLBACKMEMBER(int,       pfnRCGstUnmonitorCR3,(PVM pVM));
     2153    DECLRCCALLBACKMEMBER(int,       pfnRCGstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2154    DECLRCCALLBACKMEMBER(int,       pfnRCGstUnmapCR3,(PVM pVM));
    21432155    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstWriteHandlerCR3;
    21442156    RCPTRTYPE(PFNPGMRCPHYSHANDLER)  pfnRCGstPAEWriteHandlerCR3;
     
    21472159#endif
    21482160
    2149     DECLR0CALLBACKMEMBER(int,  pfnR0GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
    2150     DECLR0CALLBACKMEMBER(int,  pfnR0GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
    2151     DECLR0CALLBACKMEMBER(int,  pfnR0GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
    2152     DECLR0CALLBACKMEMBER(int,  pfnR0GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2153     DECLR0CALLBACKMEMBER(int,  pfnR0GstUnmonitorCR3,(PVM pVM));
    2154     DECLR0CALLBACKMEMBER(int,  pfnR0GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
    2155     DECLR0CALLBACKMEMBER(int,  pfnR0GstUnmapCR3,(PVM pVM));
     2161    DECLR0CALLBACKMEMBER(int,       pfnR0GstGetPage,(PVM pVM, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));
     2162    DECLR0CALLBACKMEMBER(int,       pfnR0GstModifyPage,(PVM pVM, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));
     2163    DECLR0CALLBACKMEMBER(int,       pfnR0GstGetPDE,(PVM pVM, RTGCUINTPTR GCPtr, PX86PDEPAE pPde));
     2164    DECLR0CALLBACKMEMBER(int,       pfnR0GstMonitorCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2165    DECLR0CALLBACKMEMBER(int,       pfnR0GstUnmonitorCR3,(PVM pVM));
     2166    DECLR0CALLBACKMEMBER(int,       pfnR0GstMapCR3,(PVM pVM, RTGCPHYS GCPhysCR3));
     2167    DECLR0CALLBACKMEMBER(int,       pfnR0GstUnmapCR3,(PVM pVM));
    21562168    R0PTRTYPE(PFNPGMRCPHYSHANDLER)  pfnR0GstWriteHandlerCR3;
    21572169    R0PTRTYPE(PFNPGMRCPHYSHANDLER)  pfnR0GstPAEWriteHandlerCR3;
     
    24002412#ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap.  */
    24012413    /** RC: Which statistic this \#PF should be attributed to. */
    2402     RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC;
    2403     RTRCPTR                 padding0;
     2414    RCPTRTYPE(PSTAMPROFILE)         pStatTrap0eAttributionRC;
     2415    RTRCPTR                         padding0;
    24042416    /** R0: Which statistic this \#PF should be attributed to. */
    2405     R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0;
    2406     RTR0PTR                 padding1;
     2417    R0PTRTYPE(PSTAMPROFILE)         pStatTrap0eAttributionR0;
     2418    RTR0PTR                         padding1;
    24072419
    24082420    /* Common */
     
    29082920
    29092921
    2910 
    2911 
    29122922/**
    29132923 * Gets the PGMPAGE structure for a guest page together with the PGMRAMRANGE.
     
    32013211}
    32023212
     3213
    32033214/**
    32043215 * Sets (bitwise OR) flags associated with a RAM address.
     
    32443255}
    32453256
     3257
    32463258/**
    32473259 * Calculated the guest physical address of the large (4 MB) page in 32 bits paging mode.
     
    32593271    return GCPhys & pPGM->GCPhys4MBPSEMask;
    32603272}
     3273
    32613274
    32623275/**
     
    33823395
    33833396#ifndef IN_GC
     3397
    33843398/**
    33853399 * Gets the page directory pointer entry for the specified address.
     
    34123426}
    34133427
     3428
    34143429/**
    34153430 * Gets the page directory entry for the specified address.
     
    34573472}
    34583473
     3474
    34593475/**
    34603476 * Gets the page directory entry for the specified address.
     
    34983514}
    34993515
     3516
    35003517/**
    35013518 * Gets the page directory entry for the specified address.
     
    35853602    return 0ULL;
    35863603}
     3604
    35873605
    35883606/**
     
    38453863     * Just deal with the simple case here.
    38463864     */
    3847 #ifdef LOG_ENABLED
     3865# ifdef LOG_ENABLED
    38483866    const RTHCPHYS HCPhysOrg = pPhysPage->HCPhys; /** @todo PAGE FLAGS */
    3849 #endif
     3867# endif
    38503868    const unsigned cRefs = pPhysPage->HCPhys >> MM_RAM_FLAGS_CREFS_SHIFT; /** @todo PAGE FLAGS */
    38513869    if (cRefs == 1)
     
    38583876    LogFlow(("pgmTrackDerefGCPhys: HCPhys=%RHp -> %RHp\n", HCPhysOrg, pPhysPage->HCPhys));
    38593877}
    3860 #endif
     3878#endif /* PGMPOOL_WITH_GCPHYS_TRACKING */
    38613879
    38623880
     
    39163934
    39173935#endif
     3936
  • trunk/src/VBox/VMM/PGMMap.cpp

    r13087 r13236  
    4040*   Internal Functions                                                         *
    4141*******************************************************************************/
    42 static void              pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, unsigned iOldPDE);
    43 static void              pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
    44 static int               pgmR3MapIntermediateCheckOne(PVM pVM, uintptr_t uAddress, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
    45 static void              pgmR3MapIntermediateDoOne(PVM pVM, uintptr_t uAddress, RTHCPHYS HCPhys, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
     42static void pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, unsigned iOldPDE);
     43static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
     44static int  pgmR3MapIntermediateCheckOne(PVM pVM, uintptr_t uAddress, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
     45static void pgmR3MapIntermediateDoOne(PVM pVM, uintptr_t uAddress, RTHCPHYS HCPhys, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
    4646
    4747
     
    786786}
    787787
     788
    788789/**
    789790 * Relocates a mapping to a new address.
     
    951952    return VERR_PGM_NO_HYPERVISOR_ADDRESS;
    952953}
     954
    953955
    954956/**
     
    10271029}
    10281030
     1031
    10291032/**
    10301033 * Checks guest PD for conflicts with VMM GC mappings.
     
    10751078        }
    10761079    }
    1077     else
    1078     if (   PGMGetGuestMode(pVM) == PGMMODE_PAE
    1079         || PGMGetGuestMode(pVM) == PGMMODE_PAE_NX)
     1080    else if (   PGMGetGuestMode(pVM) == PGMMODE_PAE
     1081             || PGMGetGuestMode(pVM) == PGMMODE_PAE_NX)
    10801082    {
    10811083        for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
     
    11291131VMMR3DECL(int) PGMR3MapRead(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb)
    11301132{
    1131 /** @todo remove this simplicity hack */
    11321133    /*
    11331134     * Simplicity over speed... Chop the request up into chunks
  • trunk/src/VBox/VMM/PGMShw.h

    r13067 r13236  
    115115#if PGM_SHW_TYPE != PGM_TYPE_AMD64 && PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */
    116116        /* GC */
    117         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(GetPage),  &pModeData->pfnRCShwGetPage);
     117        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_SHW_NAME_RC_STR(GetPage),    &pModeData->pfnRCShwGetPage);
    118118        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_RC_STR(GetPage),  rc), rc);
    119         rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(ModifyPage), &pModeData->pfnRCShwModifyPage);
    120         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_RC_STR(ModifyPage),  rc), rc);
     119        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       PGM_SHW_NAME_RC_STR(ModifyPage), &pModeData->pfnRCShwModifyPage);
     120        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_RC_STR(ModifyPage), rc), rc);
    121121#endif /* Not AMD64 shadow paging. */
    122122
    123123        /* Ring-0 */
    124         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(GetPage),  &pModeData->pfnR0ShwGetPage);
     124        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_SHW_NAME_R0_STR(GetPage),    &pModeData->pfnR0ShwGetPage);
    125125        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_R0_STR(GetPage),  rc), rc);
    126         rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(ModifyPage), &pModeData->pfnR0ShwModifyPage);
    127         AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_R0_STR(ModifyPage),  rc), rc);
     126        rc = PDMR3LdrGetSymbolR0(pVM, NULL,       PGM_SHW_NAME_R0_STR(ModifyPage), &pModeData->pfnR0ShwModifyPage);
     127        AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_SHW_NAME_R0_STR(ModifyPage), rc), rc);
    128128    }
    129129    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r13085 r13236  
    164164}
    165165
    166 
    167 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    168 
    169 /** darwin stub */
    170 VMMR0DECL(int) PGMR0DynMapGCPage(PVM pVM, RTGCPHYS GCPhys, void **ppv)
    171 {
    172     Assert(!(GCPhys & PAGE_OFFSET_MASK));
    173     return VERR_NOT_IMPLEMENTED;
    174 }
    175 
    176 /** darwin stub */
    177 VMMR0DECL(int) PGMR0DynMapGCPageEx(PVM pVM, RTGCPHYS GCPhys, void **ppv)
    178 {
    179     return VERR_NOT_IMPLEMENTED;
    180 }
    181 
    182 /** darwin stub */
    183 VMMR0DECL(int) PGMR0DynMapHCPage(PVM pVM, RTHCPHYS HCPhys, void **ppv)
    184 {
    185     return VERR_NOT_IMPLEMENTED;
    186 }
    187 
    188 #endif /* VBOX_WITH_2X_4GB_ADDR_SPACE */
    189 
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