All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Subject: [PULL 45/48] accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
Date: Thu, 18 Jun 2026 14:28:22 +0200	[thread overview]
Message-ID: <20260618122825.90331-46-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260618122825.90331-1-philmd@oss.qualcomm.com>

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>
---
 include/accel/tcg/cpu-loop.h        | 12 ++++++++++++
 include/exec/cpu-common.h           | 12 ------------
 accel/tcg/cpu-exec-common.c         |  1 +
 accel/tcg/user-exec.c               |  1 +
 target/alpha/helper.c               |  1 +
 target/alpha/mem_helper.c           |  1 +
 target/arm/tcg/op_helper.c          |  1 +
 target/arm/tcg/tlb_helper.c         |  1 +
 target/hppa/cpu.c                   |  1 +
 target/hppa/mem_helper.c            |  1 +
 target/hppa/op_helper.c             |  1 +
 target/i386/tcg/system/svm_helper.c |  1 +
 target/m68k/op_helper.c             |  1 +
 target/microblaze/helper.c          |  1 +
 target/ppc/tcg-excp_helper.c        |  1 +
 target/s390x/tcg/excp_helper.c      |  1 +
 target/sh4/op_helper.c              |  1 +
 target/tricore/op_helper.c          |  1 +
 target/xtensa/helper.c              |  1 +
 19 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/include/accel/tcg/cpu-loop.h b/include/accel/tcg/cpu-loop.h
index 88333d39200..d98a8a2e0cd 100644
--- a/include/accel/tcg/cpu-loop.h
+++ b/include/accel/tcg/cpu-loop.h
@@ -33,4 +33,16 @@ void cpu_exec_step_atomic(CPUState *cpu);
  */
 bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
 
+/**
+ * cpu_restore_state:
+ * @cpu: the cpu context
+ * @host_pc: the host pc within the translation
+ * @return: true if state was restored, false otherwise
+ *
+ * Attempt to restore the state for a fault occurring in translated
+ * code. If @host_pc is not in translated code no state is
+ * restored and the function returns false.
+ */
+bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
+
 #endif
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 7c9631efb06..db67c7bb864 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -61,18 +61,6 @@ void list_cpus(void);
 #ifdef CONFIG_TCG
 #include "qemu/atomic.h"
 
