VirtualBox

Changeset 87752 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Feb 13, 2021 2:13:15 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142804
Message:

VMM/HM: Don't use ordered writes for pVCpu->hm.s.fCheckedTLBFlush as it's only ever checked together with cWorldSwitchExits by hmR0PokeCpu, and cWorldSwitchExits is written atomically right afterwards. Both variables are only updated by the EMT owning them. bugref:9941

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r87751 r87752  
    13061306
    13071307    /* Set TLB flush state as checked until we return from the world switch. */
    1308     ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);
     1308    ASMAtomicUoWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);
    13091309
    13101310    /* Check for explicit TLB flushes. */
     
    42734273#endif
    42744274
    4275     ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);    /* Used for TLB flushing, set this across the world switch. */
     4275    ASMAtomicUoWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);  /* Used for TLB flushing, set this across the world switch. */
    42764276    /* Flush the appropriate tagged-TLB entries. */
    42774277    hmR0SvmFlushTaggedTlb(pHostCpu,  pVCpu, pVmcb);
     
    43514351
    43524352    uint64_t const uHostTsc = ASMReadTSC();                     /* Read the TSC as soon as possible. */
    4353     ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false);  /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
     4353    ASMAtomicUoWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
    43544354    ASMAtomicIncU32(&pVCpu->hmr0.s.cWorldSwitchExits);          /* Initialized in vmR3CreateUVM(): used for EMT poking. */
    43554355
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r87751 r87752  
    1108811088        STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept);
    1108911089
    11090     ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);    /* Used for TLB flushing, set this across the world switch. */
     11090    ASMAtomicUoWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);  /* Used for TLB flushing, set this across the world switch. */
    1109111091    hmR0VmxFlushTaggedTlb(pHostCpu, pVCpu, pVmcsInfo);          /* Invalidate the appropriate guest entries from the TLB. */
    1109211092    Assert(idCurrentCpu == pVCpu->hmr0.s.idLastCpu);
     
    1115511155    uint64_t const uHostTsc = ASMReadTSC();                     /** @todo We can do a lot better here, see @bugref{9180#c38}. */
    1115611156
    11157     ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false);  /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
     11157    ASMAtomicUoWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
    1115811158    ASMAtomicIncU32(&pVCpu->hmr0.s.cWorldSwitchExits);          /* Initialized in vmR3CreateUVM(): used for EMT poking. */
    1115911159    pVCpu->hm.s.fCtxChanged            = 0;                     /* Exits/longjmps to ring-3 requires saving the guest state. */
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