From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPqVl-0004Yy-FN for qemu-devel@nongnu.org; Thu, 13 Aug 2015 07:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPqVi-0007vf-OU for qemu-devel@nongnu.org; Thu, 13 Aug 2015 07:17:29 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:37244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPqVi-0007ux-H8 for qemu-devel@nongnu.org; Thu, 13 Aug 2015 07:17:26 -0400 Received: by wibhh20 with SMTP id hh20so69128616wib.0 for ; Thu, 13 Aug 2015 04:17:22 -0700 (PDT) Sender: Paolo Bonzini References: <1439220437-23957-1-git-send-email-fred.konrad@greensocs.com> <1439220437-23957-12-git-send-email-fred.konrad@greensocs.com> From: Paolo Bonzini Message-ID: <55CC7CBA.6030403@redhat.com> Date: Thu, 13 Aug 2015 13:17:14 +0200 MIME-Version: 1.0 In-Reply-To: <1439220437-23957-12-git-send-email-fred.konrad@greensocs.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V7 11/19] tcg: switch on multithread. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fred.konrad@greensocs.com, qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: alex.bennee@linaro.org, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, guillaume.delbergue@greensocs.com On 10/08/2015 17:27, fred.konrad@greensocs.com wrote: > + while (!cpu->exit_request) { > qemu_clock_enable(QEMU_CLOCK_VIRTUAL, > (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0); > > @@ -1507,7 +1480,7 @@ static void tcg_exec_all(void) > } > } > > - first_cpu->exit_request = 0; > + cpu->exit_request = 0; One issue here is that when tcg_cpu_exec returns EXCP_HALTED, the function keeps looping. There is no need to set cpu->exit_request in that case, since in fact there is no request pending, so the while loop probably should be an "if". Also, cpu->interrupt_request is not protected by any mutex, so everything apart from the non-zero test must take the iothread mutex. Paolo