Changeset 93963 in vbox for trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
- Timestamp:
- Feb 28, 2022 8:39:08 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r93932 r93963 4834 4834 4835 4835 /** 4836 * Gets VMX VM-exit auxiliary information. 4837 * 4838 * @returns VBox status code. 4839 * @param pVCpu The cross context virtual CPU structure. 4840 * @param pVmxExitAux Where to store the VM-exit auxiliary info. 4841 * @param fWhat What to fetch, HMVMX_READ_XXX. 4842 */ 4843 VMMR0DECL(int) VMXR0GetExitAuxInfo(PVMCPUCC pVCpu, PVMXEXITAUX pVmxExitAux, uint32_t fWhat) 4844 { 4845 PVMXTRANSIENT pVmxTransient = pVCpu->hmr0.s.vmx.pVmxTransient; 4846 if (RT_LIKELY(pVmxTransient)) 4847 { 4848 AssertCompile(sizeof(fWhat) == sizeof(pVmxTransient->fVmcsFieldsRead)); 4849 fWhat &= ~pVmxTransient->fVmcsFieldsRead; 4850 4851 /* The exit reason is always available. */ 4852 pVmxExitAux->uReason = pVmxTransient->uExitReason; 4853 4854 if (fWhat & HMVMX_READ_EXIT_QUALIFICATION) 4855 { 4856 vmxHCReadExitQualVmcs(pVCpu, pVmxTransient); 4857 fWhat &= ~HMVMX_READ_EXIT_QUALIFICATION; 4858 pVmxExitAux->u64Qual = pVmxTransient->uExitQual; 4859 } 4860 4861 if (fWhat & HMVMX_READ_IDT_VECTORING_INFO) 4862 { 4863 vmxHCReadIdtVectoringInfoVmcs(pVCpu, pVmxTransient); 4864 fWhat &= ~HMVMX_READ_IDT_VECTORING_INFO; 4865 pVmxExitAux->uIdtVectoringInfo = pVmxTransient->uIdtVectoringInfo; 4866 } 4867 4868 if (fWhat & HMVMX_READ_IDT_VECTORING_ERROR_CODE) 4869 { 4870 vmxHCReadIdtVectoringErrorCodeVmcs(pVCpu, pVmxTransient); 4871 fWhat &= ~HMVMX_READ_IDT_VECTORING_ERROR_CODE; 4872 pVmxExitAux->uIdtVectoringErrCode = pVmxTransient->uIdtVectoringErrorCode; 4873 } 4874 4875 if (fWhat & HMVMX_READ_EXIT_INSTR_LEN) 4876 { 4877 vmxHCReadExitInstrLenVmcs(pVCpu, pVmxTransient); 4878 fWhat &= ~HMVMX_READ_EXIT_INSTR_LEN; 4879 pVmxExitAux->cbInstr = pVmxTransient->cbExitInstr; 4880 } 4881 4882 if (fWhat & HMVMX_READ_EXIT_INTERRUPTION_INFO) 4883 { 4884 vmxHCReadExitIntInfoVmcs(pVCpu, pVmxTransient); 4885 fWhat &= ~HMVMX_READ_EXIT_INTERRUPTION_INFO; 4886 pVmxExitAux->uExitIntInfo = pVmxTransient->uExitIntInfo; 4887 } 4888 4889 if (fWhat & HMVMX_READ_EXIT_INTERRUPTION_ERROR_CODE) 4890 { 4891 vmxHCReadExitIntErrorCodeVmcs(pVCpu, pVmxTransient); 4892 fWhat &= ~HMVMX_READ_EXIT_INTERRUPTION_ERROR_CODE; 4893 pVmxExitAux->uExitIntErrCode = pVmxTransient->uExitIntErrorCode; 4894 } 4895 4896 if (fWhat & HMVMX_READ_EXIT_INSTR_INFO) 4897 { 4898 vmxHCReadExitInstrInfoVmcs(pVCpu, pVmxTransient); 4899 fWhat &= ~HMVMX_READ_EXIT_INSTR_INFO; 4900 pVmxExitAux->InstrInfo.u = pVmxTransient->ExitInstrInfo.u; 4901 } 4902 4903 if (fWhat & HMVMX_READ_GUEST_LINEAR_ADDR) 4904 { 4905 vmxHCReadGuestLinearAddrVmcs(pVCpu, pVmxTransient); 4906 fWhat &= ~HMVMX_READ_GUEST_LINEAR_ADDR; 4907 pVmxExitAux->u64GuestLinearAddr = pVmxTransient->uGuestLinearAddr; 4908 } 4909 4910 if (fWhat & HMVMX_READ_GUEST_PHYSICAL_ADDR) 4911 { 4912 vmxHCReadGuestPhysicalAddrVmcs(pVCpu, pVmxTransient); 4913 fWhat &= ~HMVMX_READ_GUEST_PHYSICAL_ADDR; 4914 pVmxExitAux->u64GuestPhysAddr = pVmxTransient->uGuestPhysicalAddr; 4915 } 4916 4917 if (fWhat & HMVMX_READ_GUEST_PENDING_DBG_XCPTS) 4918 { 4919 vmxHCReadGuestPendingDbgXctps(pVCpu, pVmxTransient); 4920 fWhat &= ~HMVMX_READ_GUEST_PENDING_DBG_XCPTS; 4921 pVmxExitAux->u64GuestPendingDbgXcpts = pVmxTransient->uGuestPendingDbgXcpts; 4922 } 4923 4924 AssertMsg(!fWhat, ("fWhat=%#RX32 fVmcsFieldsRead=%#RX32\n", fWhat, pVmxTransient->fVmcsFieldsRead)); 4925 return VINF_SUCCESS; 4926 } 4927 return VERR_NOT_AVAILABLE; 4928 } 4929 4930 4931 /** 4836 4932 * Does the necessary state syncing before returning to ring-3 for any reason 4837 4933 * (longjmp, preemption, voluntary exits to ring-3) from VT-x. … … 6774 6870 Assert(VmxTransient.pVmcsInfo == &pVCpu->hmr0.s.vmx.VmcsInfoNstGst); 6775 6871 6872 /* Setup pointer so PGM/IEM can query VM-exit auxiliary info. on demand in ring-0. */ 6873 pVCpu->hmr0.s.vmx.pVmxTransient = &VmxTransient; 6874 6776 6875 VBOXSTRICTRC rcStrict = VERR_INTERNAL_ERROR_5; 6777 6876 for (;;) … … 6806 6905 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatPreExit, x); 6807 6906 hmR0VmxReportWorldSwitchError(pVCpu, rcRun, &VmxTransient); 6808 return rcRun; 6907 rcStrict = rcRun; 6908 break; 6809 6909 } 6810 6910 … … 6855 6955 break; 6856 6956 } 6957 6958 /* Ensure VM-exit auxiliary info. is no longer available. */ 6959 pVCpu->hmr0.s.vmx.pVmxTransient = NULL; 6857 6960 6858 6961 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatEntry, x);
Note:
See TracChangeset
for help on using the changeset viewer.