Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-23 Thread Paolo Bonzini
On 2/21/22 15:29, Stefan Hajnoczi wrote: -static __thread bool iothread_locked = false; +QEMU_DEFINE_STATIC_CO_TLS(bool, iothread_locked) bool qemu_mutex_iothread_locked(void) { -return iothread_locked; +return get_iothread_locked(); } Can we rename either the variable or

Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-23 Thread Peter Maydell
On Wed, 23 Feb 2022 at 09:45, Paolo Bonzini wrote: > > On 2/21/22 15:29, Stefan Hajnoczi wrote: > > -static __thread bool iothread_locked = false; > > +QEMU_DEFINE_STATIC_CO_TLS(bool, iothread_locked) > > > > bool qemu_mutex_iothread_locked(void) > > { > > -return iothread_locked; > > +

Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-22 Thread Stefan Hajnoczi
On Mon, Feb 21, 2022 at 04:09:06PM +0100, Philippe Mathieu-Daudé wrote: > On 21/2/22 15:29, Stefan Hajnoczi wrote: > > qemu_mutex_iothread_locked() may be used from coroutines. Standard > > __thread variables cannot be used by coroutines. Use the coroutine TLS > > macros instead. > > > >

Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-21 Thread Philippe Mathieu-Daudé
On 21/2/22 15:29, Stefan Hajnoczi wrote: qemu_mutex_iothread_locked() may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi --- softmmu/cpus.c | 8 1 file changed, 4 insertions(+),

Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-21 Thread Philippe Mathieu-Daudé
On 21/2/22 15:29, Stefan Hajnoczi wrote: qemu_mutex_iothread_locked() may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi --- softmmu/cpus.c | 8 1 file changed, 4 insertions(+),

[PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked

2022-02-21 Thread Stefan Hajnoczi
qemu_mutex_iothread_locked() may be used from coroutines. Standard __thread variables cannot be used by coroutines. Use the coroutine TLS macros instead. Signed-off-by: Stefan Hajnoczi --- softmmu/cpus.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/softmmu/cpus.c