From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: "Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Mohamed Mediouni" <mohamed@unpredictable.fr>,
"Alexander Graf" <agraf@csgraf.de>,
qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, kvm@vger.kernel.org,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-arm@nongnu.org,
"Magnus Kulke" <magnuskulke@linux.microsoft.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>
Subject: [PATCH 03/16] cpus: Rename cpu_stop_current() -> qemu_cpu_stop_self()
Date: Thu, 13 Aug 2026 20:16:26 +0200 [thread overview]
Message-ID: <20260813181640.6537-4-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260813181640.6537-1-philmd@oss.qualcomm.com>
There is a single method with ending with _current() suffix.
Align with qemu_cpu_kick_self() and pthread conventions by
renaming cpu_stop_current() -> qemu_cpu_stop_self() for
consistency.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
include/system/cpus.h | 8 +++++++-
hw/ppc/spapr_rtas.c | 2 +-
system/cpus.c | 2 +-
system/runstate.c | 6 +++---
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/system/cpus.h b/include/system/cpus.h
index ade13e068eb..2365c7c4597 100644
--- a/include/system/cpus.h
+++ b/include/system/cpus.h
@@ -28,7 +28,13 @@ bool qemu_in_vcpu_thread(void);
void qemu_init_cpu_loop(void);
void resume_all_vcpus(void);
void pause_all_vcpus(void);
-void cpu_stop_current(void);
+
+/**
+ * qemu_cpu_stop_self - Stop execution of the current vCPU
+ *
+ * Note: No effect if not executing within a vCPU thread.
+ */
+void qemu_cpu_stop_self(void);
/**
* qemu_cpu_kick_self - Force vCPU to re-enter to its inner main loop
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 328fc27c400..80cd4246af8 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -93,7 +93,7 @@ static void rtas_power_off(PowerPCCPU *cpu, SpaprMachineState *spapr,
return;
}
qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
- cpu_stop_current();
+ qemu_cpu_stop_self();
rtas_st(rets, 0, RTAS_OUT_SUCCESS);
}
diff --git a/system/cpus.c b/system/cpus.c
index f37e215c586..1a6fd286a81 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -674,7 +674,7 @@ void qemu_init_vcpu(CPUState *cpu)
}
}
-void cpu_stop_current(void)
+void qemu_cpu_stop_self(void)
{
if (current_cpu) {
current_cpu->stop = true;
diff --git a/system/runstate.c b/system/runstate.c
index d3e64d2b625..1302fea9ccd 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -472,7 +472,7 @@ int vm_stop(RunState state)
* FIXME: should not return to device code in case
* vm_stop() has been requested.
*/
- cpu_stop_current();
+ qemu_cpu_stop_self();
return 0;
}
@@ -900,7 +900,7 @@ void qemu_system_reset_request(ShutdownCause reason)
} else {
reset_requested = reason;
}
- cpu_stop_current();
+ qemu_cpu_stop_self();
qemu_notify_event();
}
@@ -918,7 +918,7 @@ void qemu_system_suspend_request(void)
return;
}
suspend_requested = 1;
- cpu_stop_current();
+ qemu_cpu_stop_self();
qemu_notify_event();
}
--
2.53.0
next prev parent reply other threads:[~2026-08-13 18:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 18:16 [PATCH 00/16] cpus: Improvements around BQL locking, improving docstring Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 01/16] accel: Label outer / inner vCPU execution loops Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 02/16] cpus: Improve qemu_cpu_kick_self() docstring Philippe Mathieu-Daudé
2026-08-13 18:16 ` Philippe Mathieu-Daudé [this message]
2026-08-13 18:16 ` [PATCH 04/16] cpus: Rename qemu_cpu_stop() to qemu_cpu_ack_stop_request() Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 05/16] cpus: Improve cpu_pause() docstring Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 06/16] cpus: Improve cpu_exit() docstring Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 07/16] cpus: Document process_queued_cpu_work*() runs on current vCPU Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 08/16] cpus: Slightly improve *run_on_cpu() docstrings Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 09/16] accel/tcg: Use RUN_ON_CPU_NULL for tcg_commit() callbacks Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 10/16] accel/kvm: Clarify use of @r variable in vcpu thread loop Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 11/16] accel/kvm: Consistently return CPU halt state from process_async_events Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 12/16] target/arm/hvf: Move flush_cpu_state() into the inner vCPU loop Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 13/16] target/arm/hvf: Lock BQL outside of the vCPU inner execution loop Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 14/16] target/i386/hvf: " Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 15/16] target/arm/powerctl: Move BQL assertions to async work context Philippe Mathieu-Daudé
2026-08-13 18:16 ` [PATCH 16/16] target/arm/whpx: Fix argument order typo in memory access error message 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=20260813181640.6537-4-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=agraf@csgraf.de \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=harshpb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=magnuskulke@linux.microsoft.com \
--cc=mohamed@unpredictable.fr \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@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.