qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC 03/10] replace spinlock by QemuMutex.


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC 03/10] replace spinlock by QemuMutex.
Date: Thu, 29 Jan 2015 15:25:43 +0000

On 16 January 2015 at 17:19,  <address@hidden> wrote:
> From: KONRAD Frederic <address@hidden>
>
> spinlock is only used in two cases:
>   * cpu-exec.c: to protect TranslationBlock
>   * mem_helper.c: for lock helper in target-i386 (which seems broken).
>
> It's a pthread_mutex_t in user-mode so better using QemuMutex directly in this
> case.
> It allows as well to reuse tb_lock mutex of TBContext in case of multithread
> TCG.
>
> Signed-off-by: KONRAD Frederic <address@hidden>
> ---
>  cpu-exec.c               | 15 +++++++++++----
>  include/exec/exec-all.h  |  4 ++--
>  linux-user/main.c        |  6 +++---
>  target-i386/mem_helper.c | 16 +++++++++++++---
>  tcg/i386/tcg-target.c    |  8 ++++++++
>  5 files changed, 37 insertions(+), 12 deletions(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index a4f0eff..1e7513c 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -335,7 +335,9 @@ int cpu_exec(CPUArchState *env)
>      SyncClocks sc;
>
>      /* This must be volatile so it is not trashed by longjmp() */
> +#if defined(CONFIG_USER_ONLY)
>      volatile bool have_tb_lock = false;
> +#endif

This work should be removing ifdefs indicating differences between
handling of user-only and softmmu regarding locking and threads,
not adding new ones.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]