]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/i386: Extract x86_need_replay_interrupt() from accel/tcg/
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 24 Jan 2024 10:16:37 +0000 (11:16 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 29 Jan 2024 11:04:10 +0000 (21:04 +1000)
Move this x86-specific code out of the generic accel/tcg/.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240124101639.30056-8-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/cpu-exec.c
target/i386/tcg/helper-tcg.h
target/i386/tcg/sysemu/seg_helper.c
target/i386/tcg/tcg-cpu.c

index 34d10eb173699953a9a6c0671fbec02c3f66bb00..2eacd694eaa8951e88b89b6d09b478157dd5e138 100644 (file)
@@ -773,13 +773,9 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
  */
 static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_request)
 {
-#if defined(TARGET_I386)
-    return !(interrupt_request & CPU_INTERRUPT_POLL);
-#else
     const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
     return !tcg_ops->need_replay_interrupt
            || tcg_ops->need_replay_interrupt(interrupt_request);
-#endif
 }
 #endif /* !CONFIG_USER_ONLY */
 
index ce34b737bb00829ba43bdffcda546f19faf996ba..253b1f561e15b6b7b630efb78a087f06fd67ce64 100644 (file)
@@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS);
  */
 void x86_cpu_do_interrupt(CPUState *cpu);
 #ifndef CONFIG_USER_ONLY
+bool x86_need_replay_interrupt(int interrupt_request);
 bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
 #endif
 
index 1cb5a0db45c4398bcd94a5cd0a72f822bb02ecc5..e6f42282bb6a8fa080c6eef1982435997804c3fd 100644 (file)
@@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs)
     }
 }
 
+bool x86_need_replay_interrupt(int interrupt_request)
+{
+    /*
+     * CPU_INTERRUPT_POLL is a virtual event which gets converted into a
+     * "real" interrupt event later. It does not need to be recorded for
+     * replay purposes.
+     */
+    return !(interrupt_request & CPU_INTERRUPT_POLL);
+}
+
 bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
 {
     X86CPU *cpu = X86_CPU(cs);
index 8e148e9bc41e858fb311ddb588b0dd9165b5e5e2..5bdcf45199c87dfa3d09876088f78e964f6cb938 100644 (file)
@@ -123,6 +123,7 @@ static const TCGCPUOps x86_tcg_ops = {
     .do_unaligned_access = x86_cpu_do_unaligned_access,
     .debug_excp_handler = breakpoint_handler,
     .debug_check_breakpoint = x86_debug_check_breakpoint,
+    .need_replay_interrupt = x86_need_replay_interrupt,
 #endif /* !CONFIG_USER_ONLY */
 };