Changeset 93963 in vbox for trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
- Timestamp:
- Feb 28, 2022 8:39:08 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r93931 r93963 287 287 | HMSVM_VMCB_CLEAN_AVIC) 288 288 /** @} */ 289 290 /** @name SVM transient.291 *292 * A state structure for holding miscellaneous information across AMD-V293 * VMRUN/\#VMEXIT operation, restored after the transition.294 *295 * @{ */296 typedef struct SVMTRANSIENT297 {298 /** The host's rflags/eflags. */299 RTCCUINTREG fEFlags;300 /** The \#VMEXIT exit code (the EXITCODE field in the VMCB). */301 uint64_t u64ExitCode;302 303 /** The guest's TPR value used for TPR shadowing. */304 uint8_t u8GuestTpr;305 /** Alignment. */306 uint8_t abAlignment0[7];307 308 /** Pointer to the currently executing VMCB. */309 PSVMVMCB pVmcb;310 311 /** Whether we are currently executing a nested-guest. */312 bool fIsNestedGuest;313 /** Whether the guest debug state was active at the time of \#VMEXIT. */314 bool fWasGuestDebugStateActive;315 /** Whether the hyper debug state was active at the time of \#VMEXIT. */316 bool fWasHyperDebugStateActive;317 /** Whether the TSC offset mode needs to be updated. */318 bool fUpdateTscOffsetting;319 /** Whether the TSC_AUX MSR needs restoring on \#VMEXIT. */320 bool fRestoreTscAuxMsr;321 /** Whether the \#VMEXIT was caused by a page-fault during delivery of a322 * contributary exception or a page-fault. */323 bool fVectoringDoublePF;324 /** Whether the \#VMEXIT was caused by a page-fault during delivery of an325 * external interrupt or NMI. */326 bool fVectoringPF;327 /** Padding. */328 bool afPadding0;329 } SVMTRANSIENT;330 /** Pointer to SVM transient state. */331 typedef SVMTRANSIENT *PSVMTRANSIENT;332 /** Pointer to a const SVM transient state. */333 typedef const SVMTRANSIENT *PCSVMTRANSIENT;334 335 AssertCompileSizeAlignment(SVMTRANSIENT, sizeof(uint64_t));336 AssertCompileMemberAlignment(SVMTRANSIENT, u64ExitCode, sizeof(uint64_t));337 AssertCompileMemberAlignment(SVMTRANSIENT, pVmcb, sizeof(uint64_t));338 /** @} */339 289 340 290 /** … … 2959 2909 2960 2910 /** 2911 * Gets SVM \#VMEXIT auxiliary information. 2912 * 2913 * @returns VBox status code. 2914 * @param pVCpu The cross context virtual CPU structure. 2915 * @param pSvmExitAux Where to store the auxiliary info. 2916 */ 2917 VMMR0DECL(int) SVMR0GetExitAuxInfo(PVMCPUCC pVCpu, PSVMEXITAUX pSvmExitAux) 2918 { 2919 PCSVMTRANSIENT pSvmTransient = pVCpu->hmr0.s.svm.pSvmTransient; 2920 if (RT_LIKELY(pSvmTransient)) 2921 { 2922 PCSVMVMCB pVmcb = pSvmTransient->pVmcb; 2923 if (RT_LIKELY(pVmcb)) 2924 { 2925 pSvmExitAux->u64ExitCode = pVmcb->ctrl.u64ExitCode; 2926 pSvmExitAux->u64ExitInfo1 = pVmcb->ctrl.u64ExitInfo1; 2927 pSvmExitAux->u64ExitInfo2 = pVmcb->ctrl.u64ExitInfo2; 2928 pSvmExitAux->ExitIntInfo = pVmcb->ctrl.ExitIntInfo; 2929 return VINF_SUCCESS; 2930 } 2931 return VERR_SVM_IPE_5; 2932 } 2933 return VERR_NOT_AVAILABLE; 2934 } 2935 2936 2937 /** 2961 2938 * Does the necessary state syncing before returning to ring-3 for any reason 2962 2939 * (longjmp, preemption, voluntary exits to ring-3) from AMD-V. … … 4556 4533 SvmTransient.fIsNestedGuest = true; 4557 4534 4535 /* Setup pointer so PGM/IEM can query #VMEXIT auxiliary info. on demand in ring-0. */ 4536 pVCpu->hmr0.s.svm.pSvmTransient = &SvmTransient; 4537 4558 4538 VBOXSTRICTRC rc = VERR_INTERNAL_ERROR_4; 4559 4539 for (;;) … … 4626 4606 /** @todo NSTSVM: handle single-stepping. */ 4627 4607 } 4608 4609 /* Ensure #VMEXIT auxiliary info. is no longer available. */ 4610 pVCpu->hmr0.s.svm.pSvmTransient = NULL; 4628 4611 4629 4612 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatEntry, x);
Note:
See TracChangeset
for help on using the changeset viewer.