- Timestamp:
- Oct 13, 2008 9:25:50 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMGst.h
r13087 r13236 68 68 # define GST_PT_MASK X86_PT_MASK 69 69 # define GST_CR3_PAGE_MASK X86_CR3_PAGE_MASK 70 70 71 #elif PGM_GST_TYPE == PGM_TYPE_PAE \ 71 72 || PGM_GST_TYPE == PGM_TYPE_AMD64 … … 140 141 141 142 /* 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); 151 152 152 153 #if PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE … … 168 169 #if PGM_SHW_TYPE != PGM_TYPE_AMD64 /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */ 169 170 /* 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); 171 172 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); 173 174 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); 175 176 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); 177 178 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); 179 180 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); 181 182 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); 183 184 AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_RC_STR(UnmapCR3), rc), rc); 184 185 # 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); 186 187 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); 189 190 # endif 190 191 #endif /* Not AMD64 shadow paging. */ 191 192 192 193 /* 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); 194 195 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); 196 197 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); 198 199 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); 200 201 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); 202 203 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); 204 205 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); 206 207 AssertMsgRCReturn(rc, ("%s -> rc=%Vrc\n", PGM_GST_NAME_R0_STR(UnmapCR3), rc), rc); 207 208 #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); 209 210 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); 212 213 #endif 213 214 } … … 317 318 #endif /* 32BIT */ 318 319 319 320 320 #if PGM_GST_TYPE == PGM_TYPE_PAE 321 321 322 /** 322 323 * Physical write access handler for the Guest CR3 in PAE mode. … … 443 444 } 444 445 # endif 446 445 447 #endif /* PAE */ 446 448 -
trunk/src/VBox/VMM/PGMHandler.cpp
r13062 r13236 212 212 213 213 214 215 214 /** 216 215 * Register a access handler for a virtual range. … … 221 220 * @param GCPtr Start address. 222 221 * @param GCPtrLast Last address (inclusive). 223 * @param pfnInvalidate HC The HCinvalidate callback (can be 0)224 * @param pfnHandler HC The HChandler.225 * @param pszHandler GC The GC handler symbol name.226 * @param pszMod GC 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. 227 226 * @param pszDesc Pointer to description string. This must not be freed. 228 227 */ 229 /** @todo rename this function to PGMR3HandlerVirtualRegister */230 228 VMMR3DECL(int) PGMR3HandlerVirtualRegister(PVM pVM, PGMVIRTHANDLERTYPE enmType, RTGCPTR GCPtr, RTGCPTR GCPtrLast, 231 PFNPGMR3VIRTINVALIDATE pfnInvalidate HC,232 PFNPGMR3VIRTHANDLER pfnHandler HC,233 const char *pszHandler GC, const char *pszModGC,229 PFNPGMR3VIRTINVALIDATE pfnInvalidateR3, 230 PFNPGMR3VIRTHANDLER pfnHandlerR3, 231 const char *pszHandlerRC, const char *pszModRC, 234 232 const char *pszDesc) 235 233 { 236 LogFlow(("PGMR3HandlerVirtualRegisterEx: enmType=%d GCPtr=%VGv GCPtrLast=%VGv pszHandler GC=%p:{%s} pszModGC=%p:{%s} pszDesc=%s\n",237 enmType, GCPtr, GCPtrLast, pszHandler GC, 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)); 238 236 239 237 /* 240 238 * Validate input. 241 239 */ 242 if (!pszMod GC)243 pszMod GC = VMMGC_MAIN_MODULE_NAME;244 if (!pszMod GC || !*pszModGC || !pszHandlerGC || !*pszHandlerGC)245 { 246 AssertMsgFailed(("pfnHandlerGC or/and pszMod GC 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")); 247 245 return VERR_INVALID_PARAMETER; 248 246 } … … 252 250 */ 253 251 RTGCPTR32 pfnHandlerGC; 254 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszMod GC, pszHandlerGC, &pfnHandlerGC);252 int rc = PDMR3LdrGetSymbolRCLazy(pVM, pszModRC, pszHandlerRC, &pfnHandlerGC); 255 253 if (VBOX_SUCCESS(rc)) 256 return PGM HandlerVirtualRegisterEx(pVM, enmType, GCPtr, GCPtrLast, pfnInvalidateHC, pfnHandlerHC, pfnHandlerGC, pszDesc);257 258 AssertMsgFailed(("Failed to resolve %s.%s, rc=%Vrc.\n", pszMod GC, 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)); 259 257 return rc; 260 258 } … … 275 273 * @thread EMT 276 274 */ 277 /** @todo rename this to PGMR3HandlerVirtualRegisterEx. */278 275 /** @todo create a template for virtual handlers (see async i/o), we're wasting space 279 276 * duplicating the function pointers now. (Or we will once we add the missing callbacks.) */ 280 VMMDECL(int) PGM HandlerVirtualRegisterEx(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)277 VMMDECL(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) 285 282 { 286 283 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 76 76 * causes a lot of unnecessary extents and also is slower than taking more \#PFs. 77 77 */ 78 #define PGM_SYNC_NR_PAGES 878 #define PGM_SYNC_NR_PAGES 8 79 79 80 80 /** 81 81 * Number of PGMPhysRead/Write cache entries (must be <= sizeof(uint64_t)) 82 82 */ 83 #define PGM_MAX_PHYSCACHE_ENTRIES 6484 #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) 85 85 86 86 /** … … 134 134 * The maximum number of pages to add to the pool in one go. 135 135 */ 136 #define PGMPOOL_CFG_MAX_GROW (_256K >> PAGE_SHIFT)136 #define PGMPOOL_CFG_MAX_GROW (_256K >> PAGE_SHIFT) 137 137 138 138 /** @def VBOX_STRICT_PGM_HANDLER_VIRTUAL … … 151 151 /** The entry is a permanent one and it's must always be present. 152 152 * Never free such an entry. */ 153 #define PGM_PLXFLAGS_PERMANENT RT_BIT_64(10)153 #define PGM_PLXFLAGS_PERMANENT RT_BIT_64(10) 154 154 /** Mapping (hypervisor allocated pagetable). */ 155 #define PGM_PLXFLAGS_MAPPING RT_BIT_64(11)155 #define PGM_PLXFLAGS_MAPPING RT_BIT_64(11) 156 156 /** @} */ 157 157 … … 161 161 * @{ */ 162 162 /** Mapping (hypervisor allocated pagetable). */ 163 #define PGM_PDFLAGS_MAPPING RT_BIT_64(10)163 #define PGM_PDFLAGS_MAPPING RT_BIT_64(10) 164 164 /** 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) 166 166 /** @} */ 167 167 … … 171 171 * @{ */ 172 172 /** 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) 174 174 175 175 #ifndef PGM_PTFLAGS_CSAM_VALIDATED … … 177 177 * NOTE: Must be identical to the one defined in CSAMInternal.h!! 178 178 * @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) 180 180 #endif 181 181 /** @} */ … … 183 183 /** @name Defines used to indicate the shadow and guest paging in the templates. 184 184 * @{ */ 185 #define PGM_TYPE_REAL 1186 #define PGM_TYPE_PROT 2187 #define PGM_TYPE_32BIT 3188 #define PGM_TYPE_PAE 4189 #define PGM_TYPE_AMD64 5190 #define PGM_TYPE_NESTED 6191 #define PGM_TYPE_EPT 7192 #define PGM_TYPE_MAX PGM_TYPE_EPT185 #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 193 193 /** @} */ 194 194 … … 198 198 * @remark ASSUMES certain order of the PGM_TYPE_* values. 199 199 */ 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) 201 204 202 205 /** Macro for checking if the guest supports the NX bit. … … 205 208 * @remark ASSUMES certain order of the PGM_TYPE_* values. 206 209 */ 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) 208 214 209 215 … … 221 227 */ 222 228 #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)) 224 231 #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)) 226 234 #endif 227 235 … … 239 247 */ 240 248 #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)) 242 251 #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! */ 244 254 #endif 245 255 … … 257 267 */ 258 268 #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)) 260 271 #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! */ 262 274 #endif 263 275 … … 268 280 */ 269 281 #ifdef IN_GC 270 # define PGM_INVL_PG(GCVirt) ASMInvalidatePage((void *)(GCVirt))282 # define PGM_INVL_PG(GCVirt) ASMInvalidatePage((void *)(GCVirt)) 271 283 #elif defined(IN_RING0) 272 # define PGM_INVL_PG(GCVirt) HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))284 # define PGM_INVL_PG(GCVirt) HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt)) 273 285 #else 274 # define PGM_INVL_PG(GCVirt) HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt))286 # define PGM_INVL_PG(GCVirt) HWACCMInvalidatePage(pVM, (RTGCPTR)(GCVirt)) 275 287 #endif 276 288 … … 281 293 */ 282 294 #ifdef IN_GC 283 # define PGM_INVL_BIG_PG(GCVirt) ASMReloadCR3()295 # define PGM_INVL_BIG_PG(GCVirt) ASMReloadCR3() 284 296 #elif defined(IN_RING0) 285 # define PGM_INVL_BIG_PG(GCVirt) HWACCMFlushTLB(pVM)297 # define PGM_INVL_BIG_PG(GCVirt) HWACCMFlushTLB(pVM) 286 298 #else 287 # define PGM_INVL_BIG_PG(GCVirt) HWACCMFlushTLB(pVM)299 # define PGM_INVL_BIG_PG(GCVirt) HWACCMFlushTLB(pVM) 288 300 #endif 289 301 … … 292 304 */ 293 305 #ifdef IN_GC 294 # define PGM_INVL_GUEST_TLBS() ASMReloadCR3()306 # define PGM_INVL_GUEST_TLBS() ASMReloadCR3() 295 307 #elif defined(IN_RING0) 296 # define PGM_INVL_GUEST_TLBS() HWACCMFlushTLB(pVM)308 # define PGM_INVL_GUEST_TLBS() HWACCMFlushTLB(pVM) 297 309 #else 298 # define PGM_INVL_GUEST_TLBS() HWACCMFlushTLB(pVM)310 # define PGM_INVL_GUEST_TLBS() HWACCMFlushTLB(pVM) 299 311 #endif 300 312 … … 308 320 { 309 321 /** Pointer to next entry. */ 310 R3PTRTYPE(struct PGMMAPPING *) pNextR3;322 R3PTRTYPE(struct PGMMAPPING *) pNextR3; 311 323 /** Pointer to next entry. */ 312 R0PTRTYPE(struct PGMMAPPING *) pNextR0;324 R0PTRTYPE(struct PGMMAPPING *) pNextR0; 313 325 /** Pointer to next entry. */ 314 RCPTRTYPE(struct PGMMAPPING *) pNextRC;326 RCPTRTYPE(struct PGMMAPPING *) pNextRC; 315 327 #if GC_ARCH_BITS == 64 316 RTRCPTR padding0;328 RTRCPTR padding0; 317 329 #endif 318 330 /** Start Virtual address. */ 319 RTGCUINTPTR GCPtr;331 RTGCUINTPTR GCPtr; 320 332 /** Last Virtual address (inclusive). */ 321 RTGCUINTPTR GCPtrLast;333 RTGCUINTPTR GCPtrLast; 322 334 /** Range size (bytes). */ 323 RTGCUINTPTR cb;335 RTGCUINTPTR cb; 324 336 /** Pointer to relocation callback function. */ 325 R3PTRTYPE(PFNPGMRELOCATE) pfnRelocate;337 R3PTRTYPE(PFNPGMRELOCATE) pfnRelocate; 326 338 /** User argument to the callback. */ 327 R3PTRTYPE(void *) pvUser;339 R3PTRTYPE(void *) pvUser; 328 340 /** Mapping description / name. For easing debugging. */ 329 R3PTRTYPE(const char *) pszDesc;341 R3PTRTYPE(const char *) pszDesc; 330 342 /** Number of page tables. */ 331 RTUINT cPTs;343 RTUINT cPTs; 332 344 #if HC_ARCH_BITS != GC_ARCH_BITS || GC_ARCH_BITS == 64 333 RTUINT uPadding1; /**< Alignment padding. */345 RTUINT uPadding1; /**< Alignment padding. */ 334 346 #endif 335 347 /** Array of page table mapping data. Each entry … … 340 352 { 341 353 /** The HC physical address of the page table. */ 342 RTHCPHYS HCPhysPT;354 RTHCPHYS HCPhysPT; 343 355 /** The HC physical address of the first PAE page table. */ 344 RTHCPHYS HCPhysPaePT0;356 RTHCPHYS HCPhysPaePT0; 345 357 /** The HC physical address of the second PAE page table. */ 346 RTHCPHYS HCPhysPaePT1;358 RTHCPHYS HCPhysPaePT1; 347 359 /** The HC virtual address of the 32-bit page table. */ 348 R3PTRTYPE(PX86PT) pPTR3;360 R3PTRTYPE(PX86PT) pPTR3; 349 361 /** 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; 351 363 /** The GC virtual address of the 32-bit page table. */ 352 RCPTRTYPE(PX86PT) pPTRC;364 RCPTRTYPE(PX86PT) pPTRC; 353 365 /** The GC virtual address of the two PAE page table. */ 354 RCPTRTYPE(PX86PTPAE) paPaePTsRC;366 RCPTRTYPE(PX86PTPAE) paPaePTsRC; 355 367 /** The GC virtual address of the 32-bit page table. */ 356 R0PTRTYPE(PX86PT) pPTR0;368 R0PTRTYPE(PX86PT) pPTR0; 357 369 /** The GC virtual address of the two PAE page table. */ 358 R0PTRTYPE(PX86PTPAE) paPaePTsR0;370 R0PTRTYPE(PX86PTPAE) paPaePTsR0; 359 371 } aPTs[1]; 360 372 } PGMMAPPING; … … 710 722 #ifdef VBOX_WITH_NEW_PHYS_CODE 711 723 #define PGM_PAGE_SET_TYPE(pPage, _enmType) \ 712 724 do { (pPage)->u3Type = (_enmType); } while (0) 713 725 #else 714 726 #define PGM_PAGE_SET_TYPE(pPage, _enmType) \ … … 838 850 * @param pPage Pointer to the physical guest page tracking structure. 839 851 */ 840 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) 852 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->u2HandlerVirtStateX ) 841 853 842 854 /** … … 991 1003 { 992 1004 /** Pointer to the next range - R3. */ 993 R3PTRTYPE(struct PGMROMRANGE *) pNextR3;1005 R3PTRTYPE(struct PGMROMRANGE *) pNextR3; 994 1006 /** Pointer to the next range - R0. */ 995 R0PTRTYPE(struct PGMROMRANGE *) pNextR0;1007 R0PTRTYPE(struct PGMROMRANGE *) pNextR0; 996 1008 /** Pointer to the next range - RC. */ 997 RCPTRTYPE(struct PGMROMRANGE *) pNextRC;1009 RCPTRTYPE(struct PGMROMRANGE *) pNextRC; 998 1010 /** Pointer alignment */ 999 RTRCPTR GCPtrAlignment;1011 RTRCPTR GCPtrAlignment; 1000 1012 /** Address of the range. */ 1001 RTGCPHYS GCPhys;1013 RTGCPHYS GCPhys; 1002 1014 /** Address of the last byte in the range. */ 1003 RTGCPHYS GCPhysLast;1015 RTGCPHYS GCPhysLast; 1004 1016 /** Size of the range. */ 1005 RTGCPHYS cb;1017 RTGCPHYS cb; 1006 1018 /** The flags (PGMPHYS_ROM_FLAG_*). */ 1007 uint32_t fFlags;1019 uint32_t fFlags; 1008 1020 /** 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]; 1010 1022 /** Pointer to the original bits when PGMPHYS_ROM_FLAG_PERMANENT_BINARY was specified. 1011 1023 * This is used for strictness checks. */ 1012 R3PTRTYPE(const void *) pvOriginal;1024 R3PTRTYPE(const void *) pvOriginal; 1013 1025 /** The ROM description. */ 1014 R3PTRTYPE(const char *) pszDesc;1026 R3PTRTYPE(const char *) pszDesc; 1015 1027 /** The per page tracking structures. */ 1016 PGMROMPAGE aPages[1];1028 PGMROMPAGE aPages[1]; 1017 1029 } PGMROMRANGE; 1018 1030 /** Pointer to a ROM range. */ … … 1067 1079 { 1068 1080 /** R3 pointer to physical page. */ 1069 R3PTRTYPE(uint8_t *) pbR3;1081 R3PTRTYPE(uint8_t *) pbR3; 1070 1082 /** GC Physical address for cache entry */ 1071 RTGCPHYS GCPhys;1083 RTGCPHYS GCPhys; 1072 1084 #if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32 1073 RTGCPHYS u32Padding0; /**< alignment padding. */1085 RTGCPHYS u32Padding0; /**< alignment padding. */ 1074 1086 #endif 1075 1087 } PGMPHYSCACHEENTRY; … … 1081 1093 { 1082 1094 /** Bitmap of valid cache entries */ 1083 uint64_t aEntries;1095 uint64_t aEntries; 1084 1096 /** Cache entries */ 1085 PGMPHYSCACHEENTRY Entry[PGM_MAX_PHYSCACHE_ENTRIES];1097 PGMPHYSCACHEENTRY Entry[PGM_MAX_PHYSCACHE_ENTRIES]; 1086 1098 } PGMPHYSCACHE; 1087 1099 … … 1101 1113 { 1102 1114 /** The key is the chunk id. */ 1103 AVLU32NODECORE Core;1115 AVLU32NODECORE Core; 1104 1116 /** The key is the ageing sequence number. */ 1105 AVLLU32NODECORE AgeCore;1117 AVLLU32NODECORE AgeCore; 1106 1118 /** The current age thingy. */ 1107 uint32_t iAge;1119 uint32_t iAge; 1108 1120 /** The current reference count. */ 1109 uint32_t volatile cRefs;1121 uint32_t volatile cRefs; 1110 1122 /** The current permanent reference count. */ 1111 uint32_t volatile cPermRefs;1123 uint32_t volatile cPermRefs; 1112 1124 /** The mapping address. */ 1113 void *pv;1125 void *pv; 1114 1126 } PGMCHUNKR3MAP; 1115 1127 … … 1152 1164 * 1153 1165 * @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). 1155 1167 */ 1156 1168 typedef struct PGMCHUNKR3MAPTLB … … 1250 1262 * Pointer to a page mapper unit pointer for current context. */ 1251 1263 #ifdef IN_GC 1252 // typedef PPGMPAGEGCMAPTLB PPGMPAGEMAPTLB;1253 // typedef PPGMPAGEGCMAPTLBE PPGMPAGEMAPTLBE;1254 // typedef PPGMPAGEGCMAPTLBE *PPPGMPAGEMAPTLBE;1255 # define PGM_PAGEMAPTLB_ENTRIES PGM_PAGEGCMAPTLB_ENTRIES1256 # 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; 1259 1271 //#elif IN_RING0 1260 // typedef PPGMPAGER0MAPTLB PPGMPAGEMAPTLB;1261 // typedef PPGMPAGER0MAPTLBE PPGMPAGEMAPTLBE;1262 // typedef PPGMPAGER0MAPTLBE *PPPGMPAGEMAPTLBE;1263 //# define PGM_PAGEMAPTLB_ENTRIES PGM_PAGER0MAPTLB_ENTRIES1264 //# 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; 1267 1279 #else 1268 typedef PPGMPAGER3MAPTLB PPGMPAGEMAPTLB;1269 typedef PPGMPAGER3MAPTLBE PPGMPAGEMAPTLBE;1270 typedef PPGMPAGER3MAPTLBE *PPPGMPAGEMAPTLBE;1271 # define PGM_PAGEMAPTLB_ENTRIES PGM_PAGER3MAPTLB_ENTRIES1272 # 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; 1275 1287 #endif 1276 1288 /** @} */ … … 1281 1293 * @{ */ 1282 1294 /** NIL page pool IDX. */ 1283 #define NIL_PGMPOOL_IDX 01295 #define NIL_PGMPOOL_IDX 0 1284 1296 /** The first normal index. */ 1285 #define PGMPOOL_IDX_FIRST_SPECIAL 11297 #define PGMPOOL_IDX_FIRST_SPECIAL 1 1286 1298 /** Page directory (32-bit root). */ 1287 #define PGMPOOL_IDX_PD 11299 #define PGMPOOL_IDX_PD 1 1288 1300 /** The extended PAE page directory (2048 entries, works as root currently). */ 1289 #define PGMPOOL_IDX_PAE_PD 21301 #define PGMPOOL_IDX_PAE_PD 2 1290 1302 /** PAE Page Directory Table 0. */ 1291 #define PGMPOOL_IDX_PAE_PD_0 31303 #define PGMPOOL_IDX_PAE_PD_0 3 1292 1304 /** PAE Page Directory Table 1. */ 1293 #define PGMPOOL_IDX_PAE_PD_1 41305 #define PGMPOOL_IDX_PAE_PD_1 4 1294 1306 /** PAE Page Directory Table 2. */ 1295 #define PGMPOOL_IDX_PAE_PD_2 51307 #define PGMPOOL_IDX_PAE_PD_2 5 1296 1308 /** PAE Page Directory Table 3. */ 1297 #define PGMPOOL_IDX_PAE_PD_3 61309 #define PGMPOOL_IDX_PAE_PD_3 6 1298 1310 /** Page Directory Pointer Table (PAE root, not currently used). */ 1299 #define PGMPOOL_IDX_PDPT 71311 #define PGMPOOL_IDX_PDPT 7 1300 1312 /** AMD64 CR3 level index.*/ 1301 #define PGMPOOL_IDX_AMD64_CR3 81313 #define PGMPOOL_IDX_AMD64_CR3 8 1302 1314 /** Nested paging root.*/ 1303 #define PGMPOOL_IDX_NESTED_ROOT 91315 #define PGMPOOL_IDX_NESTED_ROOT 9 1304 1316 /** The first normal index. */ 1305 #define PGMPOOL_IDX_FIRST 101317 #define PGMPOOL_IDX_FIRST 10 1306 1318 /** The last valid index. (inclusive, 14 bits) */ 1307 #define PGMPOOL_IDX_LAST 0x3fff1319 #define PGMPOOL_IDX_LAST 0x3fff 1308 1320 /** @} */ 1309 1321 1310 1322 /** 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) 1312 1324 1313 1325 /** … … 1329 1341 1330 1342 /** 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) 1332 1344 1333 1345 /** … … 1356 1368 PGMPOOLKIND_FREE, 1357 1369 1358 /** Shw: 32-bit page table; Gst: no paging */1370 /** Shw: 32-bit page table; Gst: no paging */ 1359 1371 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. */ 1361 1373 PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT, 1362 /** Shw: 32-bit page table; Gst: 4MB page. */1374 /** Shw: 32-bit page table; Gst: 4MB page. */ 1363 1375 PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB, 1364 /** Shw: PAE page table; Gst: no paging */1376 /** Shw: PAE page table; Gst: no paging */ 1365 1377 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. */ 1367 1379 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. */ 1369 1381 PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB, 1370 /** Shw: PAE page table; Gst: PAE page table. */1382 /** Shw: PAE page table; Gst: PAE page table. */ 1371 1383 PGMPOOLKIND_PAE_PT_FOR_PAE_PT, 1372 /** Shw: PAE page table; Gst: 2MB page. */1384 /** Shw: PAE page table; Gst: 2MB page. */ 1373 1385 PGMPOOLKIND_PAE_PT_FOR_PAE_2MB, 1374 1386 … … 1380 1392 /** Shw: 64-bit page directory pointer table; Gst: 64-bit page directory pointer table. */ 1381 1393 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 */ 1383 1395 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. */ 1385 1397 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 */ 1387 1399 PGMPOOLKIND_64BIT_PD_FOR_PHYS, 1388 1400 1389 /** Shw: 64-bit PML4; Gst: 64-bit PML4. */1401 /** Shw: 64-bit PML4; Gst: 64-bit PML4. */ 1390 1402 PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, 1391 1403 1392 /** Shw: EPT page directory pointer table; Gst: no paging */1404 /** Shw: EPT page directory pointer table; Gst: no paging */ 1393 1405 PGMPOOLKIND_EPT_PDPT_FOR_PHYS, 1394 /** Shw: EPT page directory table; Gst: no paging */1406 /** Shw: EPT page directory table; Gst: no paging */ 1395 1407 PGMPOOLKIND_EPT_PD_FOR_PHYS, 1396 /** Shw: EPT page table; Gst: no paging */1408 /** Shw: EPT page table; Gst: no paging */ 1397 1409 PGMPOOLKIND_EPT_PT_FOR_PHYS, 1398 1410 … … 1503 1515 { 1504 1516 /** The VM handle - R3 Ptr. */ 1505 PVMR3 pVMR3;1517 PVMR3 pVMR3; 1506 1518 /** The VM handle - R0 Ptr. */ 1507 PVMR0 pVMR0;1519 PVMR0 pVMR0; 1508 1520 /** The VM handle - RC Ptr. */ 1509 PVMRC pVMRC;1521 PVMRC pVMRC; 1510 1522 /** The max pool size. This includes the special IDs. */ 1511 uint16_t cMaxPages;1523 uint16_t cMaxPages; 1512 1524 /** The current pool size. */ 1513 uint16_t cCurPages;1525 uint16_t cCurPages; 1514 1526 /** The head of the free page list. */ 1515 uint16_t iFreeHead;1527 uint16_t iFreeHead; 1516 1528 /* Padding. */ 1517 uint16_t u16Padding;1529 uint16_t u16Padding; 1518 1530 #ifdef PGMPOOL_WITH_USER_TRACKING 1519 1531 /** Head of the chain of free user nodes. */ 1520 uint16_t iUserFreeHead;1532 uint16_t iUserFreeHead; 1521 1533 /** The number of user nodes we've allocated. */ 1522 uint16_t cMaxUsers;1534 uint16_t cMaxUsers; 1523 1535 /** The number of present page table entries in the entire pool. */ 1524 uint32_t cPresent;1536 uint32_t cPresent; 1525 1537 /** Pointer to the array of user nodes - RC pointer. */ 1526 RCPTRTYPE(PPGMPOOLUSER) paUsersRC;1538 RCPTRTYPE(PPGMPOOLUSER) paUsersRC; 1527 1539 /** Pointer to the array of user nodes - R3 pointer. */ 1528 R3PTRTYPE(PPGMPOOLUSER) paUsersR3;1540 R3PTRTYPE(PPGMPOOLUSER) paUsersR3; 1529 1541 /** Pointer to the array of user nodes - R0 pointer. */ 1530 R0PTRTYPE(PPGMPOOLUSER) paUsersR0;1542 R0PTRTYPE(PPGMPOOLUSER) paUsersR0; 1531 1543 #endif /* PGMPOOL_WITH_USER_TRACKING */ 1532 1544 #ifdef PGMPOOL_WITH_GCPHYS_TRACKING 1533 1545 /** Head of the chain of free phys ext nodes. */ 1534 uint16_t iPhysExtFreeHead;1546 uint16_t iPhysExtFreeHead; 1535 1547 /** The number of user nodes we've allocated. */ 1536 uint16_t cMaxPhysExts;1548 uint16_t cMaxPhysExts; 1537 1549 /** Pointer to the array of physical xref extent - RC pointer. */ 1538 RCPTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsRC;1550 RCPTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsRC; 1539 1551 /** Pointer to the array of physical xref extent nodes - R3 pointer. */ 1540 R3PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR3;1552 R3PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR3; 1541 1553 /** Pointer to the array of physical xref extent nodes - R0 pointer. */ 1542 R0PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR0;1554 R0PTRTYPE(PPGMPOOLPHYSEXT) paPhysExtsR0; 1543 1555 #endif /* PGMPOOL_WITH_GCPHYS_TRACKING */ 1544 1556 #ifdef PGMPOOL_WITH_CACHE 1545 1557 /** Hash table for GCPhys addresses. */ 1546 uint16_t aiHash[PGMPOOL_HASH_SIZE];1558 uint16_t aiHash[PGMPOOL_HASH_SIZE]; 1547 1559 /** The head of the age list. */ 1548 uint16_t iAgeHead;1560 uint16_t iAgeHead; 1549 1561 /** The tail of the age list. */ 1550 uint16_t iAgeTail;1562 uint16_t iAgeTail; 1551 1563 /** Set if the cache is enabled. */ 1552 bool fCacheEnabled;1564 bool fCacheEnabled; 1553 1565 #endif /* PGMPOOL_WITH_CACHE */ 1554 1566 #ifdef PGMPOOL_WITH_MONITORING 1555 1567 /** Head of the list of modified pages. */ 1556 uint16_t iModifiedHead;1568 uint16_t iModifiedHead; 1557 1569 /** The current number of modified pages. */ 1558 uint16_t cModifiedPages;1570 uint16_t cModifiedPages; 1559 1571 /** Access handler, RC. */ 1560 1572 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnAccessHandlerRC; … … 1567 1579 #endif /* PGMPOOL_WITH_MONITORING */ 1568 1580 /** The number of pages currently in use. */ 1569 uint16_t cUsedPages;1581 uint16_t cUsedPages; 1570 1582 #ifdef VBOX_WITH_STATISTICS 1571 1583 /** 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. */ 1574 1586 /** Profiling pgmPoolAlloc(). */ 1575 STAMPROFILEADV StatAlloc;1587 STAMPROFILEADV StatAlloc; 1576 1588 /** Profiling pgmPoolClearAll(). */ 1577 STAMPROFILE StatClearAll;1589 STAMPROFILE StatClearAll; 1578 1590 /** Profiling pgmPoolFlushAllInt(). */ 1579 STAMPROFILE StatFlushAllInt;1591 STAMPROFILE StatFlushAllInt; 1580 1592 /** Profiling pgmPoolFlushPage(). */ 1581 STAMPROFILE StatFlushPage;1593 STAMPROFILE StatFlushPage; 1582 1594 /** Profiling pgmPoolFree(). */ 1583 STAMPROFILE StatFree;1595 STAMPROFILE StatFree; 1584 1596 /** Profiling time spent zeroing pages. */ 1585 STAMPROFILE StatZeroPage;1597 STAMPROFILE StatZeroPage; 1586 1598 # ifdef PGMPOOL_WITH_USER_TRACKING 1587 1599 /** Profiling of pgmPoolTrackDeref. */ 1588 STAMPROFILE StatTrackDeref;1600 STAMPROFILE StatTrackDeref; 1589 1601 /** Profiling pgmTrackFlushGCPhysPT. */ 1590 STAMPROFILE StatTrackFlushGCPhysPT;1602 STAMPROFILE StatTrackFlushGCPhysPT; 1591 1603 /** Profiling pgmTrackFlushGCPhysPTs. */ 1592 STAMPROFILE StatTrackFlushGCPhysPTs;1604 STAMPROFILE StatTrackFlushGCPhysPTs; 1593 1605 /** Profiling pgmTrackFlushGCPhysPTsSlow. */ 1594 STAMPROFILE StatTrackFlushGCPhysPTsSlow;1606 STAMPROFILE StatTrackFlushGCPhysPTsSlow; 1595 1607 /** Number of times we've been out of user records. */ 1596 STAMCOUNTER StatTrackFreeUpOneUser;1608 STAMCOUNTER StatTrackFreeUpOneUser; 1597 1609 # endif 1598 1610 # ifdef PGMPOOL_WITH_GCPHYS_TRACKING 1599 1611 /** Profiling deref activity related tracking GC physical pages. */ 1600 STAMPROFILE StatTrackDerefGCPhys;1612 STAMPROFILE StatTrackDerefGCPhys; 1601 1613 /** Number of linear searches for a HCPhys in the ram ranges. */ 1602 STAMCOUNTER StatTrackLinearRamSearches;1614 STAMCOUNTER StatTrackLinearRamSearches; 1603 1615 /** The number of failing pgmPoolTrackPhysExtAlloc calls. */ 1604 STAMCOUNTER StamTrackPhysExtAllocFailures;1616 STAMCOUNTER StamTrackPhysExtAllocFailures; 1605 1617 # endif 1606 1618 # ifdef PGMPOOL_WITH_MONITORING 1607 1619 /** Profiling the RC/R0 access handler. */ 1608 STAMPROFILE StatMonitorRZ;1620 STAMPROFILE StatMonitorRZ; 1609 1621 /** Times we've failed interpreting the instruction. */ 1610 STAMCOUNTER StatMonitorRZEmulateInstr;1622 STAMCOUNTER StatMonitorRZEmulateInstr; 1611 1623 /** Profiling the pgmPoolFlushPage calls made from the RC/R0 access handler. */ 1612 STAMPROFILE StatMonitorRZFlushPage;1624 STAMPROFILE StatMonitorRZFlushPage; 1613 1625 /** Times we've detected fork(). */ 1614 STAMCOUNTER StatMonitorRZFork;1626 STAMCOUNTER StatMonitorRZFork; 1615 1627 /** Profiling the RC/R0 access we've handled (except REP STOSD). */ 1616 STAMPROFILE StatMonitorRZHandled;1628 STAMPROFILE StatMonitorRZHandled; 1617 1629 /** Times we've failed interpreting a patch code instruction. */ 1618 STAMCOUNTER StatMonitorRZIntrFailPatch1;1630 STAMCOUNTER StatMonitorRZIntrFailPatch1; 1619 1631 /** Times we've failed interpreting a patch code instruction during flushing. */ 1620 STAMCOUNTER StatMonitorRZIntrFailPatch2;1632 STAMCOUNTER StatMonitorRZIntrFailPatch2; 1621 1633 /** The number of times we've seen rep prefixes we can't handle. */ 1622 STAMCOUNTER StatMonitorRZRepPrefix;1634 STAMCOUNTER StatMonitorRZRepPrefix; 1623 1635 /** Profiling the REP STOSD cases we've handled. */ 1624 STAMPROFILE StatMonitorRZRepStosd;1636 STAMPROFILE StatMonitorRZRepStosd; 1625 1637 1626 1638 /** Profiling the R3 access handler. */ 1627 STAMPROFILE StatMonitorR3;1639 STAMPROFILE StatMonitorR3; 1628 1640 /** Times we've failed interpreting the instruction. */ 1629 STAMCOUNTER StatMonitorR3EmulateInstr;1641 STAMCOUNTER StatMonitorR3EmulateInstr; 1630 1642 /** Profiling the pgmPoolFlushPage calls made from the R3 access handler. */ 1631 STAMPROFILE StatMonitorR3FlushPage;1643 STAMPROFILE StatMonitorR3FlushPage; 1632 1644 /** Times we've detected fork(). */ 1633 STAMCOUNTER StatMonitorR3Fork;1645 STAMCOUNTER StatMonitorR3Fork; 1634 1646 /** Profiling the R3 access we've handled (except REP STOSD). */ 1635 STAMPROFILE StatMonitorR3Handled;1647 STAMPROFILE StatMonitorR3Handled; 1636 1648 /** The number of times we've seen rep prefixes we can't handle. */ 1637 STAMCOUNTER StatMonitorR3RepPrefix;1649 STAMCOUNTER StatMonitorR3RepPrefix; 1638 1650 /** Profiling the REP STOSD cases we've handled. */ 1639 STAMPROFILE StatMonitorR3RepStosd;1651 STAMPROFILE StatMonitorR3RepStosd; 1640 1652 /** The number of times we're called in an async thread an need to flush. */ 1641 STAMCOUNTER StatMonitorR3Async;1653 STAMCOUNTER StatMonitorR3Async; 1642 1654 /** 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. */ 1645 1657 # endif 1646 1658 # ifdef PGMPOOL_WITH_CACHE 1647 1659 /** The number of cache hits. */ 1648 STAMCOUNTER StatCacheHits;1660 STAMCOUNTER StatCacheHits; 1649 1661 /** The number of cache misses. */ 1650 STAMCOUNTER StatCacheMisses;1662 STAMCOUNTER StatCacheMisses; 1651 1663 /** The number of times we've got a conflict of 'kind' in the cache. */ 1652 STAMCOUNTER StatCacheKindMismatches;1664 STAMCOUNTER StatCacheKindMismatches; 1653 1665 /** Number of times we've been out of pages. */ 1654 STAMCOUNTER StatCacheFreeUpOne;1666 STAMCOUNTER StatCacheFreeUpOne; 1655 1667 /** The number of cacheable allocations. */ 1656 STAMCOUNTER StatCacheCacheable;1668 STAMCOUNTER StatCacheCacheable; 1657 1669 /** The number of uncacheable allocations. */ 1658 STAMCOUNTER StatCacheUncacheable;1670 STAMCOUNTER StatCacheUncacheable; 1659 1671 # endif 1660 1672 #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. */ 1662 1674 #endif 1663 1675 /** 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. */ 1666 1678 /** Array of pages. (cMaxPages in length) 1667 1679 * The Id is the index into thist array. 1668 1680 */ 1669 PGMPOOLPAGE aPages[PGMPOOL_IDX_FIRST];1681 PGMPOOLPAGE aPages[PGMPOOL_IDX_FIRST]; 1670 1682 } PGMPOOL, *PPGMPOOL, **PPPGMPOOL; 1671 1683 … … 1832 1844 { 1833 1845 /** The guest mode type. */ 1834 uint32_t uGstType;1846 uint32_t uGstType; 1835 1847 /** The shadow mode type. */ 1836 uint32_t uShwType;1848 uint32_t uShwType; 1837 1849 1838 1850 /** @name Function pointers for Shadow paging. 1839 1851 * @{ 1840 1852 */ 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)); 1851 1863 /** @} */ 1852 1864 … … 1854 1866 * @{ 1855 1867 */ 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)); 1865 1877 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnR3GstWriteHandlerCR3; 1866 1878 R3PTRTYPE(const char *) pszR3GstWriteHandlerCR3; … … 1868 1880 R3PTRTYPE(const char *) pszR3GstPAEWriteHandlerCR3; 1869 1881 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)); 1877 1889 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnRCGstWriteHandlerCR3; 1878 1890 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnRCGstPAEWriteHandlerCR3; 1879 1891 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)); 1887 1899 R0PTRTYPE(PFNPGMRCPHYSHANDLER) pfnR0GstWriteHandlerCR3; 1888 1900 R0PTRTYPE(PFNPGMRCPHYSHANDLER) pfnR0GstPAEWriteHandlerCR3; … … 1940 1952 { 1941 1953 /** Offset to the VM structure. */ 1942 RTINT offVM;1954 RTINT offVM; 1943 1955 1944 1956 /* … … 1952 1964 1953 1965 /** Pointer to the page table entries for the dynamic page mapping area - GCPtr. */ 1954 RCPTRTYPE(PX86PTE) paDynPageMap32BitPTEsGC;1966 RCPTRTYPE(PX86PTE) paDynPageMap32BitPTEsGC; 1955 1967 /** Pointer to the page table entries for the dynamic page mapping area - GCPtr. */ 1956 RCPTRTYPE(PX86PTEPAE) paDynPageMapPaePTEsGC;1968 RCPTRTYPE(PX86PTEPAE) paDynPageMapPaePTEsGC; 1957 1969 1958 1970 /** The host paging mode. (This is what SUPLib reports.) */ 1959 SUPPAGINGMODE enmHostMode;1971 SUPPAGINGMODE enmHostMode; 1960 1972 /** The shadow paging mode. */ 1961 PGMMODE enmShadowMode;1973 PGMMODE enmShadowMode; 1962 1974 /** The guest paging mode. */ 1963 PGMMODE enmGuestMode;1975 PGMMODE enmGuestMode; 1964 1976 1965 1977 /** The current physical address representing in the guest CR3 register. */ 1966 RTGCPHYS GCPhysCR3;1978 RTGCPHYS GCPhysCR3; 1967 1979 /** Pointer to the 5 page CR3 content mapping. 1968 1980 * The first page is always the CR3 (in some form) while the 4 other pages 1969 1981 * are used of the PDs in PAE mode. */ 1970 RTGCPTR GCPtrCR3Mapping;1982 RTGCPTR GCPtrCR3Mapping; 1971 1983 #if HC_ARCH_BITS == 64 && GC_ARCH_BITS == 32 1972 uint32_t u32Alignment;1984 uint32_t u32Alignment; 1973 1985 #endif 1974 1986 /** The physical address of the currently monitored guest CR3 page. 1975 1987 * When this value is NIL_RTGCPHYS no page is being monitored. */ 1976 RTGCPHYS GCPhysGstCR3Monitored;1988 RTGCPHYS GCPhysGstCR3Monitored; 1977 1989 1978 1990 /** @name 32-bit Guest Paging. … … 1980 1992 /** The guest's page directory, HC pointer. */ 1981 1993 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 1982 R3PTRTYPE(PX86PD) pGuestPDHC;1994 R3PTRTYPE(PX86PD) pGuestPDHC; 1983 1995 #else 1984 R3R0PTRTYPE(PX86PD) pGuestPDHC;1996 R3R0PTRTYPE(PX86PD) pGuestPDHC; 1985 1997 #endif 1986 1998 /** The guest's page directory, static GC mapping. */ 1987 RCPTRTYPE(PX86PD) pGuestPDGC;1999 RCPTRTYPE(PX86PD) pGuestPDGC; 1988 2000 /** @} */ 1989 2001 … … 1991 2003 * @{ */ 1992 2004 /** The guest's page directory pointer table, static GC mapping. */ 1993 RCPTRTYPE(PX86PDPT) pGstPaePDPTGC;2005 RCPTRTYPE(PX86PDPT) pGstPaePDPTGC; 1994 2006 /** The guest's page directory pointer table, HC pointer. */ 1995 2007 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 1996 R3PTRTYPE(PX86PDPT) pGstPaePDPTHC;2008 R3PTRTYPE(PX86PDPT) pGstPaePDPTHC; 1997 2009 #else 1998 R3R0PTRTYPE(PX86PDPT) pGstPaePDPTHC;2010 R3R0PTRTYPE(PX86PDPT) pGstPaePDPTHC; 1999 2011 #endif 2000 2012 /** The guest's page directories, HC pointers. … … 2002 2014 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 2003 2015 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2004 R3PTRTYPE(PX86PDPAE) apGstPaePDsHC[4];2016 R3PTRTYPE(PX86PDPAE) apGstPaePDsHC[4]; 2005 2017 #else 2006 R3R0PTRTYPE(PX86PDPAE) apGstPaePDsHC[4];2018 R3R0PTRTYPE(PX86PDPAE) apGstPaePDsHC[4]; 2007 2019 #endif 2008 2020 /** The guest's page directories, static GC mapping. 2009 2021 * Unlike the HC array the first entry can be accessed as a 2048 entry PD. 2010 2022 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 2011 RCPTRTYPE(PX86PDPAE) apGstPaePDsGC[4];2023 RCPTRTYPE(PX86PDPAE) apGstPaePDsGC[4]; 2012 2024 /** The physical addresses of the guest page directories (PAE) pointed to by apGstPagePDsHC/GC. */ 2013 RTGCPHYS aGCPhysGstPaePDs[4];2025 RTGCPHYS aGCPhysGstPaePDs[4]; 2014 2026 /** The physical addresses of the monitored guest page directories (PAE). */ 2015 RTGCPHYS aGCPhysGstPaePDsMonitored[4];2027 RTGCPHYS aGCPhysGstPaePDsMonitored[4]; 2016 2028 /** @} */ 2017 2029 … … 2020 2032 /** The guest's page directory pointer table, HC pointer. */ 2021 2033 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2022 R3R0PTRTYPE(PX86PML4) pGstPaePML4HC;2034 R3R0PTRTYPE(PX86PML4) pGstPaePML4HC; 2023 2035 #else 2024 R3R0PTRTYPE(PX86PML4) pGstPaePML4HC;2036 R3R0PTRTYPE(PX86PML4) pGstPaePML4HC; 2025 2037 #endif 2026 2038 /** @} */ … … 2030 2042 /** The 32-Bit PD - HC Ptr. */ 2031 2043 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2032 R3PTRTYPE(PX86PD) pHC32BitPD;2044 R3PTRTYPE(PX86PD) pHC32BitPD; 2033 2045 #else 2034 R3R0PTRTYPE(PX86PD) pHC32BitPD;2046 R3R0PTRTYPE(PX86PD) pHC32BitPD; 2035 2047 #endif 2036 2048 /** The 32-Bit PD - GC Ptr. */ 2037 RCPTRTYPE(PX86PD) pGC32BitPD;2049 RCPTRTYPE(PX86PD) pGC32BitPD; 2038 2050 #if HC_ARCH_BITS == 64 2039 uint32_t u32Padding1; /**< alignment padding. */2051 uint32_t u32Padding1; /**< alignment padding. */ 2040 2052 #endif 2041 2053 /** The Physical Address (HC) of the 32-Bit PD. */ 2042 RTHCPHYS HCPhys32BitPD;2054 RTHCPHYS HCPhys32BitPD; 2043 2055 /** @} */ 2044 2056 … … 2049 2061 * Thus, it's possible to walk the 2048 entries starting where apHCPaePDs[0] points. */ 2050 2062 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2051 R3PTRTYPE(PX86PDPAE) apHCPaePDs[4];2063 R3PTRTYPE(PX86PDPAE) apHCPaePDs[4]; 2052 2064 #else 2053 R3R0PTRTYPE(PX86PDPAE) apHCPaePDs[4];2065 R3R0PTRTYPE(PX86PDPAE) apHCPaePDs[4]; 2054 2066 #endif 2055 2067 /** The four PDs for the low 4GB - GC Ptr. 2056 2068 * Same kind of mapping as apHCPaePDs. */ 2057 RCPTRTYPE(PX86PDPAE) apGCPaePDs[4];2069 RCPTRTYPE(PX86PDPAE) apGCPaePDs[4]; 2058 2070 /** The Physical Address (HC) of the four PDs for the low 4GB. 2059 2071 * These are *NOT* 4 contiguous pages. */ 2060 RTHCPHYS aHCPhysPaePDs[4];2072 RTHCPHYS aHCPhysPaePDs[4]; 2061 2073 /** The PAE PDP - HC Ptr. */ 2062 R3R0PTRTYPE(PX86PDPT) pHCPaePDPT;2074 R3R0PTRTYPE(PX86PDPT) pHCPaePDPT; 2063 2075 /** The Physical Address (HC) of the PAE PDPT. */ 2064 RTHCPHYS HCPhysPaePDPT;2076 RTHCPHYS HCPhysPaePDPT; 2065 2077 /** The PAE PDPT - GC Ptr. */ 2066 RCPTRTYPE(PX86PDPT) pGCPaePDPT;2078 RCPTRTYPE(PX86PDPT) pGCPaePDPT; 2067 2079 /** @} */ 2068 2080 … … 2071 2083 * @{ */ 2072 2084 #if HC_ARCH_BITS == 64 2073 RTRCPTR alignment5; /**< structure size alignment. */2085 RTRCPTR alignment5; /**< structure size alignment. */ 2074 2086 #endif 2075 2087 /** The Page Map Level 4 table - HC Ptr. */ 2076 2088 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2077 R3PTRTYPE(PX86PML4) pHCPaePML4;2089 R3PTRTYPE(PX86PML4) pHCPaePML4; 2078 2090 #else 2079 R3R0PTRTYPE(PX86PML4) pHCPaePML4;2091 R3R0PTRTYPE(PX86PML4) pHCPaePML4; 2080 2092 #endif 2081 2093 /** The Physical Address (HC) of the Page Map Level 4 table. */ 2082 RTHCPHYS HCPhysPaePML4;2094 RTHCPHYS HCPhysPaePML4; 2083 2095 /** The pgm pool page descriptor for the current active CR3. */ 2084 2096 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2085 R3PTRTYPE(PPGMPOOLPAGE) pHCShwAmd64CR3;2097 R3PTRTYPE(PPGMPOOLPAGE) pHCShwAmd64CR3; 2086 2098 #else 2087 R3R0PTRTYPE(PPGMPOOLPAGE) pHCShwAmd64CR3;2099 R3R0PTRTYPE(PPGMPOOLPAGE) pHCShwAmd64CR3; 2088 2100 #endif 2089 2101 … … 2094 2106 /** Root table; format depends on the host paging mode (AMD-V) or EPT */ 2095 2107 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2096 R3PTRTYPE(void *) pHCNestedRoot;2108 R3PTRTYPE(void *) pHCNestedRoot; 2097 2109 #else 2098 R3R0PTRTYPE(void *) pHCNestedRoot;2110 R3R0PTRTYPE(void *) pHCNestedRoot; 2099 2111 #endif 2100 2112 /** The Physical Address (HC) of the nested paging root. */ 2101 RTHCPHYS HCPhysNestedRoot;2113 RTHCPHYS HCPhysNestedRoot; 2102 2114 2103 2115 /** @name Function pointers for Shadow paging. 2104 2116 * @{ 2105 2117 */ 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)); 2116 2128 2117 2129 /** @} */ … … 2120 2132 * @{ 2121 2133 */ 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)); 2131 2143 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnR3GstWriteHandlerCR3; 2132 2144 R3PTRTYPE(const char *) pszR3GstWriteHandlerCR3; … … 2134 2146 R3PTRTYPE(const char *) pszR3GstPAEWriteHandlerCR3; 2135 2147 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)); 2143 2155 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnRCGstWriteHandlerCR3; 2144 2156 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnRCGstPAEWriteHandlerCR3; … … 2147 2159 #endif 2148 2160 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)); 2156 2168 R0PTRTYPE(PFNPGMRCPHYSHANDLER) pfnR0GstWriteHandlerCR3; 2157 2169 R0PTRTYPE(PFNPGMRCPHYSHANDLER) pfnR0GstPAEWriteHandlerCR3; … … 2400 2412 #ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap. */ 2401 2413 /** RC: Which statistic this \#PF should be attributed to. */ 2402 RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC;2403 RTRCPTR padding0;2414 RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC; 2415 RTRCPTR padding0; 2404 2416 /** R0: Which statistic this \#PF should be attributed to. */ 2405 R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0;2406 RTR0PTR padding1;2417 R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0; 2418 RTR0PTR padding1; 2407 2419 2408 2420 /* Common */ … … 2908 2920 2909 2921 2910 2911 2912 2922 /** 2913 2923 * Gets the PGMPAGE structure for a guest page together with the PGMRAMRANGE. … … 3201 3211 } 3202 3212 3213 3203 3214 /** 3204 3215 * Sets (bitwise OR) flags associated with a RAM address. … … 3244 3255 } 3245 3256 3257 3246 3258 /** 3247 3259 * Calculated the guest physical address of the large (4 MB) page in 32 bits paging mode. … … 3259 3271 return GCPhys & pPGM->GCPhys4MBPSEMask; 3260 3272 } 3273 3261 3274 3262 3275 /** … … 3382 3395 3383 3396 #ifndef IN_GC 3397 3384 3398 /** 3385 3399 * Gets the page directory pointer entry for the specified address. … … 3412 3426 } 3413 3427 3428 3414 3429 /** 3415 3430 * Gets the page directory entry for the specified address. … … 3457 3472 } 3458 3473 3474 3459 3475 /** 3460 3476 * Gets the page directory entry for the specified address. … … 3498 3514 } 3499 3515 3516 3500 3517 /** 3501 3518 * Gets the page directory entry for the specified address. … … 3585 3602 return 0ULL; 3586 3603 } 3604 3587 3605 3588 3606 /** … … 3845 3863 * Just deal with the simple case here. 3846 3864 */ 3847 # ifdef LOG_ENABLED3865 # ifdef LOG_ENABLED 3848 3866 const RTHCPHYS HCPhysOrg = pPhysPage->HCPhys; /** @todo PAGE FLAGS */ 3849 # endif3867 # endif 3850 3868 const unsigned cRefs = pPhysPage->HCPhys >> MM_RAM_FLAGS_CREFS_SHIFT; /** @todo PAGE FLAGS */ 3851 3869 if (cRefs == 1) … … 3858 3876 LogFlow(("pgmTrackDerefGCPhys: HCPhys=%RHp -> %RHp\n", HCPhysOrg, pPhysPage->HCPhys)); 3859 3877 } 3860 #endif 3878 #endif /* PGMPOOL_WITH_GCPHYS_TRACKING */ 3861 3879 3862 3880 … … 3916 3934 3917 3935 #endif 3936 -
trunk/src/VBox/VMM/PGMMap.cpp
r13087 r13236 40 40 * Internal Functions * 41 41 *******************************************************************************/ 42 static void 43 static void 44 static int 45 static void 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); 46 46 47 47 … … 786 786 } 787 787 788 788 789 /** 789 790 * Relocates a mapping to a new address. … … 951 952 return VERR_PGM_NO_HYPERVISOR_ADDRESS; 952 953 } 954 953 955 954 956 /** … … 1027 1029 } 1028 1030 1031 1029 1032 /** 1030 1033 * Checks guest PD for conflicts with VMM GC mappings. … … 1075 1078 } 1076 1079 } 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) 1080 1082 { 1081 1083 for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3) … … 1129 1131 VMMR3DECL(int) PGMR3MapRead(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb) 1130 1132 { 1131 /** @todo remove this simplicity hack */1132 1133 /* 1133 1134 * Simplicity over speed... Chop the request up into chunks -
trunk/src/VBox/VMM/PGMShw.h
r13067 r13236 115 115 #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. */ 116 116 /* 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); 118 118 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), 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); 121 121 #endif /* Not AMD64 shadow paging. */ 122 122 123 123 /* 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); 125 125 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), 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); 128 128 } 129 129 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r13085 r13236 164 164 } 165 165 166 167 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE168 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.