All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/13] Add Thread Sanitizer support to QEMU
@ 2020-06-05 17:34 Robert Foley
  2020-06-05 17:34 ` [PATCH v2 01/13] configure: add --enable-tsan flag + fiber annotations for coroutine-ucontext Robert Foley
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: Robert Foley @ 2020-06-05 17:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.puhov, cota, alex.bennee, robert.foley

v1: https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg08302.html

Changes in v2:
- Fixed make check under TSan.  With the below fixes, make check 
  under TSan completes successfully, albeit with TSan warnings.
  - We found that several unit tests and the qtests hit an issue in TSan,
    which results in a hung test.  This is a known issue: 
    https://github.com/google/sanitizers/issues/1116
  - Under TSan, disable the 3 unit tests that hit this above issue.
  - Under TSan, disable the qtests since they hit this issue too.
- Split out the docker testing for tsan into its own test (test-tsan).
- configure:  Error out if tsan and other sanitizers are used together.
- configure: Cleaned up warnings during tsan build caused by tsan libraries.

This patch series continues the work done by Emilio Cota and others to add
Thread Sanitizer (TSan) support to QEMU.

The starting point for this work was Emilio's branch here:
https://github.com/cota/qemu/commits/tsan
specifically this commit: 0be125fc0afd47218b34d2019abdd19b644f3199

The main purpose of this patch is to enable TSan support so that 
QEMU developers can start using the tool.  
We found this tool useful and even ran it on our recent changes in
the cpu-locks series, which fixes many warnings.
Clearly there is work to do here to clean up all the warnings. :)
We have also made an effort to introduce enough of the TSan suppression
mechanisms, so that others can continue this work.

This series adds support for:
- configure option for --enable-tsan.
- testing.rst has the full details on how to use TSan with or without docker,
  including all the suppression mechanisms.
- We added an Ubuntu 20.04 docker that supports TSan builds.
- test-tsan is a new docker test that builds and runs make check under TSan.
- We added an example blacklist file for files or functions TSan should ignore 
  at compile time.  This can now be specified manually.
- Added a suppression file for TSan to suppress certain warnings at run time.
- Added tsan.h with annotations which also can be used to suppress warnings.

Emilio G. Cota (7):
  cpu: convert queued work to a QSIMPLEQ
  thread: add qemu_spin_destroy
  cputlb: destroy CPUTLB with tlb_destroy
  qht: call qemu_spin_destroy for head buckets
  tcg: call qemu_spin_destroy for tb->jmp_lock
  translate-all: call qemu_spin_destroy for PageDesc
  thread: add tsan annotations to QemuSpin

Lingfeng Yang (1):
  configure: add --enable-tsan flag + fiber annotations for
    coroutine-ucontext

Robert Foley (5):
  tests/docker: Added docker build support for TSan.
  include/qemu: Added tsan.h for annotations.
  util: Added tsan annotate for thread name.
  docs: Added details on TSan to testing.rst
  tests:  Disable select tests under TSan, which hit TSan issue.

 accel/tcg/cputlb.c                         |  15 +++
 accel/tcg/translate-all.c                  |  19 +++-
 configure                                  |  47 ++++++++-
 cpus-common.c                              |  25 ++---
 cpus.c                                     |  14 ++-
 docs/devel/testing.rst                     | 107 +++++++++++++++++++++
 exec.c                                     |   1 +
 hw/core/cpu.c                              |   1 +
 include/exec/exec-all.h                    |   8 ++
 include/hw/core/cpu.h                      |   6 +-
 include/qemu/thread.h                      |  38 +++++++-
 include/qemu/tsan.h                        |  71 ++++++++++++++
 include/tcg/tcg.h                          |   3 +-
 tcg/tcg.c                                  |  19 +++-
 tests/Makefile.include                     |   9 +-
 tests/docker/dockerfiles/ubuntu2004.docker |  65 +++++++++++++
 tests/docker/test-tsan                     |  44 +++++++++
 tests/qtest/Makefile.include               |   7 +-
 tests/tsan/blacklist.tsan                  |  10 ++
 tests/tsan/suppressions.tsan               |  14 +++
 util/coroutine-ucontext.c                  |  97 +++++++++++++++++--
 util/qemu-thread-posix.c                   |   2 +
 util/qht.c                                 |   1 +
 23 files changed, 581 insertions(+), 42 deletions(-)
 create mode 100644 include/qemu/tsan.h
 create mode 100644 tests/docker/dockerfiles/ubuntu2004.docker
 create mode 100755 tests/docker/test-tsan
 create mode 100644 tests/tsan/blacklist.tsan
 create mode 100644 tests/tsan/suppressions.tsan

-- 
2.17.1



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

end of thread, other threads:[~2020-06-08 21:11 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 17:34 [PATCH v2 00/13] Add Thread Sanitizer support to QEMU Robert Foley
2020-06-05 17:34 ` [PATCH v2 01/13] configure: add --enable-tsan flag + fiber annotations for coroutine-ucontext Robert Foley
2020-06-08 13:39   ` Alex Bennée
2020-06-08 20:09     ` Robert Foley
2020-06-05 17:34 ` [PATCH v2 02/13] cpu: convert queued work to a QSIMPLEQ Robert Foley
2020-06-05 17:34 ` [PATCH v2 03/13] thread: add qemu_spin_destroy Robert Foley
2020-06-05 17:34 ` [PATCH v2 04/13] cputlb: destroy CPUTLB with tlb_destroy Robert Foley
2020-06-05 17:34 ` [PATCH v2 05/13] qht: call qemu_spin_destroy for head buckets Robert Foley
2020-06-05 17:34 ` [PATCH v2 06/13] tcg: call qemu_spin_destroy for tb->jmp_lock Robert Foley
2020-06-08 14:44   ` Alex Bennée
2020-06-08 21:10     ` Robert Foley
2020-06-05 17:34 ` [PATCH v2 07/13] translate-all: call qemu_spin_destroy for PageDesc Robert Foley
2020-06-08 15:04   ` Alex Bennée
2020-06-05 17:34 ` [PATCH v2 08/13] thread: add tsan annotations to QemuSpin Robert Foley
2020-06-05 17:34 ` [PATCH v2 09/13] tests/docker: Added docker build support for TSan Robert Foley
2020-06-08 13:56   ` Alex Bennée
2020-06-05 17:34 ` [PATCH v2 10/13] include/qemu: Added tsan.h for annotations Robert Foley
2020-06-08 15:10   ` Alex Bennée
2020-06-05 17:34 ` [PATCH v2 11/13] util: Added tsan annotate for thread name Robert Foley
2020-06-05 17:34 ` [PATCH v2 12/13] docs: Added details on TSan to testing.rst Robert Foley
2020-06-08 15:13   ` Alex Bennée
2020-06-05 17:34 ` [PATCH v2 13/13] tests: Disable select tests under TSan, which hit TSan issue Robert Foley
2020-06-08  3:51   ` Emilio G. Cota
2020-06-08 15:41   ` Alex Bennée
2020-06-05 21:44 ` [PATCH v2 00/13] Add Thread Sanitizer support to QEMU no-reply
2020-06-08 15:42 ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.