Changeset 69068 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 13, 2017 9:14:48 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r69046 r69068 403 403 * Theoretically, other hypervisors may have used ASIDs, ideally we should flush all non-zero ASIDs 404 404 * when enabling SVM. AMD doesn't have an SVM instruction to flush all ASIDs (flushing is done 405 * upon VMRUN). Therefore, just set the fFlushAsidBeforeUse flag which instructs hmR0SvmSetupTLB()406 * to flush the TLB with before using a new ASID.405 * upon VMRUN). Therefore, flag that we need to flush the TLB entirely with before executing any 406 * guest code. 407 407 */ 408 408 pCpu->fFlushAsidBeforeUse = true; … … 958 958 { 959 959 ++pCpu->uCurrentAsid; 960 960 961 bool fHitASIDLimit = false; 961 962 if (pCpu->uCurrentAsid >= pVM->hm.s.uMaxAsid) … … 964 965 pCpu->cTlbFlushes++; /* All VCPUs that run on this host CPU must use a new ASID. */ 965 966 fHitASIDLimit = true; 966 967 if (pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_FLUSH_BY_ASID)968 {969 pVmcb->ctrl.TLBCtrl.n.u8TLBFlush = SVM_TLB_FLUSH_SINGLE_CONTEXT;970 pCpu->fFlushAsidBeforeUse = true;971 }972 else973 {974 pVmcb->ctrl.TLBCtrl.n.u8TLBFlush = SVM_TLB_FLUSH_ENTIRE;975 pCpu->fFlushAsidBeforeUse = false;976 }977 967 } 978 968 979 if ( !fHitASIDLimit980 &&pCpu->fFlushAsidBeforeUse)969 if ( fHitASIDLimit 970 || pCpu->fFlushAsidBeforeUse) 981 971 { 982 if (pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_FLUSH_BY_ASID) 983 pVmcb->ctrl.TLBCtrl.n.u8TLBFlush = SVM_TLB_FLUSH_SINGLE_CONTEXT; 984 else 985 { 986 pVmcb->ctrl.TLBCtrl.n.u8TLBFlush = SVM_TLB_FLUSH_ENTIRE; 987 pCpu->fFlushAsidBeforeUse = false; 988 } 972 pVmcb->ctrl.TLBCtrl.n.u8TLBFlush = SVM_TLB_FLUSH_ENTIRE; 973 pCpu->fFlushAsidBeforeUse = false; 989 974 } 990 975
Note:
See TracChangeset
for help on using the changeset viewer.