From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVa0R-0000Ww-C7 for qemu-devel@nongnu.org; Sat, 29 Aug 2015 02:52:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVa0Q-0000uh-JX for qemu-devel@nongnu.org; Sat, 29 Aug 2015 02:52:51 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:37569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVa0Q-0000uX-CX for qemu-devel@nongnu.org; Sat, 29 Aug 2015 02:52:50 -0400 Received: by wicfv10 with SMTP id fv10so28613911wic.0 for ; Fri, 28 Aug 2015 23:52:49 -0700 (PDT) Sender: Paolo Bonzini References: <1439397664-70734-1-git-send-email-pbonzini@redhat.com> <1439397664-70734-3-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <55E156C1.7020909@redhat.com> Date: Sat, 29 Aug 2015 08:52:49 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/10] cpus: remove tcg_halt_cond global variable. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: mttcg@greensocs.com, QEMU Developers , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= On 28/08/2015 16:36, Peter Maydell wrote: > With this patch, code-wise tcg_halt_cond and tcg_cpu_thread > are used in pretty much parallel ways (first call into > qemu_tcg_init_vcpu() sets them up, all the rest just copy > them into the CPU struct). The only difference is that one > of them a static at file scope and the other one is a static > at function scope. It seems a shame to not have them be > exactly parallel... Good point, this does the trick: diff --git a/cpus.c b/cpus.c index 105b914..054dd68 100644 --- a/cpus.c +++ b/cpus.c @@ -786,8 +786,6 @@ static unsigned iothread_requesting_mutex; static QemuThread io_thread; -static QemuThread *tcg_cpu_thread; - /* cpu creation */ static QemuCond qemu_cpu_cond; /* system init */ @@ -1222,6 +1220,7 @@ static void qemu_tcg_init_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; static QemuCond *tcg_halt_cond; + static QemuThread *tcg_cpu_thread; tcg_cpu_address_space_init(cpu, cpu->as); Paolo