Changeset 73246 in vbox for trunk/src/VBox/VMM/VMMR3/PGMShw.h
- Timestamp:
- Jul 19, 2018 3:51:20 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGMShw.h
r71222 r73246 111 111 RT_C_DECLS_BEGIN 112 112 /* r3 */ 113 PGM_SHW_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0);114 113 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode); 115 114 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); … … 123 122 124 123 /** 125 * Initializes the guest bit of the paging mode data.126 *127 * @returns VBox status code.128 * @param pVM The cross context VM structure.129 * @param pModeData The pointer table to initialize (our members only).130 * @param fResolveGCAndR0 Indicate whether or not GC and Ring-0 symbols can be resolved now.131 * This is used early in the init process to avoid trouble with PDM132 * not being initialized yet.133 */134 PGM_SHW_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0)135 {136 #if PGM_SHW_TYPE != PGM_TYPE_NESTED137 Assert(pModeData->uShwType == PGM_SHW_TYPE || pModeData->uShwType == PGM_TYPE_NESTED);138 #else139 Assert(pModeData->uShwType == PGM_SHW_TYPE);140 #endif141 142 /* Ring-3 */143 pModeData->pfnR3ShwRelocate = PGM_SHW_NAME(Relocate);144 pModeData->pfnR3ShwExit = PGM_SHW_NAME(Exit);145 pModeData->pfnR3ShwGetPage = PGM_SHW_NAME(GetPage);146 pModeData->pfnR3ShwModifyPage = PGM_SHW_NAME(ModifyPage);147 148 if (fResolveGCAndR0)149 {150 int rc;151 152 if (VM_IS_RAW_MODE_ENABLED(pVM))153 {154 #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. */155 /* GC */156 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(GetPage), &pModeData->pfnRCShwGetPage);157 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_RC_STR(GetPage), rc), rc);158 rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_SHW_NAME_RC_STR(ModifyPage), &pModeData->pfnRCShwModifyPage);159 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_RC_STR(ModifyPage), rc), rc);160 #endif /* Not AMD64 shadow paging. */161 }162 163 /* Ring-0 */164 rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(GetPage), &pModeData->pfnR0ShwGetPage);165 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_R0_STR(GetPage), rc), rc);166 rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_SHW_NAME_R0_STR(ModifyPage), &pModeData->pfnR0ShwModifyPage);167 AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_SHW_NAME_R0_STR(ModifyPage), rc), rc);168 }169 return VINF_SUCCESS;170 }171 172 /**173 124 * Enters the shadow mode. 174 125 * … … 179 130 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu, bool fIs64BitsPagingMode) 180 131 { 181 #if PGM_ SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT182 183 # if PGM_ SHW_TYPE == PGM_TYPE_NESTED&& HC_ARCH_BITS == 32132 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 133 134 # if PGM_TYPE_IS_NESTED(PGM_SHW_TYPE) && HC_ARCH_BITS == 32 184 135 /* Must distinguish between 32 and 64 bits guest paging modes as we'll use 185 136 a different shadow paging root/mode in both cases. */ … … 239 190 PGM_SHW_DECL(int, Exit)(PVMCPU pVCpu) 240 191 { 192 #if PGM_TYPE_IS_NESTED_OR_EPT(PGM_SHW_TYPE) 241 193 PVM pVM = pVCpu->pVMR3; 242 243 if ( ( pVCpu->pgm.s.enmShadowMode == PGMMODE_NESTED 244 || pVCpu->pgm.s.enmShadowMode == PGMMODE_EPT) 245 && pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)) 194 if (pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)) 246 195 { 247 196 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); … … 265 214 Log(("Leave nested shadow paging mode\n")); 266 215 } 216 #else 217 RT_NOREF_PV(pVCpu); 218 #endif 267 219 return VINF_SUCCESS; 268 220 }
Note:
See TracChangeset
for help on using the changeset viewer.