]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/s390x: Have s390_cpu_halt() not return anything
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 8 Jul 2025 09:57:45 +0000 (11:57 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 11 Jul 2025 08:33:56 +0000 (10:33 +0200)
Since halting a vCPU and how many left running do not need
to be tied together, split the s390_count_running_cpus()
call out of s390_cpu_halt() to the single caller using it:
s390_handle_wait().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250708095746.12697-4-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/cpu-system.c
target/s390x/helper.c
target/s390x/s390x-internal.h

index 2fa8c4d75dbb371dce7a40036627ff31a77804c4..709ccd52992cedbc82f8b259583a1d3007b18cfc 100644 (file)
@@ -214,7 +214,7 @@ unsigned s390_count_running_cpus(void)
     return nr_running;
 }
 
-unsigned int s390_cpu_halt(S390CPU *cpu)
+void s390_cpu_halt(S390CPU *cpu)
 {
     CPUState *cs = CPU(cpu);
     trace_cpu_halt(cs->cpu_index);
@@ -223,8 +223,6 @@ unsigned int s390_cpu_halt(S390CPU *cpu)
         cs->halted = 1;
         cs->exception_index = EXCP_HLT;
     }
-
-    return s390_count_running_cpus();
 }
 
 void s390_cpu_unhalt(S390CPU *cpu)
index 3c57c32e479736f7571e29769d35d3b905630dde..5c127da1a6a89fdb0e3a7cbb2a315125bde14e8f 100644 (file)
@@ -91,7 +91,9 @@ void s390_handle_wait(S390CPU *cpu)
 {
     CPUState *cs = CPU(cpu);
 
-    if (s390_cpu_halt(cpu) == 0) {
+    s390_cpu_halt(cpu);
+
+    if (s390_count_running_cpus() == 0) {
         if (is_special_wait_psw(cpu->env.psw.addr)) {
             qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
         } else {
index 145e472edf0bd97cdc16c40b0e62ac4577b28824..56cce2e7f50601172fda61add4fa01c98310dbe9 100644 (file)
@@ -239,7 +239,7 @@ uint32_t calc_cc(CPUS390XState *env, uint32_t cc_op, uint64_t src, uint64_t dst,
 /* cpu.c */
 #ifndef CONFIG_USER_ONLY
 unsigned int s390_count_running_cpus(void);
-unsigned int s390_cpu_halt(S390CPU *cpu);
+void s390_cpu_halt(S390CPU *cpu);
 void s390_cpu_unhalt(S390CPU *cpu);
 void s390_cpu_system_init(Object *obj);
 bool s390_cpu_system_realize(DeviceState *dev, Error **errp);