Changeset 77569 in vbox
- Timestamp:
- Mar 6, 2019 8:18:51 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/iem.h
r77380 r77569 225 225 226 226 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 227 /** @todo NSTVMX: Refine this mask later (probably some MSRs are not required). */ 228 # define IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK CPUMCTX_EXTRN_ABSOLUTELY_ALL 229 # define IEM_CPUMCTX_EXTRN_VMX_VMENTRY_MASK IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK 227 # define IEM_CPUMCTX_EXTRN_VMX_VMENTRY_MASK ( IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK \ 228 | CPUMCTX_EXTRN_HWVIRT ) 230 229 #endif 231 230 -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r77382 r77569 15746 15746 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVirtApicAccessMsr(PVMCPU pVCpu, uint32_t idMsr, uint64_t *pu64Value, bool fWrite) 15747 15747 { 15748 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_EXEC_DECODED_NO_MEM_MASK);15749 15748 Assert(pu64Value); 15750 15749 … … 15780 15779 bool fWrite) 15781 15780 { 15782 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15783 15781 Assert(pvData); 15784 15782 … … 15804 15802 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitApicWrite(PVMCPU pVCpu) 15805 15803 { 15806 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15807 15808 15804 VBOXSTRICTRC rcStrict = iemVmxApicWriteEmulation(pVCpu); 15809 15805 if (pVCpu->iem.s.cActiveMappings) … … 15822 15818 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitPreemptTimer(PVMCPU pVCpu) 15823 15819 { 15824 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15825 15820 VBOXSTRICTRC rcStrict = iemVmxVmexitPreemptTimer(pVCpu); 15826 15821 if (pVCpu->iem.s.cActiveMappings) … … 15843 15838 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitExtInt(PVMCPU pVCpu, uint8_t uVector, bool fIntPending) 15844 15839 { 15845 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15846 15840 VBOXSTRICTRC rcStrict = iemVmxVmexitExtInt(pVCpu, uVector, fIntPending); 15847 15841 if (pVCpu->iem.s.cActiveMappings) … … 15861 15855 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitStartupIpi(PVMCPU pVCpu, uint8_t uVector) 15862 15856 { 15863 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15864 15857 VBOXSTRICTRC rcStrict = iemVmxVmexitStartupIpi(pVCpu, uVector); 15865 15858 if (pVCpu->iem.s.cActiveMappings) … … 15878 15871 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitInitIpi(PVMCPU pVCpu) 15879 15872 { 15880 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15881 15873 VBOXSTRICTRC rcStrict = iemVmxVmexitInitIpi(pVCpu); 15882 15874 if (pVCpu->iem.s.cActiveMappings) … … 15895 15887 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitIntWindow(PVMCPU pVCpu) 15896 15888 { 15897 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15898 15889 VBOXSTRICTRC rcStrict = iemVmxVmexitIntWindow(pVCpu); 15899 15890 if (pVCpu->iem.s.cActiveMappings) … … 15912 15903 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitMtf(PVMCPU pVCpu) 15913 15904 { 15914 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK);15915 15905 VBOXSTRICTRC rcStrict = iemVmxVmexitMtf(pVCpu); 15916 15906 if (pVCpu->iem.s.cActiveMappings) … … 16099 16089 16100 16090 iemInitExec(pVCpu, false /*fBypassHandlers*/); 16101 VBOXSTRICTRC rcStrict = iemVmxVmlaunchVmresume(pVCpu, cbInstr, 16091 VBOXSTRICTRC rcStrict = iemVmxVmlaunchVmresume(pVCpu, cbInstr, uInstrId); 16102 16092 if (pVCpu->iem.s.cActiveMappings) 16103 16093 iemMemRollback(pVCpu); -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r77548 r77569 1668 1668 * NewPt = 2 - 2 = 0 1669 1669 */ 1670 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 1670 1671 uint64_t const uCurTick = TMCpuTickGetNoCheck(pVCpu); 1671 1672 uint64_t const uVmentryTick = pVCpu->cpum.GstCtx.hwvirt.vmx.uVmentryTick; … … 1847 1848 * See Intel spec. 24.4.2 "Guest Non-Register State". 1848 1849 */ 1850 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_DR6); 1849 1851 uint64_t fPendingDbgMask = pVCpu->cpum.GstCtx.dr[6]; 1850 1852 uint64_t const fBpHitMask = VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP0 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP1 … … 2768 2770 return VINF_EM_RAW_EMULATE_INSTR; 2769 2771 # else 2770 IEM_CTX_ASSERT(pVCpu, IEM_CPUMCTX_EXTRN_VMX_VMEXIT_MASK); 2772 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_CR0 | CPUMCTX_EXTRN_CR3 | CPUMCTX_EXTRN_CR4 /* Control registers */ 2773 | CPUMCTX_EXTRN_DR7 | CPUMCTX_EXTRN_DR6 /* Debug registers */ 2774 | CPUMCTX_EXTRN_EFER /* MSRs */ 2775 | CPUMCTX_EXTRN_SYSENTER_MSRS 2776 | CPUMCTX_EXTRN_OTHER_MSRS /* PAT */ 2777 | CPUMCTX_EXTRN_RIP | CPUMCTX_EXTRN_RSP | CPUMCTX_EXTRN_RFLAGS /* GPRs */ 2778 | CPUMCTX_EXTRN_SREG_MASK /* Segment registers */ 2779 | CPUMCTX_EXTRN_TR /* Task register */ 2780 | CPUMCTX_EXTRN_LDTR | CPUMCTX_EXTRN_GDTR | CPUMCTX_EXTRN_IDTR /* Table registers */ 2781 | CPUMCTX_EXTRN_HWVIRT); /* Hardware virtualization state */ 2771 2782 2772 2783 PVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); … … 3789 3800 Assert(pVmcs); 3790 3801 3791 /* Check if the guest has enabled VMX-preemption timers in the first place. */3802 /* The VM-exit is subject to "Activate VMX-preemption timer" being set. */ 3792 3803 if (pVmcs->u32PinCtls & VMX_PIN_CTLS_PREEMPT_TIMER) 3793 3804 { 3805 /* Import the hardware virtualization state (for nested-guest VM-entry TSC-tick). */ 3806 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_HWVIRT); 3807 3794 3808 /* 3795 3809 * Calculate the current VMX-preemption timer value. … … 3832 3846 Assert(fIntPending || uVector == 0); 3833 3847 3834 /* The VM-exit is subject to "External interrupt exiting" is being set. */ 3848 /** @todo NSTVMX: r=ramshankar: Consider standardizing check basic/blanket 3849 * intercepts for VM-exits. Right now it is not clear which iemVmxVmexitXXX() 3850 * functions require prior checking of a blanket intercept and which don't. 3851 * It is better for the caller to check a blanket intercept performance wise 3852 * than making a function call. Leaving this as a todo because it is more 3853 * a performance issue. */ 3854 3855 /* The VM-exit is subject to "External interrupt exiting" being set. */ 3835 3856 if (pVmcs->u32PinCtls & VMX_PIN_CTLS_EXT_INT_EXIT) 3836 3857 { … … 4067 4088 else if (uVector == X86_XCPT_DB) 4068 4089 { 4069 IEM_CTX_ ASSERT(pVCpu, CPUMCTX_EXTRN_DR6);4090 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_DR6); 4070 4091 uExitQual = pVCpu->cpum.GstCtx.dr[6] & VMX_VMCS_EXIT_QUAL_VALID_MASK; 4071 4092 } … … 4220 4241 DECLINLINE(uint16_t) iemVmxVirtApicClearPendingWrite(PVMCPU pVCpu) 4221 4242 { 4243 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 4222 4244 uint8_t const offVirtApicWrite = pVCpu->cpum.GstCtx.hwvirt.vmx.offVirtApicWrite; 4223 4245 pVCpu->cpum.GstCtx.hwvirt.vmx.offVirtApicWrite = 0; … … 4992 5014 Assert(pVmcs); 4993 5015 5016 /* Import the virtual-APIC write offset (part of the hardware-virtualization state). */ 5017 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_HWVIRT); 5018 4994 5019 /* 4995 5020 * Perform APIC-write emulation based on the virtual-APIC register written. … … 5656 5681 * @param pszInstr The VMX instruction name (for logging purposes). 5657 5682 */ 5658 IEM_STATIC int iemVmxVmentryCheckGuestRipRFlags(PVMCPU pVCpu, 5683 IEM_STATIC int iemVmxVmentryCheckGuestRipRFlags(PVMCPU pVCpu, const char *pszInstr) 5659 5684 { 5660 5685 /* … … 6763 6788 */ 6764 6789 PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs); 6790 6791 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_CR0); 6765 6792 uint64_t const uGstCr0 = (pVmcs->u64GuestCr0.u & ~VMX_ENTRY_CR0_IGNORE_MASK) 6766 6793 | (pVCpu->cpum.GstCtx.cr0 & VMX_ENTRY_CR0_IGNORE_MASK); … … 6783 6810 if (!(pVmcs->u32EntryCtls & VMX_ENTRY_CTLS_LOAD_EFER_MSR)) 6784 6811 { 6785 bool const fGstInLongMode = RT_BOOL(pVmcs->u32EntryCtls & VMX_ENTRY_CTLS_IA32E_MODE_GUEST); 6786 bool const fGstPaging = RT_BOOL(uGstCr0 & X86_CR0_PG); 6787 uint64_t const uHostEfer = pVCpu->cpum.GstCtx.msrEFER; 6812 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_EFER); 6813 uint64_t const uHostEfer = pVCpu->cpum.GstCtx.msrEFER; 6814 bool const fGstInLongMode = RT_BOOL(pVmcs->u32EntryCtls & VMX_ENTRY_CTLS_IA32E_MODE_GUEST); 6815 bool const fGstPaging = RT_BOOL(uGstCr0 & X86_CR0_PG); 6788 6816 if (fGstInLongMode) 6789 6817 {
Note:
See TracChangeset
for help on using the changeset viewer.