Skip to content

TSA: make sure QEMU compiles when using clang TSA

Emanuele Giuseppe Esposito qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warningsinclude/qemu/thread.h util/qemu-thread-posix.c+10 -63 replies
2/3bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warningsbsd-user/qemu.h include/exec/exec-all.h+6 -412 replies
3/3configure: Enable -Wthread-safety if presentconfigure+1 -04 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchEmanuele Giuseppe EspositoWarner Losh
1/3
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] TSA: make sure QEMU compiles when using clang TSA

This serie aims to enable clang Thread Safety Analysis (TSA) in QEMU. The goal is to use it for our multiqueue project aiming to replace the block layer AioContext lock with a rwlock and make sure the lock is taken correctly everywhere [1].

By default, TSA covers pthread mutexes, therefore when added in QEMU it immediately detects some wrappers using pthread_mutex_lock/unlock without using the proper TSA macros. Since adding such macro requires scanning all possible callers of the affected wrapper, simply use TSA_NO_TSA to suppress the warnings.

[1] = https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg00903.html

Emanuele Giuseppe Esposito (2):
util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warnings

Kevin Wolf (1):
configure: Enable -Wthread-safety if present

 configure                |  1 +
 bsd-user/qemu.h          |  5 +++--
 include/exec/exec-all.h  |  5 +++--
 include/qemu/thread.h    | 14 +++++++++-----
 util/qemu-thread-posix.c |  2 +-
 5 files changed, 17 insertions(+), 10 deletions(-)
Signature · 1 line
2.39.0