On 2/21/22 15:29, Stefan Hajnoczi wrote:
+#define QEMU_DEFINE_CO_TLS(type, var)\
+static __thread type co_tls_##var; \
+type get_##var(void) { asm volatile(""); return co_tls_##var; } \
+void set_##
On Mon, Feb 21, 2022 at 03:16:22PM +, Peter Maydell wrote:
> On Mon, 21 Feb 2022 at 14:29, Stefan Hajnoczi wrote:
> >
> > Compiler optimizations can cache TLS values across coroutine yield
> > points, resulting in stale values from the previous thread when a
> > coroutine is re-entered by a ne
On Mon, 21 Feb 2022 at 14:29, Stefan Hajnoczi wrote:
>
> Compiler optimizations can cache TLS values across coroutine yield
> points, resulting in stale values from the previous thread when a
> coroutine is re-entered by a new thread.
>
> Serge Guelton developed an __attribute__((noinline)) wrappe
Compiler optimizations can cache TLS values across coroutine yield
points, resulting in stale values from the previous thread when a
coroutine is re-entered by a new thread.
Serge Guelton developed an __attribute__((noinline)) wrapper and tested
it with clang and gcc. I formatted his idea accordin