Changeset 13174 in vbox
- Timestamp:
- Oct 10, 2008 1:29:27 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/cpum.h
r13005 r13174 744 744 745 745 /** 746 * Tests if the guest is running in paged protected or not. 747 * 748 * @returns true if in paged protected mode, otherwise false. 749 * @param pVM The VM handle. 750 */ 751 DECLINLINE(bool) CPUMIsGuestInPagedProtectedModeEx(PCPUMCTX pCtx) 752 { 753 return (pCtx->cr0 & (X86_CR0_PE | X86_CR0_PG)) == (X86_CR0_PE | X86_CR0_PG); 754 } 755 756 /** 746 757 * Tests if the guest is running in long mode or not. 747 758 * -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r13173 r13174 1076 1076 if (pVM->hwaccm.s.fNestedPaging) 1077 1077 { 1078 if (!(pCtx->cr0 & X86_CR0_PG)) 1078 if (CPUMIsGuestInPagedProtectedModeEx(pCtx)) 1079 { 1080 /* Disable cr3 read/write monitoring as we don't need it for EPT. */ 1081 pVM->hwaccm.s.vmx.proc_ctls &= ~( VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 1082 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT); 1083 } 1084 else 1079 1085 { 1080 1086 /* Reenable cr3 read/write monitoring as our identity mapped page table is active. */ 1081 1087 pVM->hwaccm.s.vmx.proc_ctls |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT 1082 1088 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT; 1083 }1084 else1085 {1086 /* Disable cr3 read/write monitoring as we don't need it for EPT. */1087 pVM->hwaccm.s.vmx.proc_ctls &= ~( VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_LOAD_EXIT1088 | VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR3_STORE_EXIT);1089 1089 } 1090 1090 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVM->hwaccm.s.vmx.proc_ctls); … … 1207 1207 AssertRC(rc); 1208 1208 1209 if (! (pCtx->cr0 & X86_CR0_PG))1209 if (!CPUMIsGuestInPagedProtectedModeEx(pCtx)) 1210 1210 { 1211 1211 RTGCPHYS GCPhys; … … 2446 2446 break; 2447 2447 case 3: 2448 Assert(!pVM->hwaccm.s.fNestedPaging || ! (pCtx->cr0 & X86_CR0_PG));2448 Assert(!pVM->hwaccm.s.fNestedPaging || !CPUMIsGuestInPagedProtectedModeEx(pCtx)); 2449 2449 pVM->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR3; 2450 2450 break; … … 2474 2474 STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitCRxRead); 2475 2475 2476 Assert(!pVM->hwaccm.s.fNestedPaging || ! (pCtx->cr0 & X86_CR0_PG) || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3);2476 Assert(!pVM->hwaccm.s.fNestedPaging || !CPUMIsGuestInPagedProtectedModeEx(pCtx) || VMX_EXIT_QUALIFICATION_CRX_REGISTER(exitQualification) != USE_REG_CR3); 2477 2477 2478 2478 /* CR8 reads only cause an exit when the TPR shadow feature isn't present. */
Note:
See TracChangeset
for help on using the changeset viewer.