From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRy3-000550-Ul for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:27:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCRy1-0000L3-6O for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:27:19 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:33139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRy1-0000Kx-0J for qemu-devel@nongnu.org; Tue, 07 Jul 2015 08:27:17 -0400 Received: by wiwl6 with SMTP id l6so312996184wiw.0 for ; Tue, 07 Jul 2015 05:27:16 -0700 (PDT) References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> <1435330053-18733-7-git-send-email-fred.konrad@greensocs.com> <558D699A.2010804@redhat.com> <558D72A3.4060907@greensocs.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <558D72A3.4060907@greensocs.com> Date: Tue, 07 Jul 2015 13:27:14 +0100 Message-ID: <87oajo9mql.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC PATCH V6 06/18] tcg: remove tcg_halt_cond global variable. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad Cc: mttcg@greensocs.com, peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, agraf@suse.de, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, Paolo Bonzini , alistair.francis@xilinx.com Frederic Konrad writes: > On 26/06/2015 17:02, Paolo Bonzini wrote: >> >> On 26/06/2015 16:47, fred.konrad@greensocs.com wrote: >>> From: KONRAD Frederic >>> >>> This removes tcg_halt_cond global variable. >>> We need one QemuCond per virtual cpu for multithread TCG. >>> >>> Signed-off-by: KONRAD Frederic >>> @@ -1068,7 +1065,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) >>> qemu_clock_notify(QEMU_CLOCK_VIRTUAL); >>> } >>> } >>> - qemu_tcg_wait_io_event(); >>> + qemu_tcg_wait_io_event(QTAILQ_FIRST(&cpus)); >> Does this work (for non-multithreaded TCG) if tcg_thread_fn is waiting >> on the "wrong" condition variable? For example if all CPUs are idle and >> the second CPU wakes up, qemu_tcg_wait_io_event won't be kicked out of >> the wait. >> >> I think you need to have a CPUThread struct like this: >> >> struct CPUThread { >> QemuThread thread; >> QemuCond halt_cond; >> }; >> >> and in CPUState have a CPUThread * field instead of the thread and >> halt_cond fields. >> >> Then single-threaded TCG can point all CPUStates to the same instance of >> the struct, while multi-threaded TCG can point each CPUState to a >> different struct. >> >> Paolo > > Hmm probably not, though we didn't pay attention to keep the non MTTCG > working. > (which is probably not good). You may want to consider push a branch up to a github mirror and enabling travis-ci on the repo. That way you'll at least know how broken the rest of the tree is. I appreciate we are still at the RFC stage here but it will probably pay off in the long run to try and avoid breaking the rest of the tree ;-) -- Alex Bennée