qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH 2/3] accel/tcg: Factor out common tcg_exec_reset() helper
Date: Tue, 21 Jan 2025 16:41:37 -0800	[thread overview]
Message-ID: <cf3ccf51-443a-4f89-93b7-ff1548eb76c2@linaro.org> (raw)
In-Reply-To: <20250102182521.65428-3-philmd@linaro.org>

On 1/2/25 10:25, Philippe Mathieu-Daudé wrote:
> Since tcg_cpu_reset_hold() is a system emulation specific
> helper, factor tcg_exec_reset() out so we can use it from
> user emulation, similarly to the [un]realize() handlers.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/internal-common.h | 1 +
>   accel/tcg/cpu-exec-common.c | 6 ++++++
>   accel/tcg/tcg-accel-ops.c   | 4 ++--
>   3 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
> index c8d714256cb..8b474fc1256 100644
> --- a/accel/tcg/internal-common.h
> +++ b/accel/tcg/internal-common.h
> @@ -55,6 +55,7 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
>   
>   bool tcg_exec_realizefn(CPUState *cpu, Error **errp);
>   void tcg_exec_unrealizefn(CPUState *cpu);
> +void tcg_exec_reset(CPUState *cpu);
>   
>   /* current cflags for hashing/comparison */
>   uint32_t curr_cflags(CPUState *cpu);
> diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
> index 6ecfc4e7c21..72ab9c3d977 100644
> --- a/accel/tcg/cpu-exec-common.c
> +++ b/accel/tcg/cpu-exec-common.c
> @@ -21,6 +21,7 @@
>   #include "system/cpus.h"
>   #include "system/tcg.h"
>   #include "qemu/plugin.h"
> +#include "exec/tb-flush.h"
>   #include "internal-common.h"
>   
>   bool tcg_allowed;
> @@ -56,3 +57,8 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc)
>       cpu->exception_index = EXCP_ATOMIC;
>       cpu_loop_exit_restore(cpu, pc);
>   }
> +
> +void tcg_exec_reset(CPUState *cpu)
> +{
> +    tcg_flush_jmp_cache(cpu);
> +}
> diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
> index 6e3f1fa92b2..4fe6821b017 100644
> --- a/accel/tcg/tcg-accel-ops.c
> +++ b/accel/tcg/tcg-accel-ops.c
> @@ -34,7 +34,6 @@
>   #include "qemu/timer.h"
>   #include "exec/exec-all.h"
>   #include "exec/hwaddr.h"
> -#include "exec/tb-flush.h"
>   #include "exec/translation-block.h"
>   #include "gdbstub/enums.h"
>   
> @@ -44,6 +43,7 @@
>   #include "tcg-accel-ops-mttcg.h"
>   #include "tcg-accel-ops-rr.h"
>   #include "tcg-accel-ops-icount.h"
> +#include "internal-common.h"
>   
>   /* common functionality among all TCG variants */
>   
> @@ -83,7 +83,7 @@ int tcg_cpu_exec(CPUState *cpu)
>   
>   static void tcg_cpu_reset_hold(CPUState *cpu)
>   {
> -    tcg_flush_jmp_cache(cpu);
> +    tcg_exec_reset(cpu);
>   
>       tlb_flush(cpu);
>   }

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>


  parent reply	other threads:[~2025-01-22  0:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 18:25 [PATCH 0/3] linux-user: Call tcg_flush_jmp_cache() before re-using threads Philippe Mathieu-Daudé
2025-01-02 18:25 ` [PATCH 1/3] linux-user: Only include 'exec/tb-flush.h' header when necessary Philippe Mathieu-Daudé
2025-01-09 22:13   ` Ilya Leoshkevich
2025-01-22  0:41   ` Pierrick Bouvier
2025-01-02 18:25 ` [PATCH 2/3] accel/tcg: Factor out common tcg_exec_reset() helper Philippe Mathieu-Daudé
2025-01-09 22:16   ` Ilya Leoshkevich
2025-01-22  0:41   ` Pierrick Bouvier [this message]
2025-01-02 18:25 ` [PATCH 3/3] accel/tcg: Implement cpu_exec_reset_hold() on user emulation Philippe Mathieu-Daudé
2025-01-09 23:43   ` Ilya Leoshkevich
2025-01-14 20:52     ` Ilya Leoshkevich
2025-01-22  0:46   ` Pierrick Bouvier
2025-01-09 10:59 ` [PATCH 0/3] linux-user: Call tcg_flush_jmp_cache() before re-using threads Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf3ccf51-443a-4f89-93b7-ff1548eb76c2@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=iii@linux.ibm.com \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).