Changeset 82576 in vbox
- Timestamp:
- Dec 13, 2019 10:01:00 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r81277 r82576 293 293 /** The host's rflags/eflags. */ 294 294 RTCCUINTREG fEFlags; 295 296 295 /** The \#VMEXIT exit code (the EXITCODE field in the VMCB). */ 297 296 uint64_t u64ExitCode; 297 298 298 /** The guest's TPR value used for TPR shadowing. */ 299 299 uint8_t u8GuestTpr; … … 303 303 /** Pointer to the currently executing VMCB. */ 304 304 PSVMVMCB pVmcb; 305 305 306 /** Whether we are currently executing a nested-guest. */ 306 307 bool fIsNestedGuest; 307 308 308 /** Whether the guest debug state was active at the time of \#VMEXIT. */ 309 309 bool fWasGuestDebugStateActive; … … 320 320 * external interrupt or NMI. */ 321 321 bool fVectoringPF; 322 /** Padding. */ 323 bool afPadding0; 322 324 } SVMTRANSIENT; 323 325 /** Pointer to SVM transient state. */ … … 326 328 typedef const SVMTRANSIENT *PCSVMTRANSIENT; 327 329 330 AssertCompileSizeAlignment(SVMTRANSIENT, sizeof(uint64_t)); 328 331 AssertCompileMemberAlignment(SVMTRANSIENT, u64ExitCode, sizeof(uint64_t)); 329 332 AssertCompileMemberAlignment(SVMTRANSIENT, pVmcb, sizeof(uint64_t)); … … 803 806 * 804 807 * @returns @c true if supported, @c false otherwise. 805 * @param pVCpu The cross context virtual CPU structure. 806 */ 807 DECLINLINE(bool) hmR0SvmSupportsVmcbCleanBits(PVMCPUCC pVCpu) 808 { 809 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 810 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 811 if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) 812 { 813 return (pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN) 814 && pVM->cpum.ro.GuestFeatures.fSvmVmcbClean; 815 } 816 #endif 817 return RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN); 808 * @param pVCpu The cross context virtual CPU structure. 809 * @param fIsNestedGuest Whether we are currently executing the nested-guest. 810 */ 811 DECL_FORCE_INLINE(bool) hmR0SvmSupportsVmcbCleanBits(PVMCPUCC pVCpu, bool fIsNestedGuest) 812 { 813 PCVMCC pVM = pVCpu->CTX_SUFF(pVM); 814 bool const fHostVmcbCleanBits = RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN); 815 if (!fIsNestedGuest) 816 return fHostVmcbCleanBits; 817 return fHostVmcbCleanBits && pVM->cpum.ro.GuestFeatures.fSvmVmcbClean; 818 818 } 819 819 … … 4237 4237 * from the VMCB. 4238 4238 */ 4239 bool const fSupportsVmcbCleanBits = hmR0SvmSupportsVmcbCleanBits(pVCpu );4239 bool const fSupportsVmcbCleanBits = hmR0SvmSupportsVmcbCleanBits(pVCpu, pSvmTransient->fIsNestedGuest); 4240 4240 if (!fSupportsVmcbCleanBits) 4241 4241 pVmcb->ctrl.u32VmcbCleanBits = 0; … … 4337 4337 4338 4338 pSvmTransient->u64ExitCode = pVmcbCtrl->u64ExitCode; /* Save the #VMEXIT reason. */ 4339 pVmcbCtrl->u32VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */4340 4339 pSvmTransient->fVectoringDoublePF = false; /* Vectoring double page-fault needs to be determined later. */ 4341 4340 pSvmTransient->fVectoringPF = false; /* Vectoring page-fault needs to be determined later. */ 4341 pVmcbCtrl->u32VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */ 4342 4342 4343 4343 #ifdef HMSVM_SYNC_FULL_GUEST_STATE
Note:
See TracChangeset
for help on using the changeset viewer.