Skip to content

coroutine: use QEMU_DEFINE_STATIC_CO_TLS()

Stefan Hajnoczi qemu-devel 1 version Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()util/coroutine-ucontext.c+24 -140 replies
2/3coroutine: use QEMU_DEFINE_STATIC_CO_TLS()util/qemu-coroutine.c+24 -170 replies
3/3coroutine-win32: use QEMU_DEFINE_STATIC_CO_TLS()util/coroutine-win32.c+13 -50 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPhilippe Mathieu-Daudé
SeriesR-b
1/3
2/3
3/3

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] coroutine: use QEMU_DEFINE_STATIC_CO_TLS()

The coroutine implementation uses __thread variables internally. Compiler optimizations may cache Thread-Local Storage values across qemu_coroutine_yield(), leading to stale values being used after the coroutine is re-entered from another thread.

Kevin pointed out that the coroutine implementation itself is vulnerable to this problem. As a follow-up to my coroutine TLS patch series I'm sending these patches to convert __thread variables to the new "qemu/coroutine-tls.h" macros so they are safe.

Stefan Hajnoczi (3):
coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()
coroutine: use QEMU_DEFINE_STATIC_CO_TLS()
coroutine-win32: use QEMU_DEFINE_STATIC_CO_TLS()

 util/coroutine-ucontext.c | 38 +++++++++++++++++++++++-------------
 util/coroutine-win32.c    | 18 ++++++++++++-----
 util/qemu-coroutine.c     | 41 +++++++++++++++++++++++----------------
 3 files changed, 61 insertions(+), 36 deletions(-)
Signature · 1 line
2.35.1