accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'

Move the following TCG-specific cpu_loop_exit_*() declarations
out of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one, documenting them:

 - cpu_loop_exit_noexc()
 - cpu_loop_exit_atomic()
 - cpu_loop_exit_restore()
 - cpu_loop_exit()

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-11-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé
2026-06-17 19:11:15 +02:00
parent f6ff0d1ffc
commit 2368ea9744
42 changed files with 70 additions and 5 deletions

View File

@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "qemu/main-loop.h"
#include "qemu/target-info.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "accel/tcg/iommu.h"
#include "accel/tcg/probe.h"

View File

@@ -26,6 +26,7 @@
#include "exec/mmap-lock.h"
#include "exec/tb-flush.h"
#include "exec/target_page.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "tb-internal.h"
#include "system/tcg.h"

View File

@@ -25,6 +25,7 @@
#include "qemu/host-utils.h"
#include "exec/cpu-common.h"
#include "exec/helper-proto-common.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/getpc.h"
#define HELPER_H "accel/tcg/tcg-runtime.h"

View File

@@ -25,6 +25,7 @@
#include "exec/translation-block.h"
#include "system/tcg.h"
#include "system/replay.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "hw/core/cpu.h"
#include "internal-common.h"

View File

@@ -25,6 +25,7 @@
#include "hw/core/cpu.h"
#include "hw/misc/mips_itu.h"
#include "hw/core/qdev-properties.h"
#include "accel/tcg/cpu-loop.h"
#include "target/mips/cpu.h"
#define ITC_TAG_ADDRSPACE_SZ (ITC_ADDRESSMAP_NUM * 8)

View File

@@ -45,4 +45,32 @@ bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
*/
bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
/**
* cpu_loop_exit_noexc:
* @cpu: the cpu context
*
* Exit the current TB, but without causing any exception to be raised.
*/
G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
/**
* cpu_loop_exit_restore:
* @cpu: the cpu context
* @host_pc: the host pc within the translation
*
* Attempt to restore the state for a fault occurring in translated
* code. If @host_pc is not in translated code no state is
* restored. Finally, exit the current TB.
*/
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t host_pc);
G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t host_pc);
/**
* cpu_loop_exit:
* @cpu: the cpu context
*
* Exit the current TB.
*/
G_NORETURN void cpu_loop_exit(CPUState *cpu);
#endif

View File

