Changeset 73294 in vbox
- Timestamp:
- Jul 21, 2018 3:26:11 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/HM.cpp
r73293 r73294 1557 1557 * Reports MSR_IA32_VMX_MISC MSR to the log. 1558 1558 * 1559 * @param pVM Pointer to the VM. 1559 1560 * @param fMisc The VMX misc. MSR value. 1560 1561 */ … … 1677 1678 1678 1679 /* 1679 * EPT and un hampered guest execution are determined in HMR3Init, verify the sanity of that.1680 * EPT and unrestricted guest execution are determined in HMR3Init, verify the sanity of that. 1680 1681 */ 1681 1682 AssertLogRelReturn( !pVM->hm.s.fNestedPaging … … 2907 2908 2908 2909 /** 2909 * Checks if we can currently use hardware accelerated rawmode.2910 * Checks if we can currently use hardware accelerated mode. 2910 2911 * 2911 2912 * @returns true if we can currently use hardware acceleration, otherwise false. 2912 2913 * @param pVM The cross context VM structure. 2913 * @param pCtx P artial VM executioncontext.2914 * @param pCtx Pointer to the guest CPU context. 2914 2915 */ 2915 2916 VMMR3DECL(bool) HMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx) … … 3061 3062 if (pVM->hm.s.vmx.fEnabled) 3062 3063 { 3063 uint32_t uC R0Mask;3064 uint32_t uCr0Mask; 3064 3065 3065 3066 /* If bit N is set in cr0_fixed0, then it must be set in the guest's cr0. */ 3066 uC R0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr0Fixed0;3067 uCr0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr0Fixed0; 3067 3068 3068 3069 /* We ignore the NE bit here on purpose; see HMR0.cpp for details. */ 3069 uC R0Mask &= ~X86_CR0_NE;3070 uCr0Mask &= ~X86_CR0_NE; 3070 3071 3071 3072 if (fSupportsRealMode) 3072 3073 { 3073 3074 /* We ignore the PE & PG bits here on purpose; we emulate real and protected mode without paging. */ 3074 uC R0Mask &= ~(X86_CR0_PG|X86_CR0_PE);3075 uCr0Mask &= ~(X86_CR0_PG|X86_CR0_PE); 3075 3076 } 3076 3077 else 3077 3078 { 3078 3079 /* We support protected mode without paging using identity mapping. */ 3079 uC R0Mask &= ~X86_CR0_PG;3080 uCr0Mask &= ~X86_CR0_PG; 3080 3081 } 3081 if ((pCtx->cr0 & uC R0Mask) != uCR0Mask)3082 if ((pCtx->cr0 & uCr0Mask) != uCr0Mask) 3082 3083 return false; 3083 3084 3084 3085 /* If bit N is cleared in cr0_fixed1, then it must be zero in the guest's cr0. */ 3085 uC R0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr0Fixed1;3086 if ((pCtx->cr0 & uC R0Mask) != 0)3086 uCr0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr0Fixed1; 3087 if ((pCtx->cr0 & uCr0Mask) != 0) 3087 3088 return false; 3088 3089 3089 3090 /* If bit N is set in cr4_fixed0, then it must be set in the guest's cr4. */ 3090 uC R0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr4Fixed0;3091 uC R0Mask &= ~X86_CR4_VMXE;3092 if ((pCtx->cr4 & uC R0Mask) != uCR0Mask)3091 uCr0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr4Fixed0; 3092 uCr0Mask &= ~X86_CR4_VMXE; 3093 if ((pCtx->cr4 & uCr0Mask) != uCr0Mask) 3093 3094 return false; 3094 3095 3095 3096 /* If bit N is cleared in cr4_fixed1, then it must be zero in the guest's cr4. */ 3096 uC R0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr4Fixed1;3097 if ((pCtx->cr4 & uC R0Mask) != 0)3097 uCr0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr4Fixed1; 3098 if ((pCtx->cr4 & uCr0Mask) != 0) 3098 3099 return false; 3099 3100 … … 3349 3350 VMMR3_INT_DECL(bool) HMR3IsEventPending(PVMCPU pVCpu) 3350 3351 { 3351 return HMIsEnabled(pVCpu->pVMR3) && pVCpu->hm.s.Event.fPending; 3352 return HMIsEnabled(pVCpu->pVMR3) 3353 && pVCpu->hm.s.Event.fPending; 3352 3354 } 3353 3355
Note:
See TracChangeset
for help on using the changeset viewer.