qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 03/10] accel/tcg: Use one_insn_per_tb global instead of ol


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 03/10] accel/tcg: Use one_insn_per_tb global instead of old singlestep global
Date: Thu, 20 Apr 2023 10:55:01 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 17/4/23 18:40, Peter Maydell wrote:
The only place left that looks at the old 'singlestep' global
variable is the TCG curr_cflags() function.  Replace the old global
with a new 'one_insn_per_tb' which is defined in tcg-all.c and
declared in accel/tcg/internal.h.  This keeps it restricted to the
TCG code, unlike 'singlestep' which was available to every file in
the system and defined in multiple different places for softmmu vs
linux-user vs bsd-user.

While we're making this change, use qatomic_read() and qatomic_set()
on the accesses to the new global, because TCG will read it without
holding a lock.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
In discussion on v2, we talked about combining this with the
'nochain' flag so as to have a single 'tcg_cflags_global' that
held the flags for the current (one_insn_per_tb, nochain) state.
I have not attempted that here, because it's a little tricky:
  * util/log.c is built into some binaries that don't have an
    accelerator at all (the tools), so it can't simply call
    current_accel() to get the TCG accelerator
  * the initial value of the logging flags is set before the
    TCG accelerator is even created
So I leave that to somebody else to have a go at if they like.
---
  accel/tcg/internal.h      | 2 ++
  include/exec/cpu-common.h | 2 --
  accel/tcg/cpu-exec.c      | 2 +-
  accel/tcg/tcg-all.c       | 6 ++++--
  bsd-user/main.c           | 1 -
  linux-user/main.c         | 1 -
  softmmu/globals.c         | 1 -
  7 files changed, 7 insertions(+), 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

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