From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhZtZ-0003hz-VD for qemu-devel@nongnu.org; Wed, 07 Sep 2016 06:15:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhZtV-0001uY-06 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 06:15:53 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:38068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhZtU-0001tq-Fg for qemu-devel@nongnu.org; Wed, 07 Sep 2016 06:15:48 -0400 Received: by mail-wm0-x231.google.com with SMTP id 1so23098601wmz.1 for ; Wed, 07 Sep 2016 03:15:47 -0700 (PDT) References: <1470929064-4092-1-git-send-email-alex.bennee@linaro.org> <1470929064-4092-15-git-send-email-alex.bennee@linaro.org> <59f45c89-fac5-2221-161f-cdd94f6bf65c@twiddle.net> <343948b2-19a8-d6b5-1091-a6fe1b2d66c7@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <343948b2-19a8-d6b5-1091-a6fe1b2d66c7@redhat.com> Date: Wed, 07 Sep 2016 11:15:44 +0100 Message-ID: <878tv4yq0f.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v4 14/28] tcg: add kick timer for single-threaded vCPU emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Richard Henderson , mttcg@greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com, peter.maydell@linaro.org, Peter Crosthwaite , claudio.fontana@huawei.com, mark.burton@greensocs.com, jan.kiszka@siemens.com, serge.fdrv@gmail.com Paolo Bonzini writes: > On 07/09/2016 05:25, Richard Henderson wrote: >>> >>> + /* Set to kick if we have to do more than one vCPU */ >>> + if (CPU_NEXT(first_cpu)) { >>> + kick_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, kick_tcg_thread, >>> + &kick_timer); >> >> I'm not especially keen on this pointer to local variable thing. >> Perhaps better as >> >> kick_timer = timer_new_ns(..., NULL); >> kick_timer->opaque = kick_timer; > > Or put it in CPUState and pass that. I was trying to avoid expanding CPUState for something that is only required in one mode of operation. However I appreciate abusing the stack is a little magical even though we never leave the function. If setting kick_timer->opaque directly doesn't violate the interface then I'll do that. > > Paolo > >> and avoid the indirection in kick_tcg_thread. -- Alex Bennée