Changeset 72770 in vbox
- Timestamp:
- Jun 29, 2018 11:19:30 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123311
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/HM.cpp
r72769 r72770 2936 2936 && !pVM->hm.s.vmx.fUnrestrictedGuest) 2937 2937 { 2938 if ( 2939 || CPUMIsGuestInRealModeEx(pCtx)) 2938 if ( !pVM->hm.s.fNestedPaging /* Requires a fake PD for real *and* protected mode without paging - stored in the VMM device heap */ 2939 || CPUMIsGuestInRealModeEx(pCtx)) /* Requires a fake TSS for real mode - stored in the VMM device heap */ 2940 2940 return false; 2941 2941 … … 2947 2947 /* Windows XP; switch to protected mode; all selectors are marked not present in the 2948 2948 * hidden registers (possible recompiler bug; see load_seg_vm) */ 2949 /** @todo Is this supposed recompiler bug still relevant with IEM? */ 2949 2950 if (pCtx->cs.Attr.n.u1Present == 0) 2950 2951 return false; … … 2964 2965 if (pVM->hm.s.vmx.fEnabled) 2965 2966 { 2966 uint32_t mask; 2967 2968 /* if bit N is set in cr0_fixed0, then it must be set in the guest's cr0. */ 2969 mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr0Fixed0; 2970 /* Note: We ignore the NE bit here on purpose; see vmmr0\hmr0.cpp for details. */ 2971 mask &= ~X86_CR0_NE; 2967 uint32_t uCR0Mask; 2968 2969 /* If bit N is set in cr0_fixed0, then it must be set in the guest's cr0. */ 2970 uCR0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr0Fixed0; 2971 2972 /* We ignore the NE bit here on purpose; see HMR0.cpp for details. */ 2973 uCR0Mask &= ~X86_CR0_NE; 2972 2974 2973 2975 if (fSupportsRealMode) 2974 2976 { 2975 /* Note:We ignore the PE & PG bits here on purpose; we emulate real and protected mode without paging. */2976 mask &= ~(X86_CR0_PG|X86_CR0_PE);2977 /* We ignore the PE & PG bits here on purpose; we emulate real and protected mode without paging. */ 2978 uCR0Mask &= ~(X86_CR0_PG|X86_CR0_PE); 2977 2979 } 2978 2980 else 2979 2981 { 2980 2982 /* We support protected mode without paging using identity mapping. */ 2981 mask &= ~X86_CR0_PG;2983 uCR0Mask &= ~X86_CR0_PG; 2982 2984 } 2983 if ((pCtx->cr0 & mask) != mask)2985 if ((pCtx->cr0 & uCR0Mask) != uCR0Mask) 2984 2986 return false; 2985 2987 2986 /* if bit N is cleared in cr0_fixed1, then it must be zero in the guest's cr0. */2987 mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr0Fixed1;2988 if ((pCtx->cr0 & mask) != 0)2988 /* If bit N is cleared in cr0_fixed1, then it must be zero in the guest's cr0. */ 2989 uCR0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr0Fixed1; 2990 if ((pCtx->cr0 & uCR0Mask) != 0) 2989 2991 return false; 2990 2992 2991 /* if bit N is set in cr4_fixed0, then it must be set in the guest's cr4. */2992 mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr4Fixed0;2993 mask &= ~X86_CR4_VMXE;2994 if ((pCtx->cr4 & mask) != mask)2993 /* If bit N is set in cr4_fixed0, then it must be set in the guest's cr4. */ 2994 uCR0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr4Fixed0; 2995 uCR0Mask &= ~X86_CR4_VMXE; 2996 if ((pCtx->cr4 & uCR0Mask) != uCR0Mask) 2995 2997 return false; 2996 2998 2997 /* if bit N is cleared in cr4_fixed1, then it must be zero in the guest's cr4. */2998 mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr4Fixed1;2999 if ((pCtx->cr4 & mask) != 0)2999 /* If bit N is cleared in cr4_fixed1, then it must be zero in the guest's cr4. */ 3000 uCR0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr4Fixed1; 3001 if ((pCtx->cr4 & uCR0Mask) != 0) 3000 3002 return false; 3001 3003
Note:
See TracChangeset
for help on using the changeset viewer.