Changeset 13037 in vbox
- Timestamp:
- Oct 7, 2008 11:10:32 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r13025 r13037 1007 1007 /* Note: protected mode & paging are always enabled; we use them for emulating real and protected mode without paging too. */ 1008 1008 val |= X86_CR0_PE | X86_CR0_PG; 1009 if (!pVM->hwaccm.s.fNestedPaging) 1009 if (pVM->hwaccm.s.fNestedPaging) 1010 { 1011 if (!(pCtx->cr0 & X86_CR0_PG)) 1012 { 1013 /* Reenable cr3 read/write monitoring as our identity mapped page table is active. */ 1014 pVM->hwaccm.s.vmx.proc_ctls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 1015 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT; 1016 } 1017 else 1018 { 1019 /* Disable cr3 read/write monitoring as we don't need it for EPT. */ 1020 pVM->hwaccm.s.vmx.proc_ctls &= ~( VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 1021 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT); 1022 } 1023 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVM->hwaccm.s.vmx.proc_ctls); 1024 AssertRC(rc); 1025 } 1026 else 1010 1027 { 1011 1028 /* Note: We must also set this as we rely on protecting various pages for which supervisor writes must be caught. */ … … 2353 2370 break; 2354 2371 case 3: 2355 Assert(!pVM->hwaccm.s.fNestedPaging );2372 Assert(!pVM->hwaccm.s.fNestedPaging || !(pCtx->cr0 & X86_CR0_PG)); 2356 2373 pVM->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR3; 2357 2374 break; … … 2381 2398 STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitCRxRead); 2382 2399 2383 Assert(!pVM->hwaccm.s.fNestedPaging || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3);2400 Assert(!pVM->hwaccm.s.fNestedPaging || !(pCtx->cr0 & X86_CR0_PG) || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3); 2384 2401 2385 2402 /* CR8 reads only cause an exit when the TPR shadow feature isn't present. */ -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r13035 r13037 44 44 #undef PGM_BTH_NAME 45 45 46 #define PGM_BTH_NAME(name) PGM_BTH_NAME_EPT_PROT(name) 47 #include "PGMR0Bth.h" 48 #undef PGM_BTH_NAME 49 46 50 __END_DECLS 47 51 … … 82 86 STAM_STATS({ pVM->pgm.s.CTXSUFF(pStatTrap0eAttribution) = NULL; } ); 83 87 84 /* AMD uses the host's paging mode; Intel 's version is on the todo list*/85 AssertMsg(enmShwPagingMode == PGMMODE_32_BIT || enmShwPagingMode == PGMMODE_PAE || enmShwPagingMode == PGMMODE_PAE_NX || enmShwPagingMode == PGMMODE_AMD64 || enmShwPagingMode == PGMMODE_AMD64_NX , ("enmShwPagingMode=%d\n", enmShwPagingMode));88 /* AMD uses the host's paging mode; Intel has a single mode (EPT). */ 89 AssertMsg(enmShwPagingMode == PGMMODE_32_BIT || enmShwPagingMode == PGMMODE_PAE || enmShwPagingMode == PGMMODE_PAE_NX || enmShwPagingMode == PGMMODE_AMD64 || enmShwPagingMode == PGMMODE_AMD64_NX || enmShwPagingMode == PGMMODE_EPT, ("enmShwPagingMode=%d\n", enmShwPagingMode)); 86 90 87 91 #ifdef VBOX_WITH_STATISTICS … … 144 148 rc = PGM_BTH_NAME_AMD64_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault); 145 149 break; 150 case PGMMODE_EPT: 151 rc = PGM_BTH_NAME_EPT_PROT(Trap0eHandler)(pVM, uErr, pRegFrame, pvFault); 152 break; 146 153 default: 147 154 AssertFailed();
Note:
See TracChangeset
for help on using the changeset viewer.