-/**
- * cpu_restore_state:
- * @cpu: the cpu context
- * @host_pc: the host pc within the translation
- * @return: true if state was restored, false otherwise
- *
- * Attempt to restore the state for a fault occurring in translated
- * code. If @host_pc is not in translated code no state is
- * restored and the function returns false.
- */
-bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
-
 /**
  * cpu_loop_exit_requested:
  * @cpu: The CPU state to be tested
diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
index c5c513f1e4a..e48ea31373f 100644
--- a/accel/tcg/cpu-exec-common.c
+++ b/accel/tcg/cpu-exec-common.c
@@ -21,6 +21,7 @@
 #include "exec/log.h"
 #include "system/tcg.h"
 #include "qemu/plugin.h"
+#include "accel/tcg/cpu-loop.h"
 #include "internal-common.h"
 
 bool tcg_allowed;
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index d283d3cc724..7704e4017dd 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -25,6 +25,7 @@
 #include "qemu/bitops.h"
 #include "qemu/rcu.h"
 #include "accel/tcg/cpu-ldst-common.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/helper-retaddr.h"
 #include "accel/tcg/probe.h"
 #include "user/cpu_loop.h"
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 2abf07c1919..c3614ecafda 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -28,6 +28,7 @@
 #include "exec/helper-proto.h"
 #include "qemu/qemu-print.h"
 #include "system/memory.h"
+#include "accel/tcg/cpu-loop.h"
 #include "qemu/plugin.h"
 
 
diff --git a/target/alpha/mem_helper.c b/target/alpha/mem_helper.c
index 572ea9cb418..b3988417e4b 100644
--- a/target/alpha/mem_helper.c
+++ b/target/alpha/mem_helper.c
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 
 static void do_unaligned_access(CPUAlphaState *env, vaddr addr, uintptr_t retaddr)
 {
diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c
index 504526153a6..9f9ea39be5a 100644
--- a/target/arm/tcg/op_helper.c
+++ b/target/arm/tcg/op_helper.c
@@ -23,6 +23,7 @@
 #include "helper.h"
 #include "internals.h"
 #include "cpu-features.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/probe.h"
 #include "cpregs.h"
 
diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c
index cbef9cb03ef..4c3f16dc2aa 100644
--- a/target/arm/tcg/tlb_helper.c
+++ b/target/arm/tcg/tlb_helper.c
@@ -8,6 +8,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "helper.h"
+#include "accel/tcg/cpu-loop.h"
 #include "internals.h"
 #include "cpu-features.h"
 #include "hw/intc/armv7m_nvic.h"
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 6443122cf1a..a68152f9682 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -29,6 +29,7 @@
 #include "fpu/softfloat.h"
 #include "tcg/tcg.h"
 #include "hw/hppa/hppa_hardware.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/cpu-ops.h"
 
 static void hppa_cpu_set_pc(CPUState *cs, vaddr value)
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index f5076492264..01e6149c811 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -21,6 +21,7 @@
 #include "qemu/log.h"
 #include "cpu.h"
 #include "exec/cputlb.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/cpu-mmu-index.h"
 #include "accel/tcg/probe.h"
 #include "exec/page-protection.h"
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c
index f961046e4c5..76a8d8a0d34 100644
--- a/target/hppa/op_helper.c
+++ b/target/hppa/op_helper.c
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/probe.h"
 #include "qemu/timer.h"
 #include "trace.h"
diff --git a/target/i386/tcg/system/svm_helper.c b/target/i386/tcg/system/svm_helper.c
index d5ffabc2f4d..52a234e7fac 100644
--- a/target/i386/tcg/system/svm_helper.c
+++ b/target/i386/tcg/system/svm_helper.c
@@ -23,6 +23,7 @@
 #include "exec/helper-proto.h"
 #include "exec/cputlb.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "tcg/helper-tcg.h"
 
 /* Secure Virtual Machine helpers */
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
index 8148a8852e7..38f7a689814 100644
--- a/target/m68k/op_helper.c
+++ b/target/m68k/op_helper.c
@@ -21,6 +21,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "semihosting/semihost.h"
 #include "qemu/plugin.h"
 
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index 6a982c18c0f..05a90f5ecb2 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/cputlb.h"
+#include "accel/tcg/cpu-loop.h"
 #include "accel/tcg/cpu-mmu-index.h"
 #include "exec/page-protection.h"
 #include "exec/target_page.h"
diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c
index 5e6c1e326d4..b04f07a6377 100644
--- a/target/ppc/tcg-excp_helper.c
+++ b/target/ppc/tcg-excp_helper.c
@@ -21,6 +21,7 @@
 #include "qemu/log.h"
 #include "target/ppc/cpu.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "exec/helper-proto.h"
 #include "system/runstate.h"
 
diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c
index 05e448d3f20..d952bb20cf1 100644
--- a/target/s390x/tcg/excp_helper.c
+++ b/target/s390x/tcg/excp_helper.c
@@ -24,6 +24,7 @@
 #include "exec/helper-proto.h"
 #include "exec/cputlb.h"
 #include "exec/target_page.h"
+#include "accel/tcg/cpu-loop.h"
 #include "s390x-internal.h"
 #include "tcg_s390x.h"
 #ifndef CONFIG_USER_ONLY
diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c
index cf0f80e4a54..90c065b217b 100644
--- a/target/sh4/op_helper.c
+++ b/target/sh4/op_helper.c
@@ -20,6 +20,7 @@
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "fpu/softfloat.h"
 
 #ifndef CONFIG_USER_ONLY
diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c
index 3cff5000c73..46b17da2bc6 100644
--- a/target/tricore/op_helper.c
+++ b/target/tricore/op_helper.c
@@ -19,6 +19,7 @@
 #include "qemu/host-utils.h"
 #include "exec/helper-proto.h"
 #include "accel/tcg/cpu-ldst.h"
+#include "accel/tcg/cpu-loop.h"
 #include "qemu/plugin.h"
 #include <zlib.h> /* for crc32 */
 
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c
index 2d93b45036d..5a0e8655146 100644
--- a/target/xtensa/helper.c
+++ b/target/xtensa/helper.c
@@ -32,6 +32,7 @@
 #include "exec/target_page.h"
 #include "gdbstub/helpers.h"
 #include "exec/helper-proto.h"
