On 16.07.2025 23:23, Volodymyr Babchuk wrote:
> By default GCC uses "simple" coverage counter update
> mechanism. It is perfectly fine for single-threaded (or single CPU in
> our case) setups, but will cause race conditions on SMP systems.
> 
> For example, I observed that counters are going backwards when running
> Xen inside QEMU.
> 
> GCC starting from version 7 and LLVM/Clang starting from version 11
> support -fprofile-update=atomic option, which forces coverage counter
> updates to be atomic, which resolves the issue. As Xen runs mostly on
> SMP systems, force use this option if it is supported by a compiler.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babc...@epam.com>

Acked-by: Jan Beulich <jbeul...@suse.com>


Reply via email to