qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/4] ThreadSanitizer support
@ 2016-01-25 16:49 Alex Bennée
  2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 1/4] configure: move EXTRA_CFLAGS append to the end Alex Bennée
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Alex Bennée @ 2016-01-25 16:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: mttcg, peter.maydell, mark.burton, a.rigo, pbonzini,
	Alex Bennée, fred.konrad

This is mainly motivated at being able to use the ThreadSanitizer to
give the MTTCG work a good testing for corner cases. However this
should be generally useful.

The first two patches are simple configure tweaks to make the passing
of flags sane. To build on my machine I installed the latest/greatest
GCC PPA and configured with:

    ./configure ${TARGET_LIST} --cc=gcc-5 --cxx=g++-5 \
  --extra-cflags="-fsanitize=thread" --extra-libs="-ltsan" \
  --with-coroutine=gthread

The compiler selection gives the new GCC and I pass the -fsanitize
option in the cflags. I've introduced --extra-libs so we can link in
the ThreadSanitizer support library.

The third patch ensure we use the __atomic builtins for all atomic
functions if we have it available. This is needed so the
ThreadSanitizer can properly instrument the code but we should use it
anyway for consistency. The code generation for atomic accesses on x86
it unaffected.

Finally there is a patch with a few of the fixes for bugs thrown up
running make check. It doesn't fix them all as there are still some
warnings I need to look into more deeply.


Alex Bennée (4):
  configure: move EXTRA_CFLAGS append to the end
  configure: introduce --extra-libs
  include/qemu/atomic.h: default to __atomic functions
  tsan: various fixes for make check

 async.c                  |   4 +-
 configure                |  18 ++++++-
 include/qemu/atomic.h    | 126 ++++++++++++++++++++++++++++++-----------------
 tests/test-thread-pool.c |   2 +-
 thread-pool.c            |   9 ++--
 5 files changed, 105 insertions(+), 54 deletions(-)

-- 
2.7.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-01-26  8:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 16:49 [Qemu-devel] [RFC PATCH 0/4] ThreadSanitizer support Alex Bennée
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 1/4] configure: move EXTRA_CFLAGS append to the end Alex Bennée
2016-01-25 17:04   ` Peter Maydell
2016-01-25 17:37   ` Peter Maydell
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs Alex Bennée
2016-01-25 17:08   ` Peter Maydell
2016-01-25 17:25     ` Alex Bennée
2016-01-25 17:36       ` Peter Maydell
2016-01-25 17:58   ` Paolo Bonzini
2016-01-25 18:15     ` Alex Bennée
2016-01-25 22:10       ` Paolo Bonzini
2016-01-26  8:43         ` Alex Bennée
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 3/4] include/qemu/atomic.h: default to __atomic functions Alex Bennée
2016-01-25 18:04   ` Paolo Bonzini
2016-01-25 18:23     ` Alex Bennée
2016-01-25 22:02       ` Paolo Bonzini
2016-01-25 16:49 ` [Qemu-devel] [RFC PATCH 4/4] tsan: various fixes for make check Alex Bennée
2016-01-25 18:09   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).