aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/sigp.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/s390x/sigp.c')
-rw-r--r--target/s390x/sigp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c
index 964c75a736..ac3f8e7dc2 100644
--- a/target/s390x/sigp.c
+++ b/target/s390x/sigp.c
@@ -232,8 +232,12 @@ static void sigp_restart(CPUState *cs, run_on_cpu_data arg)
case CPU_STATE_STOPPED:
/* the restart irq has to be delivered prior to any other pending irq */
cpu_synchronize_state(cs);
- do_restart_interrupt(&cpu->env);
+ /*
+ * Set OPERATING (and unhalting) before loading the restart PSW.
+ * load_psw() will then properly halt the CPU again if necessary (TCG).
+ */
s390_cpu_set_state(CPU_STATE_OPERATING, cpu);
+ do_restart_interrupt(&cpu->env);
break;
case CPU_STATE_OPERATING:
cpu_inject_restart(cpu);