From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ankQb-0000sE-3n for qemu-devel@nongnu.org; Wed, 06 Apr 2016 06:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ankQX-0000fG-Up for qemu-devel@nongnu.org; Wed, 06 Apr 2016 06:11:13 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:36458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ankQX-0000f9-Lb for qemu-devel@nongnu.org; Wed, 06 Apr 2016 06:11:09 -0400 Received: by mail-lf0-x241.google.com with SMTP id p81so3854123lfb.3 for ; Wed, 06 Apr 2016 03:11:09 -0700 (PDT) References: <1459870344-16773-1-git-send-email-alex.bennee@linaro.org> <1459870344-16773-2-git-send-email-alex.bennee@linaro.org> <5703DD59.4040302@redhat.com> From: Sergey Fedorov Message-ID: <5704E0BA.9090100@gmail.com> Date: Wed, 6 Apr 2016 13:11:06 +0300 MIME-Version: 1.0 In-Reply-To: <5703DD59.4040302@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v2 01/11] tcg: move tb_invalidated_flag to CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org Cc: peter.maydell@linaro.org, claudio.fontana@huawei.com, Sergey Fedorov , Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, =?UTF-8?Q?Andreas_F=c3=a4rber?= , rth@twiddle.net On 05/04/16 18:44, Paolo Bonzini wrote: > > On 05/04/2016 17:32, Alex Bennée wrote: >> + cpu->tb_invalidated_flag = false; >> tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base, orig_tb->flags, >> max_cycles | CF_NOCACHE >> | (ignore_icount ? CF_IGNORE_ICOUNT : 0)); >> - tb->orig_tb = tcg_ctx.tb_ctx.tb_invalidated_flag ? NULL : orig_tb; >> + tb->orig_tb = cpu->tb_invalidated_flag ? NULL : orig_tb; >> cpu->current_tb = tb; > Based on discussion, it's safest to save the old value at the beginning > of the hunk, and "OR" it into cpu->tb_invalidated_flag here. > >> /* if no translated code available, then translate it now */ >> + cpu->tb_invalidated_flag = false; > Please remove this... > >> tb = tb_gen_code(cpu, pc, cs_base, flags, 0); >> >> #ifdef CONFIG_USER_ONLY >> @@ -509,12 +509,11 @@ int cpu_exec(CPUState *cpu) >> tb = tb_find_fast(cpu); >> /* Note: we do it here to avoid a gcc bug on Mac OS X when >> doing it in tb_find_slow */ >> - if (tcg_ctx.tb_ctx.tb_invalidated_flag) { >> + if (cpu->tb_invalidated_flag) { >> /* as some TB could have been invalidated because >> - of memory exceptions while generating the code, we >> + of a tb_flush while generating the code, we >> must recompute the hash index here */ >> next_tb = 0; >> - tcg_ctx.tb_ctx.tb_invalidated_flag = 0; > ... and leave the zeroing here. > Yes, I'm going to do something like this in a separate patch series or just append it back to the "TCG misc clean-up" patch series when re-spinning it. Kind regards, Sergey