qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Anton Johansson <anjo@rev.ng>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Pavel Dovgalyuk" <Pavel.Dovgalyuk@ispras.ru>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>
Subject: [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/
Date: Wed, 24 Jan 2024 11:16:37 +0100	[thread overview]
Message-ID: <20240124101639.30056-8-philmd@linaro.org> (raw)
In-Reply-To: <20240124101639.30056-1-philmd@linaro.org>

Move this x86-specific code out of the generic accel/tcg/.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/i386/tcg/helper-tcg.h        |  1 +
 accel/tcg/cpu-exec.c                |  9 ---------
 target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++
 target/i386/tcg/tcg-cpu.c           |  1 +
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h
index ce34b737bb..253b1f561e 100644
--- a/target/i386/tcg/helper-tcg.h
+++ b/target/i386/tcg/helper-tcg.h
@@ -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
 
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 4ab7d6c896..5a978a9e72 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -768,21 +768,12 @@ static inline bool cpu_handle_exception(CPUClass *cc, CPUState *cpu, int *ret)
 }
 
 #ifndef CONFIG_USER_ONLY
-/*
- * 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.
- */
 static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_request)
 {
-#if defined(TARGET_I386)
-    return !(interrupt_request & CPU_INTERRUPT_POLL);
-#else
     if (!cc->tcg_ops->need_replay_interrupt) {
         return true;
     }
     return cc->tcg_ops->need_replay_interrupt(interrupt_request);
-#endif
 }
 #endif /* !CONFIG_USER_ONLY */
 
diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/seg_helper.c
index 1cb5a0db45..e6f42282bb 100644
--- a/target/i386/tcg/sysemu/seg_helper.c
+++ b/target/i386/tcg/sysemu/seg_helper.c
@@ -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);
diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
index e1405b7be9..255d56d4c3 100644
--- a/target/i386/tcg/tcg-cpu.c
+++ b/target/i386/tcg/tcg-cpu.c
@@ -123,6 +123,7 @@ static const struct 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 */
 };
 
-- 
2.41.0



  parent reply	other threads:[~2024-01-24 10:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 10:16 [PATCH 0/9] accel/tcg: Extract some x86-specific code Philippe Mathieu-Daudé
2024-01-24 10:16 ` [PATCH 1/9] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson Philippe Mathieu-Daudé
2024-01-24 16:45   ` Anton Johansson via
2024-01-24 22:54   ` Richard Henderson
2024-01-24 10:16 ` [PATCH 2/9] accel/tcg: Rename tcg_cpus_destroy() -> tcg_cpu_destroy() Philippe Mathieu-Daudé
2024-01-24 16:47   ` Anton Johansson via
2024-01-24 22:54   ` Richard Henderson
2024-01-24 10:16 ` [PATCH 3/9] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec() Philippe Mathieu-Daudé
2024-01-24 16:48   ` Anton Johansson via
2024-01-24 22:55   ` Richard Henderson
2024-01-24 10:16 ` [PATCH 4/9] accel/tcg: Un-inline icount_exit_request() for clarity Philippe Mathieu-Daudé
2024-01-24 17:00   ` Anton Johansson via
2024-01-24 22:56   ` Richard Henderson
2024-01-24 10:16 ` [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage Philippe Mathieu-Daudé
2024-01-24 17:15   ` Anton Johansson via
2024-01-24 22:59   ` Richard Henderson
2024-01-25  4:46     ` Philippe Mathieu-Daudé
2024-01-24 10:16 ` [PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler Philippe Mathieu-Daudé
2024-01-24 17:16   ` Anton Johansson via
2024-01-24 23:00   ` Richard Henderson
2024-01-25  6:01   ` Pavel Dovgalyuk
2024-01-24 10:16 ` Philippe Mathieu-Daudé [this message]
2024-01-24 17:17   ` [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Anton Johansson via
2024-01-24 20:02     ` Philippe Mathieu-Daudé
2024-01-24 23:01   ` Richard Henderson
2024-01-25  6:01   ` Pavel Dovgalyuk
2024-01-24 10:16 ` [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler Philippe Mathieu-Daudé
2024-01-24 17:19   ` Anton Johansson via
2024-01-24 23:02   ` Richard Henderson
2024-01-24 10:16 ` [PATCH 9/9] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/ Philippe Mathieu-Daudé
2024-01-24 17:19   ` Anton Johansson via
2024-01-24 23:03   ` Richard Henderson
2024-01-24 10:17 ` [PATCH 0/9] accel/tcg: Extract some x86-specific code Philippe Mathieu-Daudé
2024-01-28  3:35 ` Richard Henderson

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=20240124101639.30056-8-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=Pavel.Dovgalyuk@ispras.ru \
    --cc=anjo@rev.ng \
    --cc=cfontana@suse.de \
    --cc=eduardo@habkost.net \
    --cc=pbonzini@redhat.com \
    --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).