cpus: make pause_all_cpus() play with SMP on single threaded TCG
commitebd05fea9be1dfd043aaa763fb6d2cd971346a58
authorDavid Hildenbrand <david@redhat.com>
Wed, 29 Nov 2017 19:12:15 +0000 (29 20:12 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Dec 2017 08:22:44 +0000 (21 09:22 +0100)
tree69eac14cc147b99a5120653ff1b7ec13fbfcc84d
parent09df29b665a91ba78b2187ce3b1967526ce121f6
cpus: make pause_all_cpus() play with SMP on single threaded TCG

pause_all_cpus() is sometimes called from a VCPU thread (e.g. s390x
during special reset). It cannot deal with multiple VCPUs per Thread
(single threaded TCG) yet.

Booting an s390x guest with -smp 2 and single threaded TCG from disk
currently fails. The DIAG 308 will issue a pause_all_cpus() and wait
forever for the CPUs to actually stop. But it is waiting for itself.

So let's stop all VCPUs belonging to the current thread. Factor out
stopping of a VCPU.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20171129191215.11323-1-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpus.c