From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awDjq-0003jv-CZ for qemu-devel@nongnu.org; Fri, 29 Apr 2016 15:06:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awDje-0008EV-MC for qemu-devel@nongnu.org; Fri, 29 Apr 2016 15:06:00 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:36306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awDjd-000819-C9 for qemu-devel@nongnu.org; Fri, 29 Apr 2016 15:05:54 -0400 Received: by mail-lf0-x241.google.com with SMTP id y84so19018587lfc.3 for ; Fri, 29 Apr 2016 12:05:39 -0700 (PDT) References: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org> <1461881459-14297-7-git-send-email-sergey.fedorov@linaro.org> <87d1p8ed0w.fsf@linaro.org> <57236881.9020906@gmail.com> <1d7030da-2416-f684-a721-d714d15fd7da@twiddle.net> From: Sergey Fedorov Message-ID: <5723B07C.2070807@gmail.com> Date: Fri, 29 Apr 2016 22:05:32 +0300 MIME-Version: 1.0 In-Reply-To: <1d7030da-2416-f684-a721-d714d15fd7da@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v6 6/6] cpu-exec: Move TB chaining into tb_find_fast() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Sergey Fedorov Cc: qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite On 29/04/16 19:32, Richard Henderson wrote: > On 04/29/2016 06:58 AM, Sergey Fedorov wrote: >> On 29/04/16 16:54, Alex Bennée wrote: >>> Sergey Fedorov writes: >>>> diff --git a/cpu-exec.c b/cpu-exec.c >>>> index f49a436e1a5a..5f23c0660d6e 100644 >>>> --- a/cpu-exec.c >>>> +++ b/cpu-exec.c >>>> @@ -320,7 +320,9 @@ found: >>>> return tb; >>>> } >>>> >>>> -static inline TranslationBlock *tb_find_fast(CPUState *cpu) >>>> +static inline TranslationBlock *tb_find_fast(CPUState *cpu, >>>> + TranslationBlock **last_tb, >>>> + int tb_exit) >>>> { >>>> CPUArchState *env = (CPUArchState *)cpu->env_ptr; >>>> TranslationBlock *tb; >>>> @@ -331,11 +333,24 @@ static inline TranslationBlock *tb_find_fast(CPUState *cpu) >>>> always be the same before a given translated block >>>> is executed. */ >>>> cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); >>>> + tb_lock(); >>>> tb = cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)]; >>>> if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base || >>>> tb->flags != flags)) { >>>> tb = tb_find_slow(cpu, pc, cs_base, flags); >>>> } >>>> + if (cpu->tb_flushed) { >>>> + /* Ensure that no TB jump will be modified as the >>>> + * translation buffer has been flushed. >>>> + */ >>>> + *last_tb = NULL; >>>> + cpu->tb_flushed = false; >>>> + } >>>> + /* See if we can patch the calling TB. */ >>>> + if (*last_tb && qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { >>> This should be !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN) >> Probably, it's mine rebase conflict resolution mistake. Nice catch, thanks! > Fixed while applying all to tcg-next. Thanks! Kind regards, Sergey