- Timestamp:
- Oct 5, 2018 3:37:25 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r74618 r74619 942 942 943 943 944 945 /**946 * Gets the nested-guest CR4 mask subjected to the CR0 guest/host mask and the CR4947 * read-shadow.948 *949 * @returns The masked CR0.950 * @param pVCpu The cross context virtual CPU structure.951 * @param uGuestCr0 The guest CR0.952 */953 IEM_STATIC uint64_t iemVmxGetMaskedCr0(PVMCPU pVCpu, uint64_t uGuestCr0)954 {955 PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);956 Assert(pVmcs);957 Assert(IEM_VMX_IS_NON_ROOT_MODE(pVCpu));958 959 /*960 * For each CR0 bit owned by the host, the corresponding bit is loaded from the961 * CR0-read shadow. For each CR0 bit that is not owned by the host, the corresponding962 * bit from the guest CR0 is loaded.963 *964 * See Intel Spec. 25.3 "Changes To Instruction Behavior In VMX Non-root Operation".965 */966 uint64_t const fGstHostMask = pVmcs->u64Cr0Mask.u;967 uint64_t const fReadShadow = pVmcs->u64Cr0ReadShadow.u;968 uint64_t const fMaskedCr0 = (fReadShadow & fGstHostMask) | (uGuestCr0 & ~fGstHostMask);969 970 return fMaskedCr0;971 }972 973 974 944 /** 975 945 * Gets VM-exit instruction information along with any displacement for an
Note:
See TracChangeset
for help on using the changeset viewer.