Changeset 78864 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
- Timestamp:
- May 30, 2019 5:22:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r78776 r78864 7736 7736 7737 7737 /** 7738 * Checks whether a VMREAD or VMWRITE instruction for the given VMCS field is7739 * intercepted (causes a VM-exit) or not.7740 *7741 * @returns @c true if the instruction is intercepted, @c false otherwise.7742 * @param pVCpu The cross context virtual CPU structure.7743 * @param u64FieldEnc The VMCS field encoding.7744 * @param uExitReason The VM-exit reason (VMX_EXIT_VMREAD or7745 * VMX_EXIT_VMREAD).7746 */7747 IEM_STATIC bool iemVmxIsVmreadVmwriteInterceptSet(PCVMCPU pVCpu, uint32_t uExitReason, uint64_t u64FieldEnc)7748 {7749 Assert(IEM_VMX_IS_NON_ROOT_MODE(pVCpu));7750 Assert( uExitReason == VMX_EXIT_VMREAD7751 || uExitReason == VMX_EXIT_VMWRITE);7752 7753 /* Without VMCS shadowing, all VMREAD and VMWRITE instructions are intercepted. */7754 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmxVmcsShadowing)7755 return true;7756 7757 /*7758 * If any reserved bit in the 64-bit VMCS field encoding is set, the VMREAD/VMWRITE is intercepted.7759 * This excludes any reserved bits in the valid parts of the field encoding (i.e. bit 12).7760 */7761 if (u64FieldEnc & VMX_VMCS_ENC_RSVD_MASK)7762 return true;7763 7764 /* Finally, consult the VMREAD/VMWRITE bitmap whether to intercept the instruction or not. */7765 uint32_t const u32FieldEnc = RT_LO_U32(u64FieldEnc);7766 Assert(u32FieldEnc >> 3 < VMX_V_VMREAD_VMWRITE_BITMAP_SIZE);7767 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvVmreadBitmap));7768 uint8_t const *pbBitmap = uExitReason == VMX_EXIT_VMREAD7769 ? (uint8_t const *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvVmreadBitmap)7770 : (uint8_t const *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvVmwriteBitmap);7771 pbBitmap += (u32FieldEnc >> 3);7772 if (*pbBitmap & RT_BIT(u32FieldEnc & 7))7773 return true;7774 7775 return false;7776 }7777 7778 7779 /**7780 7738 * VMREAD common (memory/register) instruction execution worker 7781 7739 * … … 7794 7752 /* Nested-guest intercept. */ 7795 7753 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 7796 && iemVmxIsVmreadVmwriteInterceptSet(pVCpu, VMX_EXIT_VMREAD, u64FieldEnc))7754 && CPUMIsGuestVmxVmreadVmwriteInterceptSet(pVCpu, VMX_EXIT_VMREAD, u64FieldEnc)) 7797 7755 { 7798 7756 if (pExitInfo) … … 8010 7968 /* Nested-guest intercept. */ 8011 7969 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 8012 && iemVmxIsVmreadVmwriteInterceptSet(pVCpu, VMX_EXIT_VMWRITE, u64FieldEnc))7970 && CPUMIsGuestVmxVmreadVmwriteInterceptSet(pVCpu, VMX_EXIT_VMWRITE, u64FieldEnc)) 8013 7971 { 8014 7972 if (pExitInfo)
Note:
See TracChangeset
for help on using the changeset viewer.