Changeset 79233 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 19, 2019 8:25:43 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131411
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r79220 r79233 808 808 * Implements VMSucceed for VMX instruction success. 809 809 * 810 * @param pVCpu 810 * @param pVCpu The cross context virtual CPU structure. 811 811 */ 812 812 DECL_FORCE_INLINE(void) iemVmxVmSucceed(PVMCPU pVCpu) … … 819 819 * Implements VMFailInvalid for VMX instruction failure. 820 820 * 821 * @param pVCpu 821 * @param pVCpu The cross context virtual CPU structure. 822 822 */ 823 823 DECL_FORCE_INLINE(void) iemVmxVmFailInvalid(PVMCPU pVCpu) … … 844 844 * 845 845 * @returns @c true if it's within the valid limit, @c false otherwise. 846 * @param pVCpu 847 * @param uMsrCount 846 * @param pVCpu The cross context virtual CPU structure. 847 * @param uMsrCount The MSR area count to check. 848 848 */ 849 849 DECL_FORCE_INLINE(bool) iemVmxIsAutoMsrCountValid(PCVMCPU pVCpu, uint32_t uMsrCount) … … 862 862 * 863 863 * @returns VBox status code. 864 * @param pVCpu 864 * @param pVCpu The cross context virtual CPU structure. 865 865 */ 866 866 DECL_FORCE_INLINE(int) iemVmxCommitCurrentVmcsToMemory(PVMCPU pVCpu) 867 867 { 868 868 Assert(IEM_VMX_HAS_CURRENT_VMCS(pVCpu)); 869 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs)); 869 870 int rc = PGMPhysSimpleWriteGCPhys(pVCpu->CTX_SUFF(pVM), IEM_VMX_GET_CURRENT_VMCS(pVCpu), 870 871 pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs), sizeof(VMXVVMCS)); … … 877 878 * Implements VMSucceed for the VMREAD instruction and increments the guest RIP. 878 879 * 879 * @param pVCpu 880 * @param pVCpu The cross context virtual CPU structure. 880 881 */ 881 882 DECL_FORCE_INLINE(void) iemVmxVmreadSuccess(PVMCPU pVCpu, uint8_t cbInstr) … … 1139 1140 * VM-exit. 1140 1141 * 1141 * @param pVCpu 1142 * @param pVCpu The cross context virtual CPU structure. 1142 1143 */ 1143 1144 IEM_STATIC void iemVmxVmexitSaveGuestControlRegsMsrs(PVMCPU pVCpu) … … 1192 1193 * Saves the guest force-flags in preparation of entering the nested-guest. 1193 1194 * 1194 * @param pVCpu 1195 * @param pVCpu The cross context virtual CPU structure. 1195 1196 */ 1196 1197 IEM_STATIC void iemVmxVmentrySaveNmiBlockingFF(PVMCPU pVCpu) … … 1233 1234 * Restores the guest force-flags in preparation of exiting the nested-guest. 1234 1235 * 1235 * @param pVCpu 1236 * @param pVCpu The cross context virtual CPU structure. 1236 1237 */ 1237 1238 IEM_STATIC void iemVmxVmexitRestoreNmiBlockingFF(PVMCPU pVCpu) … … 1248 1249 * Perform a VMX transition updated PGM, IEM and CPUM. 1249 1250 * 1250 * @param pVCpu 1251 * @param pVCpu The cross context virtual CPU structure. 1251 1252 */ 1252 1253 IEM_STATIC int iemVmxWorldSwitch(PVMCPU pVCpu) … … 1285 1286 * Calculates the current VMX-preemption timer value. 1286 1287 * 1287 * @param pVCpu The cross context virtual CPU structure. 1288 * @returns The current VMX-preemption timer value. 1289 * @param pVCpu The cross context virtual CPU structure. 1288 1290 */ 1289 1291 IEM_STATIC uint32_t iemVmxCalcPreemptTimer(PVMCPU pVCpu) … … 1332 1334 * Saves guest segment registers, GDTR, IDTR, LDTR, TR as part of VM-exit. 1333 1335 * 1334 * @param pVCpu 1336 * @param pVCpu The cross context virtual CPU structure. 1335 1337 */ 1336 1338 IEM_STATIC void iemVmxVmexitSaveGuestSegRegs(PVMCPU pVCpu) … … 2772 2774 * 2773 2775 * @returns Strict VBox status code. 2774 * @param pVCpu 2775 * @param GCPtrPage 2776 * @param cbInstr 2776 * @param pVCpu The cross context virtual CPU structure. 2777 * @param GCPtrPage The guest-linear address of the page being invalidated. 2778 * @param cbInstr The instruction length in bytes. 2777 2779 */ 2778 2780 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInstrInvlpg(PVMCPU pVCpu, RTGCPTR GCPtrPage, uint8_t cbInstr) … … 2908 2910 * 2909 2911 * @returns Strict VBox status code. 2910 * @param pVCpu 2911 * @param iCrReg 2912 * @param uGuestCrX 2913 * @param puNewCrX Pointer to the new CR0/CR4 value. Will be updated2914 * if noVM-exit is caused.2915 * @param iGReg The general register from which the CR0/CR4 value is2916 * beingloaded.2917 * @param cbInstr 2912 * @param pVCpu The cross context virtual CPU structure. 2913 * @param iCrReg The control register (either CR0 or CR4). 2914 * @param uGuestCrX The current guest CR0/CR4. 2915 * @param puNewCrX Pointer to the new CR0/CR4 value. Will be updated if no 2916 * VM-exit is caused. 2917 * @param iGReg The general register from which the CR0/CR4 value is being 2918 * loaded. 2919 * @param cbInstr The instruction length in bytes. 2918 2920 */ 2919 2921 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInstrMovToCr0Cr4(PVMCPU pVCpu, uint8_t iCrReg, uint64_t *puNewCrX, uint8_t iGReg, … … 3316 3318 * 3317 3319 * @returns VBox strict status code. 3318 * @param pVCpu 3319 * @param cbInstr 3320 * @param pVCpu The cross context virtual CPU structure. 3321 * @param cbInstr The instruction length in bytes. 3320 3322 */ 3321 3323 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInstrPause(PVMCPU pVCpu, uint8_t cbInstr) … … 3487 3489 * 3488 3490 * @returns VBox strict status code. 3489 * @param pVCpu 3491 * @param pVCpu The cross context virtual CPU structure. 3490 3492 */ 3491 3493 IEM_STATIC VBOXSTRICTRC iemVmxVmexitPreemptTimer(PVMCPU pVCpu) … … 3595 3597 * 3596 3598 * @returns VBox strict status code. 3597 * @param pVCpu 3599 * @param pVCpu The cross context virtual CPU structure. 3598 3600 */ 3599 3601 IEM_STATIC VBOXSTRICTRC iemVmxVmexitEventDoubleFault(PVMCPU pVCpu) … … 3641 3643 * 3642 3644 * @returns VBox strict status code. 3643 * @param pVCpu 3644 * @param pExitInfo 3645 * @param pExitEventInfo 3645 * @param pVCpu The cross context virtual CPU structure. 3646 * @param pExitInfo Pointer to the VM-exit information. 3647 * @param pExitEventInfo Pointer to the VM-exit event information. 3646 3648 */ 3647 3649 IEM_STATIC VBOXSTRICTRC iemVmxVmexitEventWithInfo(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo, PCVMXVEXITEVENTINFO pExitEventInfo) … … 3789 3791 * 3790 3792 * @returns VBox strict status code. 3791 * @param pVCpu 3793 * @param pVCpu The cross context virtual CPU structure. 3792 3794 */ 3793 3795 IEM_STATIC VBOXSTRICTRC iemVmxVmexitTripleFault(PVMCPU pVCpu) … … 3845 3847 * 3846 3848 * @returns VBox strict status code. 3847 * @param pVCpu 3848 * @param pExitInfo 3849 * @param pExitEventInfo 3849 * @param pVCpu The cross context virtual CPU structure. 3850 * @param pExitInfo Pointer to the VM-exit information. 3851 * @param pExitEventInfo Pointer to the VM-exit event information. 3850 3852 */ 3851 3853 IEM_STATIC VBOXSTRICTRC iemVmxVmexitApicAccessWithInfo(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo, … … 3908 3910 * 3909 3911 * @returns The virtual-APIC offset that was written before clearing it. 3910 * @param pVCpu 3912 * @param pVCpu The cross context virtual CPU structure. 3911 3913 */ 3912 3914 DECLINLINE(uint16_t) iemVmxVirtApicClearPendingWrite(PVMCPU pVCpu) … … 3925 3927 * 3926 3928 * @returns The register from the virtual-APIC page. 3927 * @param pVCpu 3928 * @param offReg 3929 * @param pVCpu The cross context virtual CPU structure. 3930 * @param offReg The offset of the register being read. 3929 3931 */ 3930 3932 IEM_STATIC uint32_t iemVmxVirtApicReadRaw32(PVMCPU pVCpu, uint16_t offReg) … … 3951 3953 * 3952 3954 * @returns The register from the virtual-APIC page. 3953 * @param pVCpu 3954 * @param offReg 3955 * @param pVCpu The cross context virtual CPU structure. 3956 * @param offReg The offset of the register being read. 3955 3957 */ 3956 3958 IEM_STATIC uint64_t iemVmxVirtApicReadRaw64(PVMCPU pVCpu, uint16_t offReg) … … 3976 3978 * Writes a 32-bit register to the virtual-APIC page at the given offset. 3977 3979 * 3978 * @param pVCpu 3979 * @param offReg 3980 * @param uReg 3980 * @param pVCpu The cross context virtual CPU structure. 3981 * @param offReg The offset of the register being written. 3982 * @param uReg The register value to write. 3981 3983 */ 3982 3984 IEM_STATIC void iemVmxVirtApicWriteRaw32(PVMCPU pVCpu, uint16_t offReg, uint32_t uReg) … … 3998 4000 * Writes a 64-bit register to the virtual-APIC page at the given offset. 3999 4001 * 4000 * @param pVCpu 4001 * @param offReg 4002 * @param uReg 4002 * @param pVCpu The cross context virtual CPU structure. 4003 * @param offReg The offset of the register being written. 4004 * @param uReg The register value to write. 4003 4005 */ 4004 4006 IEM_STATIC void iemVmxVirtApicWriteRaw64(PVMCPU pVCpu, uint16_t offReg, uint64_t uReg) … … 4541 4543 * Evaluates pending virtual interrupts. 4542 4544 * 4543 * @param pVCpu 4545 * @param pVCpu The cross context virtual CPU structure. 4544 4546 */ 4545 4547 IEM_STATIC void iemVmxEvalPendingVirtIntrs(PVMCPU pVCpu) … … 4569 4571 * 4570 4572 * @returns VBox strict status code. 4571 * @param pVCpu 4573 * @param pVCpu The cross context virtual CPU structure. 4572 4574 */ 4573 4575 IEM_STATIC void iemVmxPprVirtualization(PVMCPU pVCpu) … … 4602 4604 * 4603 4605 * @returns VBox strict status code. 4604 * @param pVCpu 4606 * @param pVCpu The cross context virtual CPU structure. 4605 4607 */ 4606 4608 IEM_STATIC VBOXSTRICTRC iemVmxTprVirtualization(PVMCPU pVCpu) … … 4713 4715 * 4714 4716 * @returns VBox strict status code. 4715 * @param pVCpu 4717 * @param pVCpu The cross context virtual CPU structure. 4716 4718 */ 4717 4719 IEM_STATIC VBOXSTRICTRC iemVmxSelfIpiVirtualization(PVMCPU pVCpu) … … 4743 4745 * 4744 4746 * @returns VBox strict status code. 4745 * @param pVCpu 4747 * @param pVCpu The cross context virtual CPU structure. 4746 4748 */ 4747 4749 IEM_STATIC VBOXSTRICTRC iemVmxApicWriteEmulation(PVMCPU pVCpu) … … 4980 4982 * Checks guest segment registers, LDTR and TR as part of VM-entry. 4981 4983 * 4982 * @param pVCpu 4983 * @param pszInstr 4984 * @param pVCpu The cross context virtual CPU structure. 4985 * @param pszInstr The VMX instruction name (for logging purposes). 4984 4986 */ 4985 4987 IEM_STATIC int iemVmxVmentryCheckGuestSegRegs(PVMCPU pVCpu, const char *pszInstr) … … 5368 5370 * Checks guest GDTR and IDTR as part of VM-entry. 5369 5371 * 5370 * @param pVCpu 5371 * @param pszInstr 5372 * @param pVCpu The cross context virtual CPU structure. 5373 * @param pszInstr The VMX instruction name (for logging purposes). 5372 5374 */ 5373 5375 IEM_STATIC int iemVmxVmentryCheckGuestGdtrIdtr(PVMCPU pVCpu, const char *pszInstr) … … 5414 5416 * Checks guest RIP and RFLAGS as part of VM-entry. 5415 5417 * 5416 * @param pVCpu 5417 * @param pszInstr 5418 * @param pVCpu The cross context virtual CPU structure. 5419 * @param pszInstr The VMX instruction name (for logging purposes). 5418 5420 */ 5419 5421 IEM_STATIC int iemVmxVmentryCheckGuestRipRFlags(PVMCPU pVCpu, const char *pszInstr) … … 5488 5490 * Checks guest non-register state as part of VM-entry. 5489 5491 * 5490 * @param pVCpu 5491 * @param pszInstr 5492 * @param pVCpu The cross context virtual CPU structure. 5493 * @param pszInstr The VMX instruction name (for logging purposes). 5492 5494 */ 5493 5495 IEM_STATIC int iemVmxVmentryCheckGuestNonRegState(PVMCPU pVCpu, const char *pszInstr) … … 5780 5782 * Checks guest PDPTEs as part of VM-entry. 5781 5783 * 5782 * @param pVCpu 5783 * @param pszInstr 5784 * @param pVCpu The cross context virtual CPU structure. 5785 * @param pszInstr The VMX instruction name (for logging purposes). 5784 5786 */ 5785 5787 IEM_STATIC int iemVmxVmentryCheckGuestPdptes(PVMCPU pVCpu, const char *pszInstr) … … 5816 5818 * 5817 5819 * @returns VBox status code. 5818 * @param pVCpu 5819 * @param pszInstr 5820 * @param pVCpu The cross context virtual CPU structure. 5821 * @param pszInstr The VMX instruction name (for logging purposes). 5820 5822 */ 5821 5823 IEM_STATIC int iemVmxVmentryCheckGuestState(PVMCPU pVCpu, const char *pszInstr) … … 5848 5850 * 5849 5851 * @returns VBox status code. 5850 * @param pVCpu 5851 * @param pszInstr 5852 * @param pVCpu The cross context virtual CPU structure. 5853 * @param pszInstr The VMX instruction name (for logging purposes). 5852 5854 */ 5853 5855 IEM_STATIC int iemVmxVmentryCheckHostState(PVMCPU pVCpu, const char *pszInstr) … … 6052 6054 * 6053 6055 * @returns VBox status code. 6054 * @param pVCpu 6055 * @param pszInstr 6056 * @param pVCpu The cross context virtual CPU structure. 6057 * @param pszInstr The VMX instruction name (for logging purposes). 6056 6058 */ 6057 6059 IEM_STATIC int iemVmxVmentryCheckEntryCtls(PVMCPU pVCpu, const char *pszInstr) … … 6160 6162 * 6161 6163 * @returns VBox status code. 6162 * @param pVCpu 6163 * @param pszInstr 6164 * @param pVCpu The cross context virtual CPU structure. 6165 * @param pszInstr The VMX instruction name (for logging purposes). 6164 6166 */ 6165 6167 IEM_STATIC int iemVmxVmentryCheckExitCtls(PVMCPU pVCpu, const char *pszInstr) … … 6220 6222 * 6221 6223 * @returns VBox status code. 6222 * @param pVCpu 6223 * @param pszInstr 6224 * @param pVCpu The cross context virtual CPU structure. 6225 * @param pszInstr The VMX instruction name (for logging purposes). 6224 6226 * 6225 6227 * @remarks This may update secondary-processor based VM-execution control fields … … 6788 6790 * 6789 6791 * @returns VBox status code. 6790 * @param pVCpu 6792 * @param pVCpu The cross context virtual CPU structure. 6791 6793 * 6792 6794 * @remarks This must be called only after loading the nested-guest register state … … 6845 6847 * 6846 6848 * @returns VBox status code. 6847 * @param pVCpu 6848 * @param pszInstr 6849 * @param pVCpu The cross context virtual CPU structure. 6850 * @param pszInstr The VMX instruction name (for logging purposes). 6849 6851 * 6850 6852 * @remarks This must be done after all the necessary steps prior to loading of … … 7184 7186 * Initializes all read-only VMCS fields as part of VM-entry. 7185 7187 * 7186 * @param pVCpu 7188 * @param pVCpu The cross context virtual CPU structure. 7187 7189 */ 7188 7190 IEM_STATIC void iemVmxVmentryInitReadOnlyFields(PVMCPU pVCpu) … … 7229 7231 * 7230 7232 * @returns Strict VBox status code. 7231 * @param pVCpu 7232 * @param cbInstr 7233 * @param uInstrId 7234 * 7233 * @param pVCpu The cross context virtual CPU structure. 7234 * @param cbInstr The instruction length in bytes. 7235 * @param uInstrId The instruction identity (VMXINSTRID_VMLAUNCH or 7236 * VMXINSTRID_VMRESUME). 7235 7237 * 7236 7238 * @remarks Common VMX instruction checks are already expected to by the caller, … … 7886 7888 * 7887 7889 * @returns Strict VBox status code. 7888 * @param pVCpu The cross context virtual CPU structure. 7889 * @param cbInstr The instruction length in bytes. 7890 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 7891 * @param GCPtrVmcs The linear address of the VMCS pointer. 7892 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 7893 * NULL. 7890 * @param pVCpu The cross context virtual CPU structure. 7891 * @param cbInstr The instruction length in bytes. 7892 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 7893 * @param GCPtrVmcs The linear address of the VMCS pointer. 7894 * @param pExitInfo Pointer to the VM-exit information. Optional, can be NULL. 7894 7895 * 7895 7896 * @remarks Common VMX instruction checks are already expected to by the caller, … … 7991 7992 && IEM_VMX_GET_CURRENT_VMCS(pVCpu) == GCPhysVmcs) 7992 7993 { 7993 Assert(GCPhysVmcs != NIL_RTGCPHYS); /* Paranoia. */7994 Assert(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs));7995 7994 pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs)->fVmcsState = fVmcsLaunchStateClear; 7996 7995 iemVmxCommitCurrentVmcsToMemory(pVCpu); … … 8016 8015 * 8017 8016 * @returns Strict VBox status code. 8018 * @param pVCpu The cross context virtual CPU structure. 8019 * @param cbInstr The instruction length in bytes. 8020 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 8021 * @param GCPtrVmcs The linear address of where to store the current VMCS 8022 * pointer. 8023 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8024 * NULL. 8017 * @param pVCpu The cross context virtual CPU structure. 8018 * @param cbInstr The instruction length in bytes. 8019 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 8020 * @param GCPtrVmcs The linear address of where to store the current VMCS 8021 * pointer. 8022 * @param pExitInfo Pointer to the VM-exit information. Optional, can be NULL. 8025 8023 * 8026 8024 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8070 8068 * 8071 8069 * @returns Strict VBox status code. 8072 * @param pVCpu The cross context virtual CPU structure. 8073 * @param cbInstr The instruction length in bytes. 8074 * @param GCPtrVmcs The linear address of the current VMCS pointer. 8075 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8076 * NULL. 8070 * @param pVCpu The cross context virtual CPU structure. 8071 * @param cbInstr The instruction length in bytes. 8072 * @param GCPtrVmcs The linear address of the current VMCS pointer. 8073 * @param pExitInfo Pointer to the VM-exit information. Optional, can be NULL. 8077 8074 * 8078 8075 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8410 8407 * 8411 8408 * @returns Strict VBox status code. 8412 * @param pVCpu The cross context virtual CPU structure. 8413 * @param cbInstr The instruction length in bytes. 8414 * @param iEffSeg The effective segment register to use with @a 8415 * GCPtrVmxon. 8416 * @param GCPtrVmxon The linear address of the VMXON pointer. 8417 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8418 * NULL. 8409 * @param pVCpu The cross context virtual CPU structure. 8410 * @param cbInstr The instruction length in bytes. 8411 * @param iEffSeg The effective segment register to use with @a 8412 * GCPtrVmxon. 8413 * @param GCPtrVmxon The linear address of the VMXON pointer. 8414 * @param pExitInfo Pointer to the VM-exit information. Optional, can be NULL. 8419 8415 * 8420 8416 * @remarks Common VMX instruction checks are already expected to by the caller,
Note:
See TracChangeset
for help on using the changeset viewer.