From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSkh-0000W2-5o for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCSkb-0008J3-CV for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:17:35 -0400 Received: from greensocs.com ([193.104.36.180]:50747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCSkb-0008Is-2J for qemu-devel@nongnu.org; Tue, 07 Jul 2015 09:17:29 -0400 Message-ID: <559BD166.8040202@greensocs.com> Date: Tue, 07 Jul 2015 15:17:26 +0200 From: Frederic Konrad MIME-Version: 1.0 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> <87oajo9mql.fsf@linaro.org> In-Reply-To: <87oajo9mql.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?B?QWxleCBCZW5uw6ll?= 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 On 07/07/2015 14:27, Alex Benn=C3=A9e wrote: > 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 waitin= g >>> 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 o= f >>> 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 broke= n > the rest of the tree is. > > I appreciate we are still at the RFC stage here but it will probably pa= y > off in the long run to try and avoid breaking the rest of the tree ;-) > Good point :) Fred