accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
Move the TCG-specific cpu_restore_state() declaration out of the generic "exec/cpu-common.h" header, to the recently created "accel/tcg/cpu-loop.h" one. Include "accel/tcg/cpu-loop.h" where appropriate. Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260617171438.75914-8-philmd@oss.qualcomm.com>
Philippe Mathieu-Daudé committed
Jun 16, 2026 at 17:59 UTC
e1883d1a329a8a066b59a3139f23c0319cd73bc5
19 files changed
+29
-12
accel/tcg/cpu-exec-common.c
+1
@@ -21,6 +21,7 @@
21
#include "exec/log.h"
22
#include "system/tcg.h"
23
#include "qemu/plugin.h"
24
+#include "accel/tcg/cpu-loop.h"
25
#include "internal-common.h"
26
27
bool tcg_allowed;
accel/tcg/user-exec.c
+1
@@ -25,6 +25,7 @@
25
#include "qemu/bitops.h"
26
#include "qemu/rcu.h"
27
#include "accel/tcg/cpu-ldst-common.h"
28
+#include "accel/tcg/cpu-loop.h"
29
#include "accel/tcg/helper-retaddr.h"
30
#include "accel/tcg/probe.h"
31
#include "user/cpu_loop.h"
include/accel/tcg/cpu-loop.h
+12
@@ -33,4 +33,16 @@ void cpu_exec_step_atomic(CPUState *cpu);
33
*/
34
bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
35
36
+/**
37
+ * cpu_restore_state:
38
+ * @cpu: the cpu context
39
+ * @host_pc: the host pc within the translation
40
+ * @return: true if state was restored, false otherwise
41
+ *
42
+ * Attempt to restore the state for a fault occurring in translated
43
+ * code. If @host_pc is not in translated code no state is
44
+ * restored and the function returns false.
45
+ */
46
+bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
47
+
48
#endif
include/exec/cpu-common.h
-12
@@ -61,18 +61,6 @@ void list_cpus(void);
61
#ifdef CONFIG_TCG
62
#include "qemu/atomic.h"
63
64
-/**
65
- * cpu_restore_state:
66
- * @cpu: the cpu context
67
- * @host_pc: the host pc within the translation
68
- * @return: true if state was restored, false otherwise
69
- *
70
- * Attempt to restore the state for a fault occurring in translated
71
- * code. If @host_pc is not in translated code no state is
72
- * restored and the function returns false.
73
- */
74
-bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
75
-
64
/**
65
* cpu_loop_exit_requested:
66
* @cpu: The CPU state to be tested
target/alpha/helper.c
+1
@@ -28,6 +28,7 @@
28
#include "exec/helper-proto.h"
29
#include "qemu/qemu-print.h"
30
#include "system/memory.h"
31
+#include "accel/tcg/cpu-loop.h"
32
#include "qemu/plugin.h"
33
34
target/alpha/mem_helper.c
+1
@@ -21,6 +21,7 @@
21
#include "cpu.h"
22
#include "exec/helper-proto.h"
23
#include "accel/tcg/cpu-ldst.h"
24
+#include "accel/tcg/cpu-loop.h"
25
26
static void do_unaligned_access(CPUAlphaState *env, vaddr addr, uintptr_t retaddr)
27
{
target/arm/tcg/op_helper.c
+1
@@ -23,6 +23,7 @@
23
#include "helper.h"
24
#include "internals.h"
25
#include "cpu-features.h"
26
+#include "accel/tcg/cpu-loop.h"
27
#include "accel/tcg/probe.h"
28
#include "cpregs.h"
29
target/arm/tcg/tlb_helper.c
+1
@@ -8,6 +8,7 @@
8
#include "qemu/osdep.h"
9
#include "cpu.h"
10
#include "helper.h"
11
+#include "accel/tcg/cpu-loop.h"
12
#include "internals.h"
13
#include "cpu-features.h"
14
#include "hw/intc/armv7m_nvic.h"
target/hppa/cpu.c
+1
@@ -29,6 +29,7 @@
29
#include "fpu/softfloat.h"
30
#include "tcg/tcg.h"
31
#include "hw/hppa/hppa_hardware.h"
32
+#include "accel/tcg/cpu-loop.h"
33
#include "accel/tcg/cpu-ops.h"
34
35
static void hppa_cpu_set_pc(CPUState *cs, vaddr value)
target/hppa/mem_helper.c
+1
@@ -21,6 +21,7 @@
21
#include "qemu/log.h"
22
#include "cpu.h"
23
#include "exec/cputlb.h"
24
+#include "accel/tcg/cpu-loop.h"
25
#include "accel/tcg/cpu-mmu-index.h"
26
#include "accel/tcg/probe.h"
27
#include "exec/page-protection.h"
target/hppa/op_helper.c
+1
@@ -22,6 +22,7 @@
22
#include "cpu.h"
23
#include "exec/helper-proto.h"
24
#include "accel/tcg/cpu-ldst.h"
25
+#include "accel/tcg/cpu-loop.h"
26
#include "accel/tcg/probe.h"
27
#include "qemu/timer.h"
28
#include "trace.h"
target/i386/tcg/system/svm_helper.c
+1
@@ -23,6 +23,7 @@
23
#include "exec/helper-proto.h"
24
#include "exec/cputlb.h"
25
#include "accel/tcg/cpu-ldst.h"
26
+#include "accel/tcg/cpu-loop.h"
27
#include "tcg/helper-tcg.h"
28
29
/* Secure Virtual Machine helpers */
target/m68k/op_helper.c
+1
@@ -21,6 +21,7 @@
21
#include "cpu.h"
22
#include "exec/helper-proto.h"
23
#include "accel/tcg/cpu-ldst.h"
24
+#include "accel/tcg/cpu-loop.h"
25
#include "semihosting/semihost.h"
26
#include "qemu/plugin.h"
27
target/microblaze/helper.c
+1
@@ -21,6 +21,7 @@
21
#include "qemu/osdep.h"
22
#include "cpu.h"
23
#include "exec/cputlb.h"
24
+#include "accel/tcg/cpu-loop.h"
25
#include "accel/tcg/cpu-mmu-index.h"
26
#include "exec/page-protection.h"
27
#include "exec/target_page.h"
target/ppc/tcg-excp_helper.c
+1
@@ -21,6 +21,7 @@
21
#include "qemu/log.h"
22
#include "target/ppc/cpu.h"
23
#include "accel/tcg/cpu-ldst.h"
24
+#include "accel/tcg/cpu-loop.h"
25
#include "exec/helper-proto.h"
26
#include "system/runstate.h"
27
target/s390x/tcg/excp_helper.c
+1
@@ -24,6 +24,7 @@
24
#include "exec/helper-proto.h"
25
#include "exec/cputlb.h"
26
#include "exec/target_page.h"
27
+#include "accel/tcg/cpu-loop.h"
28
#include "s390x-internal.h"
29
#include "tcg_s390x.h"
30
#ifndef CONFIG_USER_ONLY
target/sh4/op_helper.c
+1
@@ -20,6 +20,7 @@
20
#include "cpu.h"
21
#include "exec/helper-proto.h"
22
#include "accel/tcg/cpu-ldst.h"
23
+#include "accel/tcg/cpu-loop.h"
24
#include "fpu/softfloat.h"
25
26
#ifndef CONFIG_USER_ONLY
target/tricore/op_helper.c
+1
@@ -19,6 +19,7 @@
19
#include "qemu/host-utils.h"
20
#include "exec/helper-proto.h"
21
#include "accel/tcg/cpu-ldst.h"
22
+#include "accel/tcg/cpu-loop.h"
23
#include "qemu/plugin.h"
24
#include <zlib.h> /* for crc32 */
25
target/xtensa/helper.c
+1
@@ -32,6 +32,7 @@
32
#include "exec/target_page.h"
33
#include "gdbstub/helpers.h"
34
#include "exec/helper-proto.h"
35
+#include "accel/tcg/cpu-loop.h"
36
#include "qemu/error-report.h"
37
#include "qemu/qemu-print.h"
38
#include "qemu/host-utils.h"