qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 09/12] accel/tcg: Restrict cpu_loop_exit_requested() to TCG
Date: Sun, 28 Apr 2024 23:49:12 +0200	[thread overview]
Message-ID: <20240428214915.10339-10-philmd@linaro.org> (raw)
In-Reply-To: <20240428214915.10339-1-philmd@linaro.org>

cpu_loop_exit_requested() is specific to TCG, move it
to "exec/translate-all.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/exec/exec-all.h       | 17 -----------------
 include/exec/translate-all.h  | 20 ++++++++++++++++++++
 target/arm/tcg/helper-a64.c   |  1 +
 target/s390x/tcg/mem_helper.c |  1 +
 4 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 4c5e470581..2be7ef1809 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -29,23 +29,6 @@
 #include "exec/translation-block.h"
 #include "qemu/clang-tsa.h"
 
-/**
- * cpu_loop_exit_requested:
- * @cpu: The CPU state to be tested
- *
- * Indicate if somebody asked for a return of the CPU to the main loop
- * (e.g., via cpu_exit() or cpu_interrupt()).
- *
- * This is helpful for architectures that support interruptible
- * instructions. After writing back all state to registers/memory, this
- * call can be used to check if it makes sense to return to the main loop
- * or to continue executing the interruptible instruction.
- */
-static inline bool cpu_loop_exit_requested(CPUState *cpu)
-{
-    return (int32_t)qatomic_read(&cpu->neg.icount_decr.u32) < 0;
-}
-
 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
 /* cputlb.c */
 /**
diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h
index 85c9460c7c..dd26f70378 100644
--- a/include/exec/translate-all.h
+++ b/include/exec/translate-all.h
@@ -19,8 +19,28 @@
 #ifndef TRANSLATE_ALL_H
 #define TRANSLATE_ALL_H
 
+#include "qemu/atomic.h"
 #include "exec/exec-all.h"
+#include "hw/core/cpu.h"
 
+#ifdef CONFIG_TCG
+/**
+ * cpu_loop_exit_requested:
+ * @cpu: The CPU state to be tested
+ *
+ * Indicate if somebody asked for a return of the CPU to the main loop
+ * (e.g., via cpu_exit() or cpu_interrupt()).
+ *
+ * This is helpful for architectures that support interruptible
+ * instructions. After writing back all state to registers/memory, this
+ * call can be used to check if it makes sense to return to the main loop
+ * or to continue executing the interruptible instruction.
+ */
+static inline bool cpu_loop_exit_requested(CPUState *cpu)
+{
+    return (int32_t)qatomic_read(&cpu->neg.icount_decr.u32) < 0;
+}
+#endif
 
 /* translate-all.c */
 void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
index 0ea8668ab4..f78430da0d 100644
--- a/target/arm/tcg/helper-a64.c
+++ b/target/arm/tcg/helper-a64.c
@@ -29,6 +29,7 @@
 #include "internals.h"
 #include "qemu/crc32c.h"
 #include "exec/exec-all.h"
+#include "exec/translate-all.h"
 #include "exec/cpu_ldst.h"
 #include "qemu/int128.h"
 #include "qemu/atomic128.h"
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 6a308c5553..17fab5e8be 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -25,6 +25,7 @@
 #include "tcg_s390x.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
+#include "exec/translate-all.h"
 #include "exec/page-protection.h"
 #include "exec/cpu_ldst.h"
 #include "hw/core/tcg-cpu-ops.h"
-- 
2.41.0



  parent reply	other threads:[~2024-04-28 21:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28 21:49 [PATCH v2 00/12] exec: Rework around CPUState user fields Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 01/12] plugins: Update stale comment Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 02/12] plugins/api: Only include 'exec/ram_addr.h' with system emulation Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 03/12] exec: Include missing license in 'exec/cpu-common.h' Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 04/12] exec/cpu: Indent TARGET_PAGE_foo definitions Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 05/12] exec/cpu: Remove obsolete PAGE_RESERVED definition Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 06/12] exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 07/12] exec/cpu: Extract page-protection definitions to page-protection.h Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 08/12] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb() Philippe Mathieu-Daudé
2024-04-28 22:05   ` Richard Henderson
2024-04-28 21:49 ` Philippe Mathieu-Daudé [this message]
2024-04-28 22:08   ` [PATCH v2 09/12] accel/tcg: Restrict cpu_loop_exit_requested() to TCG Richard Henderson
2024-04-28 22:17     ` Philippe Mathieu-Daudé
2024-04-29 21:23       ` Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 10/12] accel/tcg: Remove pointless initialization of cflags_next_tb Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 11/12] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold() Philippe Mathieu-Daudé
2024-04-28 21:49 ` [PATCH v2 12/12] accel/tcg: Access tcg_cflags with getter / setter Philippe Mathieu-Daudé
2024-04-29 12:02 ` [PATCH v2 00/12] exec: Rework around CPUState user fields 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=20240428214915.10339-10-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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).