@@ -77,12 +77,7 @@ static inline bool cpu_loop_exit_requested(const CPUState *cpu)
{
return (int32_t)qatomic_read(&cpu->neg.icount_decr.u32) < 0;
}
G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
#endif /* CONFIG_TCG */
G_NORETURN void cpu_loop_exit(CPUState *cpu);
/**
* env_archcpu(env)

View File

@@ -40,6 +40,7 @@
#include "qemu/plugin.h"
#include "qemu/log.h"
#include "system/memory.h"
#include "accel/tcg/cpu-loop.h"
#include "tcg/tcg.h"
#include "exec/cpu-common.h"
#include "exec/gdbstub.h"

View File

@@ -18,6 +18,7 @@
#include "qemu/osdep.h"
#include "semihosting/semihost.h"
#include "semihosting/console.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/cpu-common.h"
#include "exec/gdbstub.h"
#include "qemu/log.h"

View File

@@ -31,6 +31,7 @@
#include "qemu/crc32c.h"
#include "exec/cpu-common.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/helper-retaddr.h"
#include "accel/tcg/probe.h"
#include "exec/target_page.h"

View File

@@ -23,6 +23,7 @@
#include "qemu/error-report.h"
#include "cpu.h"
#include "accel/tcg/cpu-ops.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/cputlb.h"
#include "exec/page-protection.h"
#include "exec/target_page.h"

View File

@@ -18,6 +18,7 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/probe.h"
#include "exec/helper-proto.h"
#include "fpu/softfloat.h"

View File

@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "qemu/log.h"
#include "system/runstate.h"

View File

@@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/cputlb.h"

View File

@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/watchpoint.h"

View File

@@ -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 "system/address-spaces.h"
#include "system/memory.h"
#include "exec/cputlb.h"

View File

@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "tcg/helper-tcg.h"

View File

@@ -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 "tcg/helper-tcg.h"
#include "tcg/seg_helper.h"

View File

@@ -10,6 +10,7 @@
#include "qemu/log.h"
#include "qemu/plugin.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "exec/translation-block.h"
#include "exec/target_page.h"

View File

@@ -17,6 +17,7 @@
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/log.h"
#include "cpu-csr.h"
#include "tcg/tcg_loongarch.h"

View File

@@ -25,6 +25,7 @@
#include "exec/target_page.h"
#include "exec/gdbstub.h"
#include "exec/helper-proto.h"
#include "accel/tcg/cpu-loop.h"
#include "system/memory.h"
#include "gdbstub/helpers.h"
#include "fpu/softfloat.h"

View File

@@ -24,6 +24,7 @@
#include "exec/helper-proto.h"
#include "qemu/host-utils.h"
#include "accel/tcg/cpu-ldst-common.h"
#include "accel/tcg/cpu-loop.h"
#include "fpu/softfloat.h"
void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)

View File

@@ -24,6 +24,7 @@
#include "internal.h"
#include "exec/helper-proto.h"
#include "exec/translation-block.h"
#include "accel/tcg/cpu-loop.h"
target_ulong exception_resume_pc(CPUMIPSState *env)
{

View File

@@ -26,6 +26,7 @@
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/log.h"
#include "exec/helper-proto.h"

View File

@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "exception.h"

View File

@@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/helper-proto.h"
#include "exception.h"

View File

@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "fpu/softfloat.h"

View File

@@ -24,6 +24,7 @@
#include "exec/cputlb.h"
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "accel/tcg/cpu-loop.h"
#include "qemu/host-utils.h"
#include "hw/core/loader.h"

View File

@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "internal.h"

View File

@@ -29,6 +29,7 @@
#include "system/memory.h"
#include "instmap.h"
#include "tcg/tcg-op.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "trace.h"
#include "semihosting/common-semi.h"

View File

@@ -24,6 +24,7 @@
#include "internals.h"
#include "exec/cputlb.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/probe.h"
#include "exec/helper-proto.h"
#include "exec/tlb-flags.h"

View File

@@ -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 "fpu/softfloat.h"
#include "tcg/debug-assert.h"

View File

@@ -24,6 +24,9 @@
#include "system/kvm.h"
#include "system/tcg.h"
#include "system/memory.h"
#ifdef CONFIG_TCG
#include "accel/tcg/cpu-loop.h"
#endif
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "hw/core/hw-error.h"

View File

@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "accel/tcg/cpu-loop.h"
#include "s390x-internal.h"
#include "tcg_s390x.h"
#include "exec/helper-proto.h"

View File

@@ -7,6 +7,7 @@
#include "qemu/osdep.h"
#include "exec/breakpoint.h"
#include "exec/watchpoint.h"
#include "accel/tcg/cpu-loop.h"
#include "target/s390x/cpu.h"
#include "target/s390x/s390x-internal.h"
#include "tcg_s390x.h"

View File

@@ -28,6 +28,7 @@
#include "exec/cputlb.h"
#include "exec/page-protection.h"
#include "accel/tcg/cpu-ldst.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/probe.h"
#include "exec/target_page.h"
#include "exec/tlb-flags.h"

View File

@@ -28,6 +28,7 @@
#include "qemu/timer.h"
#include "exec/cputlb.h"
#include "accel/tcg/cpu-ldst-common.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-mmu-index.h"
#include "exec/target_page.h"
#include "qapi/error.h"

View File

@@ -24,6 +24,7 @@
#include "exec/page-protection.h"
#include "exec/target_page.h"
#include "exec/log.h"
#include "accel/tcg/cpu-loop.h"
#include "qemu/plugin.h"
#if !defined(CONFIG_USER_ONLY)

View File

@@ -21,6 +21,7 @@
#include "cpu.h"
#include "qemu/timer.h"
#include "qemu/host-utils.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/cpu-common.h"
#include "exec/helper-proto.h"

View File

@@ -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 "exec/page-protection.h"
#include "exec/target_page.h"

View File

@@ -20,6 +20,7 @@
#include "hw/core/registerfields.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"

View File

@@ -28,6 +28,7 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "accel/tcg/cpu-loop.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "qemu/host-utils.h"