All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: [PATCH 10/11] target/i386: Convert cpu_exec_halt() to transition_halt_to_exec()
Date: Wed, 19 Aug 2026 16:56:48 +0200	[thread overview]
Message-ID: <20260819145649.23439-11-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260819145649.23439-1-philmd@oss.qualcomm.com>

x86_cpu_exec_halt() now merely checks cpu_has_work() and
conditionally call x86_cpu_transition_halt_to_exec(), which is now
the generic flow in cpu_has_work_after_processing_async_events().

Register both process_async_events and transition_halt_to_exec
handlers to use the generic target-agnostic flow, and remove the
x86_cpu_exec_halt() wrapper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/i386/tcg/helper-tcg.h        |  1 -
 target/i386/tcg/system/seg_helper.c | 11 -----------
 target/i386/tcg/tcg-cpu.c           |  3 ++-
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h
index 65819670493..d224cb3c1c7 100644
--- a/target/i386/tcg/helper-tcg.h
+++ b/target/i386/tcg/helper-tcg.h
@@ -38,7 +38,6 @@
 void x86_cpu_do_interrupt(CPUState *cpu);
 #ifndef CONFIG_USER_ONLY
 void x86_cpu_process_async_events(CPUState *cpu);
-bool x86_cpu_exec_halt(CPUState *cpu);
 void x86_cpu_transition_halt_to_exec(CPUState *cpu);
 bool x86_need_replay_interrupt(int interrupt_request);
 bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
diff --git a/target/i386/tcg/system/seg_helper.c b/target/i386/tcg/system/seg_helper.c
index 9b2adcca76c..7a3f14a255e 100644
--- a/target/i386/tcg/system/seg_helper.c
+++ b/target/i386/tcg/system/seg_helper.c
@@ -154,17 +154,6 @@ void x86_cpu_transition_halt_to_exec(CPUState *cpu)
     }
 }
 
-bool x86_cpu_exec_halt(CPUState *cpu)
-{
-    if (!cpu_has_work(cpu)) {
-        return false;
-    }
-
-    x86_cpu_transition_halt_to_exec(cpu);
-
-    return true;
-}
-
 bool x86_need_replay_interrupt(int interrupt_request)
 {
     /*
diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
index 6f5dc06b3b9..e4fc212aca5 100644
--- a/target/i386/tcg/tcg-cpu.c
+++ b/target/i386/tcg/tcg-cpu.c
@@ -180,7 +180,8 @@ const TCGCPUOps x86_tcg_ops = {
     .tlb_fill = x86_cpu_tlb_fill,
     .pointer_wrap = x86_pointer_wrap,
     .do_interrupt = x86_cpu_do_interrupt,
-    .cpu_exec_halt = x86_cpu_exec_halt,
+    .process_async_events = x86_cpu_process_async_events,
+    .transition_halt_to_exec = x86_cpu_transition_halt_to_exec,
     .cpu_exec_interrupt = x86_cpu_exec_interrupt,
     .cpu_exec_reset = x86_cpu_exec_reset,
     .do_unaligned_access = x86_cpu_do_unaligned_access,
-- 
2.53.0



  parent reply	other threads:[~2026-08-19 14:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 14:56 [PATCH 00/11] accel/tcg: Make halt-to-exec transition explicit and remove cpu_exec_halt Philippe Mathieu-Daudé
2026-08-19 14:56 ` [PATCH 01/11] accel/tcg: Rename for exception codes named @ret as @excp Philippe Mathieu-Daudé
2026-08-19 19:55   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 02/11] accel/tcg: Restrict EXCP_HALTED handling to system emulation Philippe Mathieu-Daudé
2026-08-19 20:01   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 03/11] accel/tcg: Check %halted field in cpu_handle_halt() caller Philippe Mathieu-Daudé
2026-08-19 20:02   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 04/11] accel/tcg: Refactor halt-to-execution flow in cpu_exec() Philippe Mathieu-Daudé
2026-08-19 20:03   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 05/11] accel/tcg: Introduce .process_async_events and .transition_halt_to_exec Philippe Mathieu-Daudé
2026-08-19 20:06   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 06/11] target/arm: Extract halt-to-exec transition out of arm_cpu_exec_halt() Philippe Mathieu-Daudé
2026-08-19 20:13   ` Richard Henderson
2026-08-19 21:40     ` Peter Maydell
2026-08-20  7:29       ` Philippe Mathieu-Daudé
2026-08-19 14:56 ` [PATCH 07/11] target/arm: Convert cpu_exec_halt() to transition_halt_to_exec() Philippe Mathieu-Daudé
2026-08-19 20:15   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 08/11] target/i386: Extract async event processing out of x86_cpu_exec_halt() Philippe Mathieu-Daudé
2026-08-19 20:16   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 09/11] target/i386: Extract halt-to-exec transition " Philippe Mathieu-Daudé
2026-08-19 20:17   ` Richard Henderson
2026-08-19 14:56 ` Philippe Mathieu-Daudé [this message]
2026-08-19 20:18   ` [PATCH 10/11] target/i386: Convert cpu_exec_halt() to transition_halt_to_exec() Richard Henderson
2026-08-19 20:19   ` Richard Henderson
2026-08-19 14:56 ` [PATCH 11/11] accel/tcg: Remove the now redundant cpu_exec_halt() hook Philippe Mathieu-Daudé
2026-08-19 15:05   ` Philippe Mathieu-Daudé
2026-08-19 20:20   ` Richard Henderson
2026-08-20  9:26 ` [PATCH 00/11] accel/tcg: Make halt-to-exec transition explicit and remove cpu_exec_halt Mark Cave-Ayland
2026-08-20  9:56   ` Philippe Mathieu-Daudé
2026-08-24 21:31     ` Philippe Mathieu-Daudé

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=20260819145649.23439-11-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.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 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.