aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2020-03-30 04:49:10 -0400
committerDavid Hildenbrand <david@redhat.com>2020-04-24 11:53:00 +0200
commit7e62c95250d2710779601269e0d7b57839b38130 (patch)
tree114036e0a305bd5ae889fea39d36a135117281ca
parent743713f7aa4597370d211ab18950a0dc6c28eb97 (diff)
downloadkvm-unit-tests-7e62c95250d2710779601269e0d7b57839b38130.tar.gz
s390x/smp: fix detection of "running"
On s390x hosts with a single CPU, the smp test case hangs (loops). The check if our restart has finished is wrong. Sigp sense running status checks if the CPU is currently backed by a real CPU. This means that on single CPU hosts a sigp sense running will never claim that a target is running. We need to check for not being stopped instead. Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <20200330084911.34248-2-borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <david@redhat.com>
-rw-r--r--lib/s390x/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/s390x/smp.c b/lib/s390x/smp.c
index 3f86243..203792a 100644
--- a/lib/s390x/smp.c
+++ b/lib/s390x/smp.c
@@ -128,7 +128,7 @@ static int smp_cpu_restart_nolock(uint16_t addr, struct psw *psw)
* The order has been accepted, but the actual restart may not
* have been performed yet, so wait until the cpu is running.
*/
- while (!smp_cpu_running(addr))
+ while (smp_cpu_stopped(addr))
mb();
cpu->active = true;
return 0;