+#include "accel/tcg/cpu-loop.h"
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "qemu/host-utils.h"
-- 
2.53.0



  parent reply	other threads:[~2026-06-18 12:34 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 12:27 [PULL 00/48] Accel patches for 2026-06-18 Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 01/48] system/cpu: Reset vCPU %exception_index before resuming it Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 02/48] system/memory: Constify various AddressSpace arguments (checks) Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 03/48] system/memory: Constify various AddressSpace arguments (flat-range) Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 04/48] system/memory: Constify various AddressSpace arguments (notify) Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 05/48] system/memory: Constify various AddressSpace arguments (cache) Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 06/48] system/memory: Constify various AddressSpace arguments (access) Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 07/48] system/memory: Constify various MemoryRegionCache arguments Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 08/48] system: Document cpu_physical_memory_*() declarations Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 09/48] accel/kvm: Replace legacy cpu_physical_memory_write() call Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 10/48] gdbstub/system: Replace legacy cpu_physical_memory_read/write() calls Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 11/48] target/s390x: Factor common s390_ipl_read/write() helpers Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 12/48] target/s390x: Replace legacy cpu_physical_memory_read/write() calls Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 13/48] system: Move cpu_physical_memory_*() declarations to 'system/physmem.h' Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 14/48] hw/xen/interface: Remove pre-C99 checks Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 15/48] qom/object: Remove pre-C11 check Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 16/48] tcg: Include missing 'qemu/bitops.h' header in tcg-gvec-desc.h Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 17/48] target/i386: Report TPR accesses to HVF Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 18/48] target/arm: Only set CPU_INTERRUPT_EXITTB for TCG Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 19/48] target/arm: Remove vcpu_dirty=true assigments in hvf_handle_exception() Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 20/48] target/arm: Better describe PMU depends on TCG or HVF Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 21/48] target/arm/ptw: Restrict PMSAv8 code to TCG Philippe Mathieu-Daudé
2026-06-18 12:27 ` [PULL 22/48] target/arm: Restrict TCG specific headers Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 23/48] target/ppc: Restrict TCGTBCPUState to TCG Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 24/48] target/loongarch: Remove unused 'accel/accel-cpu-target.h' header Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 25/48] target/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 26/48] accel/hvf: fix double hv_vcpu_destroy() causing teardown error on ARM Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 27/48] accel/hvf: Reduce hvf_kernel_irqchip_override scope Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 28/48] accel/tcg: remove duplicate include Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 29/48] accel/tcg: Restrict IOMMU declarations Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 30/48] meson: build macOS signed binary as part of the default target Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 31/48] configure: honor --extra-ldflags when forced to use objc_LINKER Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 32/48] util/cutils: drop qemu_strnlen() in favor of strnlen() Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 33/48] ui/cocoa: Use qemu_input_map_osx_to_linux Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 34/48] exec/cpu-common.h: Include missing 'qemu/thread.h' header Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 35/48] exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 36/48] exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 37/48] exec/cpu-common.h: Avoid including unused exec/page-protection.h header Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 38/48] system/memory: Remove unnecessary CONFIG_USER_ONLY guards Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 39/48] system/memory: Rename cpu_exec_init_all() -> machine_memory_init() Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 40/48] hw/s390x/ipl: Remove TCG dependency in handle_diag_308() Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 41/48] accel/tcg: Remove cpu_loop_exit() stub Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 42/48] accel/tcg: Move cpu_exec() out of 'exec/cpu-common.h' Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 43/48] accel/tcg: Move cpu_exec_step_atomic() " Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 44/48] accel/tcg: Move cpu_unwind_state_data() " Philippe Mathieu-Daudé
2026-06-18 12:28 ` Philippe Mathieu-Daudé [this message]
2026-06-18 12:28 ` [PULL 46/48] accel/tcg: Have cpu_loop_exit_requested() take const @cpu argument Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 47/48] accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h' Philippe Mathieu-Daudé
2026-06-18 12:28 ` [PULL 48/48] accel/tcg: Restrict headers being TCG specific Philippe Mathieu-Daudé
2026-06-18 17:54 ` [PULL 00/48] Accel patches for 2026-06-18 Stefan Hajnoczi

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=20260618122825.90331-46-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.