From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-riscv@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v3 06/21] target/arm: Un-inline arm_set_cpu_power_state()
Date: Wed, 23 Sep 2026 19:11:00 +0200 [thread overview]
Message-ID: <20260923171116.31276-7-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com>
Move arm_set_cpu_power_state() from the header to arm-powerctl.c,
keeping the power-state helper with the other power-control code.
Restrict the call in arm_cpu_reset_hold() to system emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 8 +-------
target/arm/arm-powerctl.c | 7 +++++++
target/arm/cpu.c | 4 ++--
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 1775835ad50..1efda543270 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -2082,12 +2082,6 @@ bool arm_cpu_match_cpreg_mig_tolerance(ARMCPU *cpu, uint64_t kvmidx,
/**
* arm_set_cpu_power_state() - set power state synced with halt_reason
*/
-static inline void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state)
-{
- CPUARMState *env = &cpu->env;
-
- cpu->power_state = state;
- env->halt_reason = state == PSCI_OFF ? HALT_PSCI : NOT_HALTED;
-}
+void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state);
#endif
diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index a06be5cc997..213e7ae056c 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -45,6 +45,13 @@ struct CpuOnInfo {
bool target_aa64;
};
+void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state)
+{
+ CPUARMState *env = &cpu->env;
+
+ cpu->power_state = state;
+ env->halt_reason = state == PSCI_OFF ? HALT_PSCI : NOT_HALTED;
+}
static void arm_set_cpu_on_async_work(CPUState *target_cpu_state,
run_on_cpu_data data)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index f58a1db843a..76aa47ac503 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -351,8 +351,6 @@ static void arm_cpu_reset_hold(Object *obj, ResetType type)
env->vfp.xregs[ARM_VFP_MVFR1] = cpu->isar.mvfr1;
env->vfp.xregs[ARM_VFP_MVFR2] = cpu->isar.mvfr2;
- arm_set_cpu_power_state(cpu, cs->start_powered_off ? PSCI_OFF : PSCI_ON);
-
if (arm_feature(env, ARM_FEATURE_AARCH64)) {
/* 64 bit CPUs always start in 64 bit mode */
env->aarch64 = true;
@@ -671,6 +669,8 @@ static void arm_cpu_reset_hold(Object *obj, ResetType type)
arm_set_ah_fp_behaviours(&env->vfp.fp_status[FPST_AH_F16]);
#ifndef CONFIG_USER_ONLY
+ arm_set_cpu_power_state(cpu, cs->start_powered_off ? PSCI_OFF : PSCI_ON);
+
if (kvm_enabled()) {
kvm_arm_reset_vcpu(cpu);
}
--
2.53.0
next prev parent reply other threads:[~2026-09-23 17:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 17:10 [PATCH v3 00/21] accel/tcg: Make halt-to-exec transition explicit and remove cpu_exec_halt Philippe Mathieu-Daudé
2026-09-23 17:10 ` [PATCH v3 01/21] system: Document has_work() synchronization requirements Philippe Mathieu-Daudé
2026-09-23 17:10 ` [PATCH v3 02/21] target/s390x: Use s390_cpu_get_state() consistently Philippe Mathieu-Daudé
2026-09-23 17:10 ` [PATCH v3 03/21] target/s390x: Make s390_cpu_set_state() return void Philippe Mathieu-Daudé
2026-09-23 17:10 ` [PATCH v3 04/21] target/s390x: Use S390CpuState for CPU state APIs Philippe Mathieu-Daudé
2026-09-23 17:32 ` Eric Farman
2026-09-23 17:10 ` [PATCH v3 05/21] target/s390x: Access S390CpuState atomically Philippe Mathieu-Daudé
2026-09-23 17:11 ` Philippe Mathieu-Daudé [this message]
2026-09-23 17:11 ` [PATCH v3 07/21] target/arm: Kick vCPU after updating PSCI power state Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 08/21] target/arm: Access PSCI state atomically Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 09/21] target/arm: Access halt " Philippe Mathieu-Daudé
2026-09-23 17:29 ` Richard Henderson
2026-09-23 17:11 ` [PATCH v3 10/21] target/riscv: Skip empty MIP updates Philippe Mathieu-Daudé
2026-09-23 19:02 ` Richard Henderson
2026-09-23 17:11 ` [PATCH v3 11/21] target/riscv: Add riscv_cpu_get_mip() Philippe Mathieu-Daudé
2026-09-23 19:04 ` Richard Henderson
2026-09-23 17:11 ` [PATCH v3 12/21] target/riscv: Access MIP atomically Philippe Mathieu-Daudé
2026-09-23 19:05 ` Richard Henderson
2026-09-23 17:11 ` [PATCH v3 13/21] accel/tcg: Refactor poll-while-halted flow in cpu_exec() Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 14/21] accel/tcg: Introduce poll_during_halt() and leaving_halt() Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 15/21] target/arm: Split leaving-halt handling from arm_cpu_exec_halt() Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 16/21] target/arm: Convert cpu_exec_halt() to leaving_halt() Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 17/21] target/i386: Use an acquire load for interrupt_request Philippe Mathieu-Daudé
2026-09-23 19:18 ` Richard Henderson
2026-09-28 6:26 ` Zhao Liu
2026-09-23 17:11 ` [PATCH v3 18/21] target/i386: Split APIC polling from x86_cpu_exec_halt() Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 19/21] target/i386: Split leaving-halt handling " Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 20/21] target/i386: Use generic halt transition handlers Philippe Mathieu-Daudé
2026-09-23 17:11 ` [PATCH v3 21/21] accel/tcg: Remove the redundant cpu_exec_halt() hook 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=20260923171116.31276-7-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@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.