VirtualBox

Changeset 87749 in vbox


Ignore:
Timestamp:
Feb 13, 2021 3:18:27 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142801
Message:

VMM/TM: Relax ordering when signaling update-in-progress in TMNotifyEndOfExecution. bugref:9941

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r87748 r87749  
    188188     */
    189189    /** @todo get TSC from caller (HMR0A.asm) */
    190     uint64_t       cTicks            = SUPReadTsc() - pVCpu->tm.s.uTscStartExecuting;
     190    uint64_t       cTicks = SUPReadTsc() - pVCpu->tm.s.uTscStartExecuting;
    191191# ifdef IN_RING3
    192     uint64_t const uCpuHz            = SUPGetCpuHzFromGip(g_pSUPGlobalInfoPage);
     192    uint64_t const uCpuHz = SUPGetCpuHzFromGip(g_pSUPGlobalInfoPage);
    193193# else
    194     uint64_t const uCpuHz            = SUPGetCpuHzFromGipBySetIndex(g_pSUPGlobalInfoPage, pVCpu->iHostCpuSet);
     194    uint64_t const uCpuHz = SUPGetCpuHzFromGipBySetIndex(g_pSUPGlobalInfoPage, pVCpu->iHostCpuSet);
    195195# endif
    196196    AssertStmt(cTicks <= uCpuHz << 2, cTicks = uCpuHz << 2); /* max 4 sec */
     
    209209    /*
    210210     * Update the data.
     211     *
     212     * Note! Using ASMAtomicUoIncU32 instead of ASMAtomicIncU32 here to
     213     *       save a tiny bit of time here.  Currently, the only user
     214     *       is tmR3CpuLoadTimer(), so nothing terribly important.
    211215     */
    212216    uint64_t const cNsExecutingNew = pVCpu->tm.s.cNsExecuting + cNsExecutingDelta;
    213     /** @todo try relax ordering here */
    214     uint32_t uGen = ASMAtomicIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1);
     217    uint32_t uGen = ASMAtomicUoIncU32(&pVCpu->tm.s.uTimesGen); Assert(uGen & 1);
    215218    pVCpu->tm.s.fExecuting   = false;
    216219    pVCpu->tm.s.cNsExecuting = cNsExecutingNew;
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