[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
- [Qemu-devel] [RFC 00/10] MultiThread TCG., fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 03/10] replace spinlock by QemuMutex., fred . konrad, 2015/01/16
- Re: [Qemu-devel] [RFC 03/10] replace spinlock by QemuMutex.,
Peter Maydell <=
- [Qemu-devel] [RFC 07/10] tcg: remove tcg_halt_cond global variable., fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 08/10] Drop global lock during TCG code execution, fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 01/10] target-arm: protect cpu_exclusive_*., fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 09/10] cpu: remove exit_request global., fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 05/10] extract TBContext from TCGContext., fred . konrad, 2015/01/16
- [Qemu-devel] [RFC 10/10] tcg: switch on multithread., fred . konrad, 2015/01/16