VirtualBox

Changeset 87750 in vbox for trunk/src/VBox/VMM/include


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

VMM/TM: Further relax memory ordering when signaling update-in-progress in both TMNotifyEndOfExecution and TMNotifyEndOfHalt by ensuring only the EMT writes to the memory. bugref:9941

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/TMInternal.h

    r87748 r87750  
    716716typedef struct TMCPU
    717717{
    718     /** CPU timestamp ticking enabled indicator (bool). (RDTSC) */
    719     bool                        fTSCTicking;
    720     bool                        afAlignment0[7]; /**< alignment padding */
    721718    /** The offset between the host tick (TSC/virtual depending on the TSC mode) and
    722719     *  the guest tick. */
     
    726723    /** The last seen TSC by the guest. */
    727724    uint64_t                    u64TSCLastSeen;
    728 
    729 #ifndef VBOX_WITHOUT_NS_ACCOUNTING
    730     /** Align  */
    731     uint64_t                    au64Alignment[4];
    732 
    733     /** @name Core accounting data.  Must be cache-line aligned.
     725    /** CPU timestamp ticking enabled indicator (bool). (RDTSC) */
     726    bool                        fTSCTicking;
     727#ifdef VBOX_WITHOUT_NS_ACCOUNTING
     728    bool                        afAlignment1[7]; /**< alignment padding */
     729#else /* !VBOX_WITHOUT_NS_ACCOUNTING */
     730
     731    /** Set by the timer callback to trigger updating of statistics in
     732     *  TMNotifyEndOfExecution. */
     733    bool volatile               fUpdateStats;
     734    bool                        afAlignment1[6];
     735    /** The time not spent executing or halted.
     736     * @note Only updated after halting and after the timer runs. */
     737    uint64_t                    cNsOtherStat;
     738    /** Reasonably up to date total run time value.
     739     * @note Only updated after halting and after the timer runs. */
     740    uint64_t                    cNsTotalStat;
     741# if defined(VBOX_WITH_STATISTICS) || defined(VBOX_WITH_NS_ACCOUNTING_STATS)
     742    /** Resettable copy of version of cNsOtherStat.
     743    * @note Only updated after halting. */
     744    STAMCOUNTER                 StatNsOther;
     745    /** Resettable copy of cNsTotalStat.
     746     * @note Only updated after halting. */
     747    STAMCOUNTER                 StatNsTotal;
     748# else
     749    uint64_t                    auAlignment2[2];
     750# endif
     751
     752    /** @name Core accounting data.
     753     * @note Must be cache-line aligned and only written to by the EMT owning it.
    734754     * @{ */
    735755    /** The cNsXXX generation. */
     
    742762    /** Set if we're suspended and u64NsTsStartTotal is to be cNsTotal. */
    743763    bool volatile               fSuspended;
    744     /** Set by the timer callback to trigger updating of statistics in
    745      *  TMNotifyEndOfExecution. */
    746     bool volatile               fUpdateStats;
     764    bool                        afAlignment;
    747765    /** The nanosecond timestamp of the CPU start or resume.
    748766     * This is recalculated when the VM is started so that
     
    774792    /** Resettable version of cNsHalted. */
    775793    STAMPROFILE                 StatNsHalted;
    776 
    777     /** Resettable copy of version of cNsOtherStat.
    778     * @note Only updated after halting. */
    779     STAMCOUNTER                 StatNsOther;
    780     /** Resettable copy of cNsTotalStat.
    781      * @note Only updated after halting. */
    782     STAMCOUNTER                 StatNsTotal;
    783794# endif
    784     /** The time not spent executing or halted.
    785      * @note Only updated after halting and after the timer runs. */
    786     uint64_t                    cNsOtherStat;
    787     /** Reasonably up to date total run time value.
    788      * @note Only updated after halting and after the timer runs. */
    789     uint64_t                    cNsTotalStat;
    790795
    791796    /** CPU load state for this virtual CPU (tmR3CpuLoadTimer). */
     
    798803AssertCompileMemberAlignment(TMCPU, StatNsExecuting, 64);
    799804# else
    800 AssertCompileMemberAlignment(TMCPU, cNsOtherStat, 64);
     805AssertCompileMemberAlignment(TMCPU, CpuLoad, 64);
    801806# endif
    802807#endif
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