VirtualBox

Changeset 71565 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 29, 2018 11:48:10 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121545
Message:

VMM/HMSVMR0: Safer to use the TSC offset from TMCpuTickCanUseRealTSC only when it returns true (otherwise the value is uninitialized, although it's unused in practise).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r71559 r71565  
    30313031        pVmcbNstGstCtrl->u64InterceptCtrl &= ~(SVM_CTRL_INTERCEPT_RDTSC | SVM_CTRL_INTERCEPT_RDTSCP);
    30323032        STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset);
     3033
     3034        /* Apply the nested-guest VMCB's TSC offset over the guest one. */
     3035        uTscOffset = HMSvmNstGstApplyTscOffset(pVCpu, uTscOffset);
     3036
     3037        /* Update the nested-guest VMCB with the combined TSC offset (of guest and nested-guest). */
     3038        pVmcbNstGstCtrl->u64TSCOffset = uTscOffset;
    30333039    }
    30343040    else
     
    30373043        STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept);
    30383044    }
    3039 
    3040     /* Apply the nested-guest VMCB's TSC offset over the guest one. */
    3041     uTscOffset = HMSvmNstGstApplyTscOffset(pVCpu, uTscOffset);
    3042 
    3043     /* Update the nested-guest VMCB with the combined TSC offset (of guest and nested-guest). */
    3044     pVmcbNstGstCtrl->u64TSCOffset = uTscOffset;
    30453045
    30463046    /* Finally update the VMCB clean bits since we touched the intercepts as well as the TSC offset. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette