[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/30] cpus: tcg: fix never exiting loop on unplug
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 03/30] cpus: tcg: fix never exiting loop on unplug |
Date: |
Wed, 9 May 2018 00:14:20 +0200 |
From: Cédric Le Goater <address@hidden>
Commit 9b0605f9837b ("cpus: tcg: unregister thread with RCU, fix
exiting of loop on unplug") changed the exit condition of the loop in
the vCPU thread function but forgot to remove the beginning 'while (1)'
statement. The resulting code :
while (1) {
...
} while (!cpu->unplug || cpu_can_run(cpu));
is a sequence of two distinct two while() loops, the first not exiting
in case of an unplug event.
Remove the first while (1) to fix CPU unplug.
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Cc: address@hidden
Fixes: 9b0605f9837b68fd56c7fc7c96a3a1a3b983687d
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
---
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index be3a4eb..d1f1629 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1648,7 +1648,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
/* process any pending work */
cpu->exit_request = 1;
- while (1) {
+ do {
if (cpu_can_run(cpu)) {
int r;
qemu_mutex_unlock_iothread();
--
1.8.3.1
- [Qemu-devel] [PULL 00/30] Misc patches for 2018-05-09, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 01/30] configure: recognize more rpmbuild macros, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 03/30] cpus: tcg: fix never exiting loop on unplug,
Paolo Bonzini <=
- [Qemu-devel] [PULL 02/30] cpus: Fix event order on resume of stopped guest, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 04/30] checkpatch.pl: add common glib defines to typelist, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 06/30] memdev: remove "id" property, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 05/30] qom: allow object_get_canonical_path_component without parent, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 09/30] exec: extract address_space_translate_iommu, fix page_mask corner case, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 08/30] exec: small changes to flatview_do_translate, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 10/30] exec: reintroduce MemoryRegion caching, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 11/30] qemu-thread: always keep the posix wrapper layer, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 12/30] update-linux-headers: drop hyperv.h, Paolo Bonzini, 2018/05/08
- [Qemu-devel] [PULL 07/30] exec: move memory access declarations to a common header, inline *_phys functions, Paolo Bonzini, 2018/05/08