* [Qemu-devel] [PATCH] linux-user: In fork_end(), remove correct CPUs from CPU list
@ 2016-06-07 16:31 Peter Maydell
0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2016-06-07 16:31 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, Riku Voipio, Laurent Vivier
In fork_end(), we must fix the list of current CPUs to match the fact
that the child of the fork has only one thread. Unfortunately we were
removing the wrong CPUs from the list, which meant that if the child
subsequently did an exclusive operation it would deadlock in
start_exclusive() waiting for a sibling CPU which didn't exist.
In particular this could cause hangs doing git submodule init
operations, as reported in https://bugs.launchpad.net/qemu/+bug/955379
comment #47.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
linux-user/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index b6da0ba..150a356 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -130,7 +130,7 @@ void fork_end(int child)
Discard information about the parent threads. */
CPU_FOREACH_SAFE(cpu, next_cpu) {
if (cpu != thread_cpu) {
- QTAILQ_REMOVE(&cpus, thread_cpu, node);
+ QTAILQ_REMOVE(&cpus, cpu, node);
}
}
pending_cpus = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-07 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-07 16:31 [Qemu-devel] [PATCH] linux-user: In fork_end(), remove correct CPUs from CPU list